I am fairly new to TokuDB but so far I am impressed with the compression it provides to the data stored within. One of my clients has a ton of data that is constantly growing and thus TokuDB made a lot of sense for the solution that was created. While becoming more familiar with this technology and trying different cloud solutions I ran into a minor issue installing TokuDB on a Google Cloud VM instance but explain how to resolve easily below.
TokuDB Install On Google Cloud VM Instance: First MySQL Service Start Fails
If you receive the below error on the initial attempt to start MySQL after installation, then the issue is likely related to the kernel having transparent_hugepage enabled.
Error Starting TokuDB MySQL:
- [root@tokudb-mysql-server ~]# service mysql start
- Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/tokudb-mysql-server.pid).
- [root@tokudb-mysql-server ~]#
As you can see in the error above MySQL fails to start and notes that the .pid file was not created. This is a fairly generic error so more investigation should be completed. In the data directory you will find a .err file that is prefaced by the server name. In this example the server name is tokudb-mysql-server so the .err file is tokudb-mysql-server.err. The contents of that file are created after attempting to start MySQL and while you work through any issues you may have starting MySQL you should tail that file. Below are the contents of the .err file that lead me to updating the Google Cloud VM instance’s kernel transparent_hugepage setting.
TokuDB MySQL .err File Output:
- 150120 2:57:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
- 150120 2:57:54 [Note] Plugin 'FEDERATED' is disabled.
- 150120 2:57:54 InnoDB: The InnoDB memory heap is disabled
- 150120 2:57:54 InnoDB: Mutexes and rw_locks use GCC atomic builtins
- 150120 2:57:54 InnoDB: Compressed tables use zlib 1.2.3
- 150120 2:57:54 InnoDB: Using Linux native AIO
- 150120 2:57:54 InnoDB: Initializing buffer pool, size = 128.0M
- 150120 2:57:54 InnoDB: Completed initialization of buffer pool
- 150120 2:57:54 InnoDB: highest supported file format is Barracuda.
- 150120 2:57:54 InnoDB: Waiting for the background threads to start
- 150120 2:57:55 InnoDB: 5.5.30-tokudb-7.1.0 started; log sequence number 1595675
- Transparent huge pages are enabled, according to /sys/kernel/mm/redhat_transparent_hugepage/enabled
- Transparent huge pages are enabled, according to /sys/kernel/mm/transparent_hugepage/enabled
- ************************************************************
- @@@@@@@@@@@
- @@' '@@
- @@ _ _ @@
- | (.) (.) |
- | ` |
- | > ' |
- | .----. |
- .. |.----.| ..
- .. ' ' ..
- .._______,.
- TokuDB will not run with transparent huge pages enabled.
- Please disable them to continue.
- (echo never > /sys/kernel/mm/transparent_hugepage/enabled)
- ************************************************************
- 150120 2:57:55 [ERROR] Plugin 'TokuDB' init function returned error.
- 150120 2:57:55 [ERROR] Plugin 'TokuDB' registration as a STORAGE ENGINE failed.
- 150120 2:57:55 [ERROR] Unknown/unsupported storage engine: TokuDB
- 150120 2:57:55 [ERROR] Aborting
- 150120 2:57:55 InnoDB: Starting shutdown...
- 150120 2:57:56 InnoDB: Shutdown completed; log sequence number 1595675
- 150120 2:57:56 [Note] /usr/local/tokutek/mysql/bin/mysqld: Shutdown complete
- 150120 02:57:56 mysqld_safe mysqld from pid file /var/lib/mysql/tokudb-mysql-server.pid ended
The error log output points you directly to how to permanently resolve the issue by issuing a single command to disable transparent_hugepage in the kernel. Before issuing the second command below I recommend first verifying the current transparent_hugepage setting which is “always” on a Google Cloud VM instance.
Verify Google Cloud VM Instance Kernel transparent_hugepage Setting:
- [root@tokudb-mysql-server ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
- [always] madvise never
- [root@tokudb-mysql-server ~]#
As you can see the current setting is “always” but this can easily be modified by issuing the below command.
TokuDB Google Cloud VM Instance Install: Disable transparent_hugepage Kernel Setting
- [root@tokudb-mysql-server ~]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
- [root@tokudb-mysql-server ~]#
You should now be able to start MySQL.