TokuDB installation (Debian 7.2 x64)

„Pure“ MySQL is dead. Thanks to Oracle approach, thanks to very few inventions in last years (=versions). Among MariaDB there are few other players trying to attract customer. TokuDB is from my opinion the best choice for mature storage engine.

First surprise – TokuDB is supporting only 64-bit linux at this moment. Nah, no problem 🙂

j@debian:~/install$ ls -la
total 287184
drwxr-xr-x  2 j j      4096 Feb  4 15:53 .
drwxr-xr-x 28 j j      4096 Feb  4 10:17 ..
-rwxrwx—  1 j j 294061828 Feb  4 15:23 mariadb-5.5.30-tokudb-7.1.0-linux-x86_64.tar.gz
j@debian:~/install$

Well, this package is typical .tar „portable“ solution. No installer, no binary files. I will follow 2 things from now – all actions will be done as root + i´m following QuickGuide.pdf (also downloadable from TokuDB site).

Preparation phase

Creating new group dedicated to mysql, creating mysql user, creating home directory for TokuDB, extracting files from tar.gz into this directory:

root@debian:~# groupadd -g 927 mysql
root@debian:~# useradd -r -u 927 -g mysql mysql
root@debian:~# mkdir -pv /opt/tokutek
mkdir: created directory /opt/tokutek'
root@debian:~# cd /opt/tokutek
root@debian:/opt/tokutek# tar -xzf /home/j/install/mariadb-5.5.30-tokudb-7.1.0-linux-x86_64.tar.gz

Linking directory to mysql, changing ownership of all files within this directory:

root@debian:/opt/tokutek# ls
mariadb-5.5.30-tokudb-7.1.0-linux-x86_64
root@debian:/opt/tokutek# ln -sv mariadb-5.5.30-tokudb-7.1.0-linux-x86_64 mysql
mysql‘ -> mariadb-5.5.30-tokudb-7.1.0-linux-x86_64'
root@debian:/opt/tokutek# cd mysql
root@debian:/opt/tokutek/mysql# chown -R mysql:mysql .

Copying my.cnf into /etc directory + changes in this file:

root@debian:/opt/tokutek/mysql# cp -v support-files/my-small.cnf /etc/my.cnf
support-files/my-small.cnf‘ -> /etc/my.cnf'
root@debian:/opt/tokutek/mysql# nano /etc/my.cnf

Main configuration file is very messed up with comments in default. In production system my.cnf should not consist of any comments or not so long :-) Followed by guide, i just inputed these new variables into [mysqld] section:

datadir = /var/lib/mysql

basedir = /opt/tokutek/mysql

user = mysql

Filling system tables in mysql:

root@debian:/opt/tokutek/mysql# scripts/mysql_install_db --user=mysql
Installing MariaDB/MySQL system tables in '/var/lib/mysql' ...
OK
Filling help tables...
OK
...

Linking and running mysql service finaly :-)

root@debian:/opt/tokutek/mysql/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@debian:/opt/tokutek/mysql/support-files# service mysql start
Starting MySQL
[ o.

Checking that TokuDB is really running:

j@debian:~$ ps -ef | grep mysql
root      3527     1  0 09:15 pts/0    00:00:00 /bin/sh /opt/tokutek/mysql/bin/mysqld_safe –datadir=/var/lib/mysql –pid-file=/var/lib/mysql/debian.pid
mysql     3820  3527  0 09:15 pts/0    00:00:03 /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/debian.err –pid-file=/var/lib/mysql/debian.pid –socket=/tmp/mysql.sock –port=3306
j         4056  3458  0 10:14 pts/0    00:00:00 grep mysql

Verification phase

j@debian:~$ /opt/tokutek/mysql/bin/mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.30-tokudb-7.1.0-MariaDB MariaDB Server

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type ‚help;‘ or ‚\h‘ for help. Type ‚\c‘ to clear the current input statement.

MariaDB [(none)]> show plugins;

| 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     |

49 rows in set (0.03 sec)

MariaDB [(none)]> show engines;

| TokuDB             | DEFAULT | Tokutek TokuDB Storage Engine with Fractal Tree(tm) Technology             | YES          | YES  | YES        |

11 rows in set (0.00 sec)

MariaDB [(none)]>

As usual, storage type must be declared in a time of table creation:

create table lala (ID int(11) not null) engine=TokuDB;

-a-

This entry was posted in Databases, MySQL. Bookmark the permalink.

Napsat komentář