Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install the tokudb engine in Mysql

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Mysql how to install tokudb engine, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this to learn, I hope you can gain something.

Platform Support:

TokuDB is only available under 64-bit Linux.

Minimum memory requirements:

TokuDB requires at least 1GB of physical memory, although 2GB is recommended.

Install tokuDB

tokuDB memory allocation requires jemalloc support (usually you have it after installing percona mysql, if not, you need to install it additionally)

1 Install jemalloc

yum install jemalloc

Compilation and installation reference: blog.itpub.net/29096438/viewspace-2122906/

2: Install Tokudb

Binary package installation:

Download:

[root@host-192-168-1-56 plugin]# wget https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.24-72.2/binary/tarball/Percona-Server-5.6.24-rel72.2-TokuDB.Linux.x86_64.ssl101.tar.gz

Extract and copy tokudb.so to mysql plugin directory

[root@host-192-168-1-56 plugin]# cp ha_tokudb.so /home/data/mysql/lib/plugin/

Modify the kernel configuration, disable transparent_hub, if not closed, it may cause TokuDB memory leakage (recommended to write to/etc/rc.local, it can still take effect after restart):

echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag

echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled

echo never > /sys/kernel/mm/transparent_hugepage/enabled

echo never > /sys/kernel/mm/transparent_hugepage/defrag

install

mysql> INSTALL PLUGIN tokudb_file_map SONAME 'ha_tokudb.so';

Query OK, 0 rows affected (0.07 sec)

mysql> INSTALL PLUGIN tokudb_fractal_tree_info SONAME 'ha_tokudb.so';

Query OK, 0 rows affected (0.00 sec)

mysql> INSTALL PLUGIN tokudb_fractal_tree_block_map SONAME 'ha_tokudb.so';

Query OK, 0 rows affected (0.00 sec)

mysql> INSTALL PLUGIN tokudb_trx SONAME 'ha_tokudb.so';

Query OK, 0 rows affected (0.00 sec)

mysql> INSTALL PLUGIN tokudb_locks SONAME 'ha_tokudb.so';

Query OK, 0 rows affected (0.00 sec)

mysql> INSTALL PLUGIN tokudb_lock_waits SONAME 'ha_tokudb.so';

Query OK, 0 rows affected (0.00 sec)

mysql> INSTALL PLUGIN tokudb SONAME 'ha_tokudb.so';

Query OK, 0 rows affected (0.38 sec)

mysql> show engines;

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| Engine | Support | Comment | Transactions | XA | Savepoints |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |

| CSV | YES | CSV storage engine | NO | NO | NO |

| MyISAM | YES | MyISAM storage engine | NO | NO | NO |

| BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |

| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |

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

| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |

| ARCHIVE | YES | Archive storage engine | NO | NO | NO |

| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |

| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |

+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+

10 rows in set (0.04 sec)

4 Configuration file tokudb parameter settings

[mysqld_safe]

malloc-lib=/usr/local/mysql/lib/libjemalloc.so

plugin-dir =/usr/local/mysql/lib/mysql/plugin/

#tokudb

#Separate TokuDB datadir and logdir from MySQL datadir. From a beautiful point of view, you can also not separate them. Comment out this line and the following 2 lines

tokudb-data-dir = /data/mysql/zabbix_3306/tokudbData

tokudb-log-dir = /data/mysql/zabbix_3306/tokudbLog

#TokuDB row mode, it is recommended to use FAST is enough, if the disk space is very tight, it is recommended to use SMALL

#tokudb_row_format = tokudb_small

tokudb_row_format = tokudb_fast

tokudb_cache_size = 44G

#Most of the other configurations can actually be modified without modification, only a few key configurations are needed

tokudb_commit_sync = 0

tokudb_directio = 1

tokudb_read_block_size = 128K

tokudb_read_buf_size = 128K

If the above parameters are written under [mysqld], the tokudb engine in show engines does not exist and fails.

If the above parameters are written under [mysqld_safe], the tokudb engine still exists and the tokudb table can be created, but these parameter configurations are not effective...... to be solved

Note:

mysql version: mysql official community version 5.6.24 After the successful establishment of a new table to restart, build a standard to restart

Error Log: Encountered bug?

Version: '5.6.24-log' socket: '/home/data/mydata/3308/mysql.sock' port: 3308 Source distribution

08:44:47 UTC - mysqld got signal 11 ;

This could be because you hit a bug. It is also possible that this binary

or one of the libraries it was linked against is corrupt, improperly built,

or misconfigured. This error can also be caused by malfunctioning hardware.

We will try our best to scrape up some info that will hopefully help

diagnose the problem, but since we have already crashed,

something is definitely wrong and this may fail.

key_buffer_size=8388608

read_buffer_size=131072

max_used_connections=1

max_threads=8096

thread_count=1

connection_count=1

It is possible that mysqld could use up to

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 3220280 K bytes of memory

Hope that's ok; if not, decrease some variables in the equation.

Solution: Change to percona server

Community Edition 5.6.24

be resolved

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report