How to enable TokuDB in MariaDB

You are viewing an old version of this article. View the current version here.
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
  • Ubuntu 13.04 "Raring" 64-bit
  • Debian 7 "Wheezy" 64-bit
  • Fedora 17 64-bit
  • Fedora 18 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!

TokuDB is included in a separate package and is not installed or enabled by default. The following sections detail how to install and enable TokuDB.

Installing TokuDB

Installing TokuDB on Fedora

First install MariaDB as per the instructions on the Installing MariaDB with YUM page.

On Fedora 17 and 18 64-bit, the TokuDB package is called MariaDB-tokudb-engine and is installed as follows:

sudo yum install MariaDB-tokudb-engine

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 13.04 "Raring" and 12.10 "Quantal". On Debian, TokuDB is available on the 64-bit version of Debian 7 "Wheezy". The package is called mariadb-tokudb-engine-5.5 and is installed as follows:

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

Enabling TokuDB

New 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

The tokudb_cache_size variable

By default when TokuDB is loaded, the tokudb_cache_size value will be set to the half of the system memory.

This variable is read-only, it's either possible to set the value in the my.cnf file prior the loading of TokuDB or restart MariaDB after having modified the configuration or if you have loaded the plugin but not used TokuDB yet, you can unload the plugin then reload it ; it will reload the plugin with the setting from the configuration file.

See also

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.