If you want to use TokuDB with MariaDB, MySQL, or Percona Server, you will need to disable support for transparent hugepages in Linux.
Fortunately, this is very easy to check, and to change.
An easy way to check is with:
This will return something like:
[always] madvise never
Note the word surrounded by “” is what this option is set to. So the above is set to “always”. To disable it, we want it set to “never”.
I’ve found the easiest way to change/set this is to add the below to your /etc/rc.local file (and then reboot your system):
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi
There is another method listed here if you use grub to boot your kernel.
If you try to enable TokuDB without first changing this, then from the command line, you would see the following error:
MariaDB [(none)]> install soname 'ha_tokudb'; ERROR 1123 (HY000): Can't initialize function 'TokuDB'; Plugin initialization function failed.
Or, in the error log, you would see this *slightly* more clear message:
TokuDB: Transparent huge pages are enabled, according to /sys/kernel/mm/transparent_hugepage/enabled. TokuDB will be disabled. To use TokuDB disable huge pages in your kernel or, for testing, set the environment variable TOKU_HUGE_PAGES_OK to 1 140714 17:25:57 [ERROR] TokuDB: Huge pages are enabled, disable them before continuing 140714 17:25:57 [ERROR] Plugin 'TokuDB' init function returned error. 140714 17:25:57 [ERROR] Plugin 'TokuDB' registration as a STORAGE ENGINE failed.
Or, if you’re interested in why TokuDB requires hugepages to be disabled, PeterZ wrote a nice post about that here.
Hope this helps.
Tags: Can't initialize function 'TokuDB'; Plugin initialization function failed., disable them before continuing, disable transparent hugepages, enable transparent hugepages, enabling tokudb, ERROR 1123, ERROR 1123 (HY000), ERROR 1123 (HY000): Can't initialize function 'TokuDB'; Plugin initialization function failed, fractal tree, ha_tokudb, ha_tokudb.so, how to enable tokudb in mariadb, how to enable tokudb in mysql, Huge pages are enabled, Plugin 'TokuDB' init function returned error, Plugin 'TokuDB' registration as a STORAGE ENGINE failed, plugin-load, SONAME, toku, TokuDB, tokudb in mariadb, Transparent huge pages are enabled, transparent hugepages