Foreword: Tokudb is a high-performance, transactional-enabled MySQL and MariaDB storage engine. The main features of the tokudb are high compression ratios, high INSERT performance, support for most online modification of indexes, addition of fields, ideal for log-based scenarios (only insert,select, less update), and here's a look at the installation steps
1. Edit the configuration file
[Mysqld_safe]
malloc-lib=/opt/app/mysql/lib/mysql/libjemalloc.so
Plugin-dir =/opt/app/mysql/lib/mysql/plugin/
Plugin-load=ha_tokudb.so
[Mysqld]
#tokudb
#把TokuDB DataDir and LogDir and MySQL datadir separate, can also not separate,
Tokudb-data-dir =/data/mysql/tokudbdata
Tokudb-log-dir =/data/mysql/tokudblog
#TokuDB的行模式, it is recommended to use FAST, if disk space is very tight, it is recommended to use SMALL
#tokudb_row_format = Tokudb_small
Tokudb_row_format = Tokudb_fast
Tokudb_cache_size = XxG # # #建议内存的一半
Tokudb_commit_sync = 0
Tokudb_directio = 1
Tokudb_read_block_size = 128K
Tokudb_read_buf_size = 128K
2. Unzip the package
Tar xvf percona-server-5.6.24-rel72.2-tokudb.linux.x86_64.ssl098e.tar.gz
CD percona-server-5.6.24-rel72.2-linux.x86_64.ssl098e
CP-RPF */opt/app/mysql/
3. Before starting, deactivate transparent huge pages if not turned off may cause tokudb memory leaks (recommended write to/etc/rc.local, restart still in effect):
echo Never >/sys/kernel/mm/transparent_hugepage/enabled
echo Never >/sys/kernel/mm/transparent_hugepage/defrag
echo Never >/sys/kernel/mm/redhat_transparent_hugepage/enabled
echo Never >/sys/kernel/mm/redhat_transparent_hugepage/defrag
4. Start MySQL
/etc/init.d/mysql restart
5. Installing plugins
INSTALL PLUGIN tokudb SONAME ' ha_tokudb.so ';
INSTALL PLUGIN tokudb_file_map SONAME ' ha_tokudb.so ';
INSTALL PLUGIN tokudb_fractal_tree_info SONAME ' ha_tokudb.so ';
INSTALL PLUGIN tokudb_fractal_tree_block_map SONAME ' ha_tokudb.so ';
INSTALL PLUGIN tokudb_trx SONAME ' ha_tokudb.so ';
INSTALL PLUGIN tokudb_locks SONAME ' ha_tokudb.so ';
INSTALL PLUGIN tokudb_lock_waits SONAME ' ha_tokudb.so ';
6. View the installation results
(TWDB) [Email protected] [(None)]> 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 |
| Sha256_password | ACTIVE | Authentication | NULL | GPL |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | GPL |
| MyISAM | ACTIVE | STORAGE ENGINE | NULL | GPL |
| Mrg_myisam | ACTIVE | STORAGE ENGINE | NULL | GPL |
| CSV | ACTIVE | STORAGE ENGINE | NULL | GPL |
| Performance_schema | ACTIVE | STORAGE ENGINE | NULL | GPL |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | GPL |
| Xtradb_read_view | ACTIVE | Information SCHEMA | NULL | GPL |
| Xtradb_internal_hash_tables | ACTIVE | Information SCHEMA | NULL | GPL |
| xtradb_rseg | ACTIVE | Information SCHEMA | 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_cmp_per_index | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_cmp_per_index_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 |
| Innodb_metrics | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_ft_default_stopword | ACTIVE | Information SCHEMA | NULL | GPL |
| innodb_ft_deleted | ACTIVE | Information SCHEMA | NULL | GPL |
| innodb_ft_being_deleted | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_ft_config | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_ft_index_cache | ACTIVE | Information SCHEMA | NULL | GPL |
| innodb_ft_index_table | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_sys_tables | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_sys_tablestats | ACTIVE | Information SCHEMA | NULL | GPL |
| innodb_sys_indexes | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_sys_columns | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_sys_fields | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_sys_foreign | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_sys_foreign_cols | ACTIVE | Information SCHEMA | NULL | GPL |
| innodb_sys_tablespaces | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_sys_datafiles | ACTIVE | Information SCHEMA | NULL | GPL |
| Innodb_changed_pages | ACTIVE | Information SCHEMA | NULL | GPL |
| Blackhole | ACTIVE | STORAGE ENGINE | NULL | GPL |
| Federated | DISABLED | STORAGE ENGINE | NULL | GPL |
| ARCHIVE | ACTIVE | STORAGE ENGINE | NULL | GPL |
| Partition | ACTIVE | STORAGE ENGINE | NULL | 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 |
| 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 | ACTIVE | STORAGE ENGINE | ha_tokudb.so | GPL |
+-------------------------------+----------+--------------------+--------------+---------+
All rows in Set (0.00 sec)
Questions
###############################
(TWDB) [Email protected] [sysbench]> INSTALL PLUGIN tokudb SONAME ' ha_tokudb.so ';
ERROR 1123 (HY000): Can ' t initialize function ' TOKUDB '; Plugin initialization function failed.
(TWDB) [Email protected] [sysbench]> INSTALL PLUGIN ha_tokudb SONAME ' ha_tokudb.so ';
ERROR 1127 (HY000): Can ' t find Symbol ' HA_TOKUDB ' in library
(TWDB) [Email protected] [sysbench]> INSTALL PLUGIN tokudb SONAME ' ha_tokudb.so ';
ERROR 1123 (HY000): Can ' t initialize function ' TOKUDB '; Plugin initialization function failed.
(TWDB) [Email protected] [sysbench]>
This is because lazy, only copy the Percona-server-5.6.24-rel72.2-linux.x86_64.ssl098e/bin Lib directory to the MySQL directory, the solution is to copy all the files in the past, restart the MySQL instance, Install it again.
Installing the TOKUDB engine