MariaDB starting with 5.5.33

Starting from MariaDB 5.5.33 and MariaDB 10.0.5, TokuDB is included on those platforms that TokuDB supports.

Currently, those platforms are:

  • Ubuntu 12.10 "quantal" 64-bit and newer
  • Debian 7 "wheezy" 64-bit and newer
  • Fedora 19 64-bit and newer
MariaDB starting with 5.5.36

Starting from MariaDB 5.5.36 and MariaDB 10.0.9 TokuDB is also available on

  • CentOS 6 64-bit
  • Red Hat 6 64-bit

Note: The TokuDB version that comes from MariaDB.org differs slightly from the TokuDB version from Tokutek. Please read the TokuDB Differences article before using TokuDB!

The following sections detail how to install and enable TokuDB.

Installing TokuDB

Installing TokuDB on Fedora, RedHat, & CentOS

Install MariaDB as per the instructions on the Installing MariaDB with YUM page.

MariaDB starting with 5.5.34

From MariaDB 5.5.34 and MariaDB 10.0.6, the TokuDB storage engine is included in the MariaDB-server package. Simply install MariaDB and then enable the TokuDB plugin as outlined in the Enabling TokuDB section, below.

MariaDB 5.5.33

In MariaDB 5.5.33 and MariaDB 10.0.5, TokuDB is in a separate RPM package called MariaDB-tokudb-engine and is installed as follows:

sudo yum install MariaDB-tokudb-engine

After installing the package, enable the TokuDB plugin as outlined in the Enabling TokuDB section, below.

Installing TokuDB on Ubuntu & Debian

First install MariaDB as per the instructions on the Installing MariaDB .deb Files page.

On Ubuntu, TokuDB is available on the 64-bit versions of Ubuntu 12.10 and newer. On Debian, TokuDB is available on the 64-bit versions of Debian 7 "Wheezy" and newer.

MariaDB starting with 5.5.34

From MariaDB 5.5.34 and MariaDB 10.0.6, TokuDB is included in the mariadb-server-x.x package (where x.x is the MariaDB series you are using, for example, 10.0 or 5.5.). Simply install MariaDB and then enable the TokuDB plugin as outlined in the Enabling TokuDB section, below.

MariaDB 5.5.33

In MariaDB 5.5.33 and MariaDB 10.0.5, TokuDB is in a separate package called mariadb-tokudb-engine-x.x, where x.x is the MariaDB series (5.5 or 10.0). The package is installed, for example on 5.5, as follows:

sudo apt-get install mariadb-tokudb-engine-5.5

After installing the package, enable the TokuDB plugin as outlined in the Enabling TokuDB section, below.

Check for Transparent HugePage Support on Linux

The TokuDB README says:

Transparent hugepages is a feature in newer linux kernel versions that causes problems for the memory usage tracking calculations in TokuKV and can lead to memory overcommit. If you have this feature enabled, TokuKV will not start, and you should turn it off.

You can check the status of Transparent Hugepages as follows:

cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never

If the path does not exist, they are not enabled and you may continue.

To disable them, pass "transparent_hugepage=never" to the kernel in your bootloader (grub, lilo, etc.).

You can also disable with:

echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

Enabling TokuDB

MariaDB's default my.cnf files come with a section for TokuDB. To enable TokuDB just remove the '#' comment markers from the options in the TokuDB section.

A typical TokuDB section looks like the following:

# See https://mariadb.com/kb/en/how-to-enable-tokudb-in-mariadb/
# for instructions how to enable TokuDB
#
# See https://mariadb.com/kb/en/tokudb-differences/ for differences
# between TokuDB in MariaDB and TokuDB from http://www.tokutek.com/

plugin-load=ha_tokudb

By default, the plugin-load option is commented out. Simply un-comment it as in the example above and restart MariaDB to activate TokuDB.

Enabling TokuDB on Fedora

Instead of putting the TokuDB section in the main my.cnf file, it is placed in a separate file located at: /etc/my.cnf.d/tokudb.cnf

Enabling TokuDB on Ubuntu & Debian

Instead of putting the TokuDB section in the main my.cnf file, it is placed in a separate file located at: /etc/mysql/conf.d/tokudb.cnf

Enabling TokuDB manually from the mysql command line

Generally, it is recommended to use one of the above methods to enable the TokuDB storage engine, but it is also possible to enable it manually as with other plugins. To do so, launch the mysql command-line client and connect to MariaDB as a user with the SUPER privilege and execute the following command:

INSTALL SONAME 'ha_tokudb';

TokuDB will be installed until someone executes UNINSTALL SONAME.

Temporarily enabling TokuDB when starting MariaDB

If you just want to test TokuDB, you can start the mysqld server with TokuDB with the following command:

mysqld --plugin-load=ha_tokudb --plugin-dir=/usr/local/mysql/lib/mysql/plugin

tokudb_cache_size

  • Description: This variable is read-only and cannot be changed dynamically. To change the value, either set the value in the my.cnf file prior to loading TokuDB or restart MariaDB after modifying the configuration. If you have loaded the plugin but not used TokuDB yet, you can unload the plugin then reload it and MariaDB will reload the plugin with the setting from the configuration file.
  • Dynamic: No
  • Data Type: numeric
  • Default Value: Half of the total system memory

See also

Comments

Comments loading...