文章插图
背景zabbix 数据库由阿里云 RDS 迁移至自建 DB,迁移过程中发现 RDS 存储引擎为 tokudb ,手把手撸一遍
前置要求 Prerequisites
- 安装 libjemalloc library
yum install jemalloc -y
通过 yum 安装,生成的库文件为 /usr/lib64/libjemalloc.so.1[root@yunwei /www/server/data]# rpm -qa |grep jemallocjemalloc-3.6.0-1.el7.x86_64[root@yunwei /www/server/data]# rpm -ql jemalloc-3.6.0-1.el7.x86_64/usr/bin/jemalloc.sh/usr/lib64/libjemalloc.so.1/usr/share/doc/jemalloc-3.6.0/usr/share/doc/jemalloc-3.6.0/COPYING/usr/share/doc/jemalloc-3.6.0/README/usr/share/doc/jemalloc-3.6.0/VERSION/usr/share/doc/jemalloc-3.6.0/jemalloc.html
- Transparent huge pages 关闭内存大页
echo never > /sys/kernel/mm/transparent_hugepage/enabledecho never > /sys/kernel/mm/transparent_hugepage/defrag
检查结果root@ptest:~# cat /sys/kernel/mm/transparent_hugepage/enabledalways madvise [never]root@ptest:~# cat /sys/kernel/mm/transparent_hugepage/defragalways madvise [never]
安装仓库源Installing Percona Server for MySQL from Percona yum repository- Install the Percona repository
$ yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpmRetrieving https://repo.percona.com/yum/percona-release-latest.noarch.rpmPreparing... ########################################### [100%]1:percona-release ########################################### [100%]
- To install Percona Server for MySQL with SElinux policies
$ yum install http://repo.percona.com/centos/7/RPMS/x86_64/Percona-Server-selinux-56-5.6.42-rel84.2.el7.noarch.rpm
- 测试仓库可用性
yum list | grep percona...Percona-Server-56-debuginfo.x86_645.6.25-rel73.1.el6@percona-release-x86_64Percona-Server-client-56.x86_645.6.25-rel73.1.el6@percona-release-x86_64Percona-Server-devel-56.x86_645.6.25-rel73.1.el6@percona-release-x86_64Percona-Server-server-56.x86_645.6.25-rel73.1.el6@percona-release-x86_64Percona-Server-shared-56.x86_645.6.25-rel73.1.el6@percona-release-x86_64Percona-Server-test-56.x86_645.6.25-rel73.1.el6@percona-release-x86_64Percona-Server-shared-compat.x86_645.1.68-rel14.6.551.rhel6percona-release-x86_64...
- 安装 Percona Serve
yum install Percona-Server-server-56
安装 TokuDBYou can install the Percona Server for MySQL with TokuDB engine by using the apt/yum commands:[root@centos ~]# yum install Percona-Server-tokudb-56.x86_64# debian 系列 OSroot@wheezy:~# apt-get install percona-server-tokudb-5.6
启用 TokuDB 引擎Enabling the TokuDB Storage EngineOnce the TokuDB server package has been installed following output will be shown:This release of Percona Server is distributed with TokuDB storage engine. Run the following script to enable the TokuDB storage engine in Percona Server:
ps_tokudb_admin --enable -u <mysql_admin_user> -p[mysql_admin_pass] [-S <socket>] [-h <host> -P <port>]
See http://www.percona.com/doc/percona-server/5.6/tokudb/tokudb_installation.html for more installation detailsPercona Server for MySQL 5.6.22-72.0 has implemented ps_tokudb_admin script to make the enabling the TokuDB storage engine easier. This script will automatically disable Transparent huge pages, if they’re enabled, and install and enable the TokuDB storage engine with all the required plugins. You need to run this script as root or with sudo. After you run the script with required parameters:
See http://www.percona.com/doc/percona-server/5.6/tokudb/tokudb_intro.html for an introduction to TokuDB
ps_tokudb_admin --enable -uroot -pPassw0rd
Following output will be displayed:Checking if Percona server is running with jemalloc enabled...>> Percona server is running with jemalloc enabled.Checking transparent huge pages status on the system...>> Transparent huge pages are currently disabled on the system.Checking if thp-setting=never option is already set in config file...>> Option thp-setting=never is not set in the config file.>> (needed only if THP is not disabled permanently on the system)Checking TokuDB plugin status...>> TokuDB plugin is not installed.Adding thp-setting=never option into /etc/mysql/my.cnf>> Successfuly added thp-setting=never option into /etc/mysql/my.cnfInstalling TokuDB engine...>> Successfuly installed TokuDB plugin.
推荐阅读
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 讲讲用了云桌面的真实体会
- 云原生时代的流量入口:Envoy Gateway
- 过眼烟云老上海的茶馆,清代茶馆兴盛茶馆经营内容和功能特色的不同
- 缙云毛凤茶简介,利川毛坝乡自制石流合剂助茶园冬管
- 黄花云尖的储存方法,储存白毛猴茶的常见方法
- 使用阿里云 自己搭建网站
- 云南大蟒蛇事件 云南挖出大蛇是真的吗
- 鉴别云林茶的方法,铁观音的保管方法
- 教你分清滇红,云南西双版纳滇红
- 赵云传龙胆枪出土了吗? 赵云墓出土的龙胆枪赵云墓出土后尸骨