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 configure TokuDB for MySQL

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article introduces the knowledge of "how to configure TokuDB in MySQL". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The storage engine in MySQL is plug-in, of course, the mainstream default is InnoDB, and the InnoDB storage engine will become more and more popular with the official investment of MySQL. With MGR and InnoDB Cluster, it actually sounds very colorful. In essence, InnoDB Cluster is a MySQL Shell,MySQL Router,MGR.

There has always been relatively little space left for other databases. For example, MyISAM will retire from history in MySQL version 8.0, memory storage engine will be gradually replaced, and some storage engines will also be revolutionized in the process of their own development, such as falcon, gossip derived from falcon storage engine in MySQL (R5 Note 23), and some storage engine usage scenarios are really limited. Be in an awkward state, such as blackhole,csv,archive and so on.

TokuDB this storage engine is quite interesting, after it was acquired by Percona, it exists by default in the installation directory of Percona Server, so some students said that there is any difference between MySQL Community Edition and Percona. Here, TukuDB is one.

In addition, there are many options, such as MyRocks, which is also vigorously promoted by Percona itself, and the update of TokuDB will naturally be delayed.

I chose to test TokuDB because I already have a business in use, and I naturally wanted to see how it performed in version 5.7. TokuDB is especially suitable for intensive insertion scenarios with high compression ratio. It is still very popular in some applications, such as zabbix data storage, or pure pipelined historical data recording.

1) to configure TokuDB, if you already have Percona software, you don't need to do extra work, otherwise from the plug-in installation point of view, you can also copy so files to install in other versions.

2) Let's create several specified directories for TokuDB, such as

Create a directory toku_data toku_log tmp to store data, logs and temporary files, respectively

3) Grant specified permissions, such as mysql group.

Mkdir-p toku_data toku_log tmp

Chown-R mysql.mysql toku_data toku_log tmp

4) modify the parameter file my.cnf

Add a few additional parameters:

Tokudb_cache_size = 700m

Tokudb_commit_sync = 1

Tokudb_support_xa = 1

Tokudb_data_dir = / data/mycat_test/s1/toku_data

Tokudb_directio = 0

Tokudb_log_dir = / data/mycat_test/s1/toku_log

Tokudb_pk_insert_mode = 2

Tokudb_row_format = tokudb_zlib

Tokudb_tmp_dir = / data/mycat_test/s1/tmp

Tokudb_hide_default_row_format = 0

Tokudb_lock_timeout_debug = 3

[mysqld_safe]

Thp-setting=never

5) configure the password of the database, in the configuration of tokuDB, you still need to set the password of the specified user, otherwise it is easy to fail later.

Update mysql.user set authentication_string=password ('xxxx') where user='root'

Flush privileges

6) use the command ps_tokudb_admin to activate TokuDB, specify the socket path, port, and so on.

/ ps_tokudb_admin-- enable-- user=root-- password-S / data/mycat_test/s1/s1.sock-- port=33001-- defaults-file=/data/mycat_test/s1/s1.cnf

This step completes all the checks, and if normal, the basic log looks like the following

For example, there is no need to specify jemalloc separately in 5.7. the Transparent huge page is closed and the configuration of thp_setting is the key content. This script will also be automatically fixed at this step.

Checking SELinux status...

INFO: SELinux is disabled.

Checking if Percona Server is running with jemalloc enabled...

INFO: Percona Server is running with jemalloc enabled.

Checking transparent huge pages status on the system...

INFO: Transparent huge pages are currently disabled on the system.

Checking if thp-setting=never option is already set in config file...

INFO: Option thp-setting=never is set in the config file.

Checking TokuDB engine plugin status...

INFO: TokuDB engine plugin is not installed.

Installing TokuDB engine...

INFO: Successfully installed TokuDB engine plugin.

If it doesn't go well, it's likely to be the following log:

ERROR: Failed to install TokuDB engine plugin. Please check error log.

You need to take a closer look at the error log file to see which link may have gone wrong.

After the installation is complete, you can see that there is nothing wrong with the storage engine by looking at show engines.

Or use the following SQL to see the version information of TokuDB.

SELECT @ @ tokudb_version

The whole process will actually install a lot of TokuDB plug-ins, these are the points we need to pay attention to.

| | Name | Status | Type | Library | License | |

+-+

| | TokuDB | ACTIVE | STORAGE ENGINE | 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 | |

| | 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_background_job_status | ACTIVE | INFORMATION SCHEMA | ha_tokudb.so | GPL | |

+-+

The next step is to use, we can use TokuDB to do some basic testing, at least for now, in terms of compression ratio, performance is good.

This is the end of the content of "how to configure TokuDB for MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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