Fascinated by fractal trees? Astonished by TokuDB storage engine? Watching new trends where MySQL/MariaDB serves as baseline and competitive advantages are based on storage engines? Welcome! 🙂
0) Use (or prepare virtual machine) with Linux OS, 64-bit. There are no other architectures available at this moment + not planned anyway, as far as I know. Anyway it’s pretty common environment. I love Oracle Linux for its performance and very nice database-usage-tuned-operating-system.
1) Download .tar.gz from http://www.tokutek.com/tokudb-for-mysql/ website. It is well known non-binary installation package of mysql with all tokudb features inside. For next few http://it.tuxie.eu/wp-admin/post.php?post=702&action=edit&message=10steps I’m using official install guide with my notices and adjustements, indeed 🙂
2) Create mysql user within mysql group:
1 2 |
[root@ol66 j]# groupadd -g 927 mysql [root@ol66 j]# useradd -r -u 927 -g mysql mysql |
3) Make home directory for TokuDB and extract downloaded .tar.gz inside it:
1 2 3 4 5 6 7 8 |
[root@ol66 j]# mkdir -pv /opt/tokutek mkdir: created directory /opt/tokutek' [root@ol66 j]# cd /opt/tokutek [root@ol66 tokutek]# tar xzf /home/j/Downloads/mysql-5.5.40-tokudb-7.5.3-linux-x86_64.tar.gz [root@ol66 tokutek]# ll total 4 drwxr-xr-x. 13 root root 4096 Dec 29 01:39 mysql-5.5.40-tokudb-7.5.3-linux-x86_64 [root@ol66 tokutek]# |
4) Create symbolic link for better handling with server + change permissions (recursively):
1 2 3 4 5 |
[root@ol66 tokutek]# ln -sv mysql-5.5.40-tokudb-7.5.3-linux-x86_64 mysql mysql 'mysql-5.5.40-tokudb-7.5.3-linux-x86_64' [root@ol66 tokutek]# [root@ol66 tokutek]# cd mysql [root@ol66 mysql]# chown -Rv mysql:mysql * |
5) Create/adjust my.cnf, the heart of every mysql server. You can find something like a templates in support-files directory.
1 2 3 4 |
[root@ol66 mysql]# cp -v support-files/my-small.cnf /etc/my.cnf cp: overwrite /etc/my.cnf’? yes support-files/my-small.cnf' -> /etc/my.cnf’ [root@ol66 mysql]# vi /etc/my.cnf |
and now you will define 2 important directories – where server resides + where data are stored = add/adjust these lines inside /etc/my.cnf :
1 2 3 |
datadir = /var/lib/mysql basedir = /opt/tokutek/mysql user = mysql |
6) Double-check both directories owners! All should be set to mysql:mysql. Indeed, if you love adrenaline, mysterious errors and failed start server…. ignore it 🙂
e.g. for datadir:
1 |
[root@ol66 mysql]# chown -Rv mysql:mysql * |
7) Setup system tables as mysql user:
1 2 3 4 |
[root@ol66 mysql]# scripts/mysql_install_db –user=mysql … [root@ol66 mysql]# |
7) “Create” service and start mysql server
1 2 3 4 5 |
[root@ol66 support-files]# ln -sv /opt/tokutek/mysql/support-files/mysql.server /etc/init.d/mysql /etc/init.d/mysql' -> /opt/tokutek/mysql/support-files/mysql.server’ [root@ol66 mysql]# service mysql start Starting MySQL.. [ OK ] [root@ol66 mysql]# |
8) Checking if mysql is really running and… what is this all about… tokudb is present! 🙂
1 2 3 4 5 |
[root@ol66 mysql]# ps -ef | grep mysql root 10355 1 0 01:58 pts/0 00:00:00 /bin/sh /opt/tokutek/mysql/bin/mysqld_safe –datadir=/var/lib/mysql –pid-file=/var/lib/mysql/ol66.pid mysql 10632 10355 0 01:58 pts/0 00:00:04 /opt/tokutek/mysql/bin/mysqld –basedir=/opt/tokutek/mysql –datadir=/var/lib/mysql –plugin-dir=/opt/tokutek/mysql/lib/plugin –user=mysql –log-error=/var/lib/mysql/ol66.err –pid-file=/var/lib/mysql/ol66.pid –socket=/tmp/mysql.sock –port=3306 root 11099 6355 0 02:27 pts/0 00:00:00 grep mysql [root@ol66 mysql]# |
And we can directly check in mysql if plugins are ready. Important notice – I didn’t run mysql_secure_installation utility = there’s no password for mysql root user, beware 🙂
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
[root@ol66 mysql]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.40-tokudb-7.5.3 MySQL Community Server (GPL) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. mysql> show plugins; +——————————-+———-+——————–+————–+———+ | Name | Status | Type | Library | License | +——————————-+———-+——————–+————–+———+ | binlog | ACTIVE | STORAGE ENGINE | NULL | GPL | | mysql_native_password | ACTIVE | AUTHENTICATION | NULL | GPL | | mysql_old_password | ACTIVE | AUTHENTICATION | NULL | GPL | | CSV | ACTIVE | STORAGE ENGINE | NULL | GPL | | MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL | | MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL | | MRG_MYISAM | ACTIVE | STORAGE ENGINE | NULL | GPL | | ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL | | BLACKHOLE | ACTIVE | STORAGE ENGINE | NULL | GPL | | FEDERATED | DISABLED | STORAGE ENGINE | NULL | GPL | | InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL | | INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_LOCKS | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_LOCK_WAITS | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_CMP | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_CMP_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_CMPMEM | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_CMPMEM_RESET | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_BUFFER_PAGE | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_BUFFER_PAGE_LRU | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | INNODB_BUFFER_POOL_STATS | ACTIVE | INFORMATION SCHEMA | NULL | GPL | | PERFORMANCE_SCHEMA | ACTIVE | STORAGE ENGINE | NULL | GPL | | partition | ACTIVE | STORAGE ENGINE | NULL | GPL | | TokuDB | ACTIVE | STORAGE ENGINE | ha_tokudb.so | GPL | | TokuDB_trx | ACTIVE | INFORMATION SCHEMA | ha_tokudb.so | GPL | | TokuDB_locks | ACTIVE | INFORMATION SCHEMA | ha_tokudb.so | GPL | | TokuDB_lock_waits | ACTIVE | INFORMATION SCHEMA | ha_tokudb.so | GPL | | TokuDB_file_map | ACTIVE | INFORMATION SCHEMA | ha_tokudb.so | GPL | | TokuDB_fractal_tree_info | ACTIVE | INFORMATION SCHEMA | ha_tokudb.so | GPL | | TokuDB_fractal_tree_block_map | ACTIVE | INFORMATION SCHEMA | ha_tokudb.so | GPL | +——————————-+———-+——————–+————–+———+ 30 rows in set (0.00 sec) mysql> |
All done! 🙂
-a-