CentOS7 install tokudb

CentOS7下 安装MySQL存储引擎tokudb

介绍

Percona Server for MySQL 5.6

安装

下载Percona-Server-5.6.36-82.0-r58e846a-el7-x86_64-bundle.tar地址为

https://www.percona.com/downloads/Percona-Server-5.6/Percona-Server-5.6.36-82.0/binary/redhat/7/x86_64/Percona-Server-5.6.36-82.0-r58e846a-el7-x86_64-bundle.tar

解压

1
tar -xvf Percona-Server-5.6.36-82.0-r58e846a-el7-x86_64-bundle.tar

安装

1
yum remove mariadb* -y
2
yum install libaio.so.1
3
yum install libaio
4
yum install jemalloc
5
rpm -ivh Percona-Server-devel-56-5.6.36-rel82.0.el7.x86_64.rpm
6
rpm -ivh Percona-Server-shared-56-5.6.36-rel82.0.el7.x86_64.rpm
7
rpm -ivh Percona-Server-client-56-5.6.36-rel82.0.el7.x86_64.rpm
8
rpm -ivh Percona-Server-server-56-5.6.36-rel82.0.el7.x86_64.rpm
9
rpm -ivh Percona-Server-tokudb-56-5.6.36-rel82.0.el7.x86_64.rpm

修改密码.mysql5.6默认生成一个动态密码。percona默认是不生成密码

1
mysql -u root 
2
update mysql.user set password=password('123qaz456');
3
使用tokudb
4
#ps_tokudb_admin --enable -u <mysql_admin_user> -p[mysql_admin_pass] [-S <socket>] [-h <host> -P <port>]
5
6
 ps_tokudb_admin --enable -u root -p123qaz456
1
[root@localhost package]# ps_tokudb_admin --enable -u root -p123qaz456
2
Checking SELinux status...
3
INFO: SELinux is disabled.
4
5
Checking if Percona Server is running with jemalloc enabled...
6
INFO: Percona Server is running with jemalloc enabled.
7
8
Checking transparent huge pages status on the system...
9
INFO: Transparent huge pages are enabled (should be disabled).
10
11
Checking if thp-setting=never option is already set in config file...
12
INFO: Option thp-setting=never is not set in the config file.
13
      (needed only if THP is not disabled permanently on the system)
14
15
Checking TokuDB engine plugin status...
16
INFO: TokuDB engine plugin is not installed.
17
18
Disabling transparent huge pages for the current session...
19
INFO: Successfully disabled transparent huge pages for this session.
20
21
Adding thp-setting=never option into /etc/my.cnf
22
INFO: Successfully added thp-setting=never option into /etc/my.cnf
23
24
Installing TokuDB engine...
25
INFO: Successfully installed TokuDB engine plugin.

查看MySQL引擎信息

1
mysql> show engines \G;
2
*************************** 1. row ***************************
3
      Engine: MyISAM
4
     Support: YES
5
     Comment: MyISAM storage engine
6
Transactions: NO
7
          XA: NO
8
  Savepoints: NO
9
*************************** 2. row ***************************
10
      Engine: CSV
11
     Support: YES
12
     Comment: CSV storage engine
13
Transactions: NO
14
          XA: NO
15
  Savepoints: NO
16
*************************** 3. row ***************************
17
      Engine: MRG_MYISAM
18
     Support: YES
19
     Comment: Collection of identical MyISAM tables
20
Transactions: NO
21
          XA: NO
22
  Savepoints: NO
23
*************************** 4. row ***************************
24
      Engine: BLACKHOLE
25
     Support: YES
26
     Comment: /dev/null storage engine (anything you write to it disappears)
27
Transactions: NO
28
          XA: NO
29
  Savepoints: NO
30
*************************** 5. row ***************************
31
      Engine: PERFORMANCE_SCHEMA
32
     Support: YES
33
     Comment: Performance Schema
34
Transactions: NO
35
          XA: NO
36
  Savepoints: NO
37
*************************** 6. row ***************************
38
      Engine: TokuDB
39
     Support: YES
40
     Comment: Percona TokuDB Storage Engine with Fractal Tree(tm) Technology
41
Transactions: YES
42
          XA: YES
43
  Savepoints: YES
44
*************************** 7. row ***************************
45
      Engine: MEMORY
46
     Support: YES
47
     Comment: Hash based, stored in memory, useful for temporary tables
48
Transactions: NO
49
          XA: NO
50
  Savepoints: NO
51
*************************** 8. row ***************************
52
      Engine: ARCHIVE
53
     Support: YES
54
     Comment: Archive storage engine
55
Transactions: NO
56
          XA: NO
57
  Savepoints: NO
58
*************************** 9. row ***************************
59
      Engine: InnoDB
60
     Support: DEFAULT
61
     Comment: Percona-XtraDB, Supports transactions, row-level locking, and foreign keys
62
Transactions: YES
63
          XA: YES
64
  Savepoints: YES
65
*************************** 10. row ***************************
66
      Engine: FEDERATED
67
     Support: NO
68
     Comment: Federated MySQL storage engine
69
Transactions: NULL
70
          XA: NULL
71
  Savepoints: NULL
72
10 rows in set (0.00 sec)

可以看到tokudb已经安装成功

设置远程用户

1
grant all privileges on *.* to 'root'@'%' identified by '123#456' with grant option;

配置文件

1
symbolic-links=0
2
log-bin=mysql-bin
3
server-id=1
4
expire_logs_days=7
5
lower_case_table_names=1
6
character-set-server =utf8
7
collation-server=utf8_general_ci
8
slow-query-log=1
9
slow-query-log-file=/var/lib/mysql/slow.log
10
sync_binlog=500
11
innodb_buffer_pool_size=512M
12
innodb_buffer_pool_instances=1
13
innodb_flush_method=O_DIRECT
14
innodb_log_file_size=128M
15
innodb_log_buffer_size=8M
16
innodb_flush_log_at_trx_commit = 2

参考
https://www.percona.com/doc/percona-server/5.6/installation/yum_repo.html

https://www.percona.com/downloads/Percona-Server-5.6/LATEST/