• 系统:Red Hat Enterprise Linux Server release 6.3 (Santiago)
  • 数据库:Percona-Server-5.6.29-rel76.2-Linux.x86_64.ssl101.tar.gz

1. 准备

libjemalloc library

安装 jemalloc,确保 jemalloc 的版本在3.3.0 或者更高。通过yum或者rpm包安装的MySQL5.6 需要额外安装 Percona-Server-tokudb-56-5.6.36-rel82.1.el6.x86_64.rpm 包,安装过程中会自动装上 jemalloc,但是通过 Percona-Server-5.6.29-rel76.2-Linux.x86_64.ssl101.tar.gz 安装的MySQL就方便的多。

$MYSQL_HOME/lib/mysql/ 下有 jemalloc

[mysql@dbmspressd201 ~]$ ll lib/mysql/
total 1856
lrwxrwxrwx 1 mysql mysql 16 Aug 11 17:07 libjemalloc.so -> libjemalloc.so.1
-rwxr-xr-x 1 mysql mysql 1893761 Aug 11 17:07 libjemalloc.so.1
drwxr-xr-x 3 mysql mysql 4096 Aug 11 17:07 plugin

直接修改 my.cnf 文件即可

[mysqld_safe]
malloc-lib=/home/mysql/lib/mysql/libjemalloc.so.1

配置完成后,需要重启数据库

$ /home/mysql/bin/mysqld_safe --defaults-file=/home/mysql/etc/my.cnf &
[1] 2587
$ 170813 17:06:00 mysqld_safe Adding '/home/mysql/lib/mysql/libjemalloc.so.1' to LD_PRELOAD for mysqld
170813 17:06:00 mysqld_safe Logging to '/mysql/data/mysql_error.err'.
170813 17:06:00 mysqld_safe Starting mysqld daemon with databases from /mysql/data/

Transparent huge pages

transparent huge pages 打开的时候,TokuDB是无法使用的

cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
always [never]

需要用 root 权限执行以下操作,来关闭 transparent huge page

[root@dbmspressd201 ~]# echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
[root@dbmspressd201 ~]# echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag

不关闭的话,报错日志如下

2017-08-13 17:06:04 3577 [ERROR] TokuDB: Huge pages are enabled, disable them before continuing

2017-08-13 17:06:04 3577 [ERROR] ************************************************************
2017-08-13 17:06:04 3577 [ERROR]
2017-08-13 17:06:04 3577 [ERROR] @@@@@@@@@@@
2017-08-13 17:06:04 3577 [ERROR] @@' '@@
2017-08-13 17:06:04 3577 [ERROR] @@ _ _ @@
2017-08-13 17:06:04 3577 [ERROR] | (.) (.) |
2017-08-13 17:06:04 3577 [ERROR] | ` |
2017-08-13 17:06:04 3577 [ERROR] | > ' |
2017-08-13 17:06:04 3577 [ERROR] | .----. |
2017-08-13 17:06:04 3577 [ERROR] .. |.----.| ..
2017-08-13 17:06:04 3577 [ERROR] .. ' ' ..
2017-08-13 17:06:04 3577 [ERROR] .._______,.
2017-08-13 17:06:04 3577 [ERROR]
2017-08-13 17:06:04 3577 [ERROR] TokuDB will not run with transparent huge pages enabled.
2017-08-13 17:06:04 3577 [ERROR] Please disable them to continue.
2017-08-13 17:06:04 3577 [ERROR] (echo never > /sys/kernel/mm/transparent_hugepage/enabled)
2017-08-13 17:06:04 3577 [ERROR]
2017-08-13 17:06:04 3577 [ERROR] ************************************************************
2017-08-13 17:06:04 3577 [ERROR] Plugin 'TokuDB' init function returned error.
2017-08-13 17:06:04 3577 [ERROR] Plugin 'TokuDB' registration as a STORAGE ENGINE failed.
2017-08-13 17:06:04 3577 [Note] Shutting down plugin 'TokuDB'

2. 安装

2.1 通过yum安装

yum install Percona-Server-tokudb-56.x86_64

2.2 直接启用TokuDB

使用 $MYSQL_HOME/bin 下的 ps_tokudb_admin 安装(5.6.22-72.0后引入)

./ps_tokudb_admin --enable -uroot -h127.1
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.

5.6.29的安装与官网的安装结果显示的稍有不同,以下贴出官网的结果

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.cnf Installing TokuDB engine...
>> Successfuly installed TokuDB plugin.

查看安装结果

mysql> show engines;
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
| MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | CSV 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 | Percona TokuDB Storage Engine with Fractal Tree(tm) Technology | YES | YES | YES |
| MyISAM | YES | MyISAM storage engine | NO | NO | NO |
| ARCHIVE | YES | Archive storage engine | NO | NO | NO |
| FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
| InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+

查看 TokuDB 的版本

mysql> SELECT @@tokudb_version;
+------------------+
| @@tokudb_version |
+------------------+
| 5.6.29-76.2 |
+------------------+
1 row in set (0.00 sec)

手动安装

Percona Server 5.6.22-71.0 的时候。。。可以手动安装。。。木有测试过。。。

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';
INSTALL PLUGIN tokudb_background_job_status SONAME 'ha_tokudb.so'

Percona Server 5.6 安装TokuDB的更多相关文章

  1. MySQL Percona server 5.5 安装审计插件

    近期,公司要求对MySQL 数据库上操作进行审计:通过了解MySQL 官方企业版(付费版)本中集成了audit_log审计插件,但是社区开源版本中并不包含该插件,也没提供下载.进一步了解 MariaD ...

  2. CentOS 7.5 安装与配置 Percona Server 5.7

    个人比较喜欢 MYSQL 的轻量,今天花了一点时间把阿里云上的 MYSQL5.7 换成了 Percona-Server .Percona 是一个开源的 MySQL 衍生版,TokuDB 的数据库引擎使 ...

  3. Linux 下 YUM 安装 Percona Server 5.6

    Percona Server 是 MySQL 的衍生版,专注于 Linux/BSD 下 MySQL 数据库服务器的改进, 在功能和性能上较 MySQL 有着显著的提升. Percona Server ...

  4. percona server 二进制安装下编译tpcc-mysql的坑

    出于习惯,percona server的部署都是通过二进制包自动化安装,结果遇到一个硕大无比的坑,编译TPCC-MySQL时出现警告 10:49:36 root@DB-Master:~/tpcc-my ...

  5. CentOS 7.2 安装配置 Percona Server

    个人比较喜欢 MYSQL 的轻量,今天花了一点时间把阿里云上的 MYSQL5.7 换成了 Percona-Server ,Percona 是一个开源的 MySQL 衍生版.InnoDB的数据库引擎使得 ...

  6. mysql 5.7/percona server/mariadb 10.2安装与服务器参数优化

    建议使用percona server linux generic版,从https://www.percona.com/downloads/Percona-Server-LATEST/下载,现在不在推荐 ...

  7. ubuntu安装Percona Server

    Percona Server是mysql数据库的一个衍生版本,在性能,稳定性和可管理性上都有很大的提升,目前淘宝的mysql数据库就是基于Percona Server,请原谅我这么喜欢研究淘宝的技术. ...

  8. 如何在 CentOS 7 上安装 Percona Server

    在这篇文章中我们将了解关于 Percona 服务器,一个开源的MySQL,MariaDB的替代品.InnoDB的数据库引擎使得Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比 ...

  9. MySQL社区版升级到Percona Server

    出于磁盘空间的考虑,在调研以后把磁盘空间紧张的库的引擎改为tokudb,(在改为tokudb引擎之前是innodb引擎,已经压缩过,但空间还是紧张)关于tokudb的优势各位自行查阅相关资料.要启用t ...

随机推荐

  1. HTTP请求响应报文 - 相关状态码 - GET_POST请求方法

    HTTP请求报文: 一个HTTP请求报文由四个部分组成:请求行.请求头部.空行.请求数据 1.请求行 请求行由请求方法字段.URL字段和HTTP协议版本字段3个字段组成,它们用空格分隔.比如 GET ...

  2. Win10 JDK 配置

    分两行建,点击新建, %JAVA_HOME%\bin %JAVA_HOME%\jre\bin

  3. ntpdate 正确的做法

    网上很多搜到的资料都是过时的,主要是时间服务器不能用,不管是国内的还是国外的 1. yum -y install ntp ntpdate 2. 在/etc/crontab中,加入: 0 0 0 * 1 ...

  4. Golang 引用库中含有初始化代码时如何引用

    简单点说吧,要在引用库前加'_'符号 给出示例 //foo.go // /usr/local/go/pkg/src/foo/foo.go package foo import "fmt&qu ...

  5. (转载)cmd-命令大全及详解

    原文地址:http://greatverve.cnblogs.com/archive/2011/12/09/windows-cmd.html 命令简介 cmd是command的缩写.即命令行 . 虽然 ...

  6. python selenium截取指定元素图片

    1.截取当前屏幕 @property def getImage(self): ''' 截取图片,并保存在images文件夹 :return: 无 ''' timestrmap = time.strft ...

  7. 网络编程之Socket详解

    在说socket之前.我们先了解下相关的网络知识: 端口   在Internet上有很多这样的主机,这些主机一般运行了多个服务软件,同时提供几种服务.每种服务都打开一个Socket,并绑定到一个端口上 ...

  8. ES6之字符串扩展

    ES6字符串新增的常用方法: 1. includes(): 字符串中是否包含某个字符或字符串, 包含的两个字符必须是相连的 let str = 'hello, world' str.includes( ...

  9. react-redux 使用后台数据初始化(渲染)界面

    注:首先在redux中改变state只能通过action操作,reducers改变state 在组件中 store.js import { createStore } from "redux ...

  10. mysql 5.6 分区与不分区的区别

    mysql> CREATE TABLE t1 ( id INT, date DATETIME DEFAULT CURRENT_TIMESTAMP) ENGINE=Innodb; Query OK ...