tokudb引擎配置
1)要配置TokuDB,如果已经有了Percona的软件则不需要做额外的工作了,否则从插件式的安装角度来说,你也可以拷贝so的文件在其他版本中安装。
2)我们给TokuDB创建几个指定的目录,比如
创建目录 toku_data toku_log tmp 分别存储数据,日志和临时文件
[root@mgr-wjh-test-4 mysql]# mkdir toku
[root@mgr-wjh-test-4 mysql]# cd toku/
[root@mgr-wjh-test-4 toku]# mkdir toku_data toku_log tmp
3)赋予指定的权限,比如mysql组。
mkdir -p toku_data toku_log tmp
chown -R mysql.mysql toku_data toku_log tmp
[root@mgr-wjh-test-4 toku]# chown -R mysql:mysql ../toku/
4)修改参数文件my.cnf
添加额外的几个参数:
tokudb_cache_size = 700M
tokudb_commit_sync = 1
tokudb_support_xa = 1
tokudb_data_dir = /data_2/mysql/toku/toku_data
tokudb_directio = 0
tokudb_log_dir = /data_2/mysql/toku/toku_log
tokudb_pk_insert_mode = 2
tokudb_row_format = tokudb_zlib
tokudb_tmp_dir = /data_2/mysql/toku/tmp
tokudb_hide_default_row_format = 0
tokudb_lock_timeout_debug = 3
[mysqld_safe]
thp-setting=never
5)配置数据库的密码,在tokuDB的配置中,还是需要设置下指定用户的密码,要不后期很容易失败。 --跳过
update mysql.user set authentication_string=password('xxxx') where user='root';
flush privileges;
6)使用命令ps_tokudb_admin来激活TokuDB,指定socket路径,端口等等。
./ps_tokudb_admin --enable --user=root --password -S /data/mycat_test/s1/s1.sock --port=33001 --defaults-file=/data/mycat_test/s1/s1.cnf
/data_2/mysql/install/bin/ps_tokudb_admin --enable --user=root --password -S /data_2/mysql/tmp/mysql.sock --port=3306 --defaults-file=/data_2/mysql/conf/my.cnf
这个步骤会完成所有的检查,如果正常的话,基本日志就是下面的样子,
[root@mgr-wjh-test-4 toku]# /data_2/mysql/install/bin/ps_tokudb_admin --enable --user=root --password -S /data_2/mysql/tmp/mysql.sock --port=3306 --defaults-file=/data_2/mysql/conf/my.cnf
Enter password:
WARNING: This script is deprecated and will be removed in 8.0. You can use ps-admin script which has more functionality.
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.
[root@mgr-wjh-test-4 toku]# tokudb引擎安装成功。
检查tokudb插件加载情况
mysql> select plugin_name,plugin_status from information_schema.plugins where plugin_name like '%toku%';
+-------------------------------+---------------+
| plugin_name | plugin_status |
+-------------------------------+---------------+
| TokuDB | ACTIVE |
| TokuDB_file_map | ACTIVE |
| TokuDB_fractal_tree_info | ACTIVE |
| TokuDB_fractal_tree_block_map | ACTIVE |
| TokuDB_trx | ACTIVE |
| TokuDB_locks | ACTIVE |
| TokuDB_lock_waits | ACTIVE |
| TokuDB_background_job_status | ACTIVE |
+-------------------------------+---------------+
8 rows in set (0.00 sec)
mysql> SELECT @@tokudb_version;
+------------------+
| @@tokudb_version |
+------------------+
| 5.7.39-42 |
+------------------+
1 row in set (0.00 sec)
mysql>
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




