首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用Percona安装tokudb存储引擎

使用Percona安装tokudb存储引擎

作者头像
Zach
发布2018-07-24 11:38:47
9400
发布2018-07-24 11:38:47
举报
文章被收录于专栏:日暮星辰日暮星辰

由分形树索引支持的PerconaTokuDB®是一款开源的,用于Percona Server的高性能存储引擎,可提高可扩展性和运行效率。专为满足大数据应用的苛刻要求而设计,Percona TokuDB降低了与压缩和优化工作相关的部署成本。Percona TokuDB和Percona HotBackup包含在下面的Percona Server for MySQL 下载链接中。

快速和可扩展性:

Percona TokuDB极大地提高了性能和并发性,减少了磁盘和闪存驱动器存储需求,支持在线模式更改并支持完全符合ACID的事务

Percona TokuDB可以:

  • 更好的性能:如果不进行调整,响应时间比InnoDB快20倍
  • 更强的投资回报率:运营和基础设施成本更低,可扩展性和灵活性更高
  • 可用性更高:在公共,私人和混合云环境中对苛刻应用的停机时间更少

1.安装percona官方RPM源

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm

1

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm

2.测试Percona源

yum list | grep percona

1

yum list | grep percona

3.yum安装percona

yum install Percona-Server-server-57

1

yum install Percona-Server-server-57

4.Percona默认管理命令

service mysql start service mysql restart service mysql stop service mysql status

1234

service mysql start service mysql restart service mysql stop service mysql status

5.查询安装后的临时percona root密码

grep ‘temporary password’ /var/log/mysqld.log

1

grep ‘temporary password’ /var/log/mysqld.log

6.修改数据库密码

mysql -u root -p Enter password:yourpasswd elcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 92 Server version: 5.7.21-21-log Percona Server (GPL), Release 21, Revision 2a37e4e Copyright (c) 2009-2018 Percona LLC and/or its affiliates Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Percona [(none)]> set password=password(‘yournewpasswd’);

12345678910111213141516

mysql -u root -pEnter password:yourpasswdelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 92Server version: 5.7.21-21-log Percona Server (GPL), Release 21, Revision 2a37e4e Copyright (c) 2009-2018 Percona LLC and/or its affiliatesCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Percona [(none)]> set password=password(‘yournewpasswd’);

mysql有密码安全机制,注意设置为足够复杂的密码

7.编辑/etc/mycnf配置文件,修改mysql默认编码

[mysqld] character_set_server=utf8

12

[mysqld] character_set_server=utf8

8.安装jemalloc

yum install jemalloc rpm -qa |grep jemalloc rpm -qa |grep jemalloc jemalloc-3.6.0-1.el7.x86_64 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

123456789101112

yum install jemalloc rpm -qa |grep jemalloc rpm -qa |grep jemalloc jemalloc-3.6.0-1.el7.x86_64rpm -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

记录下/usr/lib64/libjemalloc.so.1地址

9.配置jemalloc依赖文件,编辑/etc/my.cnf,其中加入以下内容:

[mysqld_safe] malloc-lib=/usr/lib64/libjemalloc.so.1

12

[mysqld_safe] malloc-lib=/usr/lib64/libjemalloc.so.1

10.检查Transparent huge pages

echo never > /sys/kernel/mm/transparent_hugepage/enabled echo never > /sys/kernel/mm/transparent_hugepage/defrag

12

echo never > /sys/kernel/mm/transparent_hugepage/enabled echo never > /sys/kernel/mm/transparent_hugepage/defrag

11.安装tokudb

yum install Percona-Server-tokudb-57.x86_64

1

yum install Percona-Server-tokudb-57.x86_64

12.修改selinux状态为permissive,编辑编辑/etc/selinux/config修改以下内容:

selinux=permissive

1

selinux=permissive

setenforce 0

1

setenforce 0

12.初始设置tokudb

ps_tokudb_admin --enable -uroot -p

1

ps_tokudb_admin --enable -uroot -p

输入密码,检查是否成功

13.重启percona

service mysql restart

1

service mysql restart

14.检查确认是否启用tokudb

mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 94 Server version: 5.7.21-21-log Percona Server (GPL), Release 21, Revision 2a37e4e Copyright (c) 2009-2018 Percona LLC and/or its affiliates Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Percona [(none)]> 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 | | MyISAM | YES | MyISAM storage engine | NO | NO | NO | | TokuDB | DEFAULT | Percona TokuDB Storage Engine with Fractal Tree(tm) Technology | YES | YES | YES | | InnoDB | YES | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+ 10 rows in set (0.07 sec)

12345678910111213141516171819202122232425262728293031

mysql -u root -pEnter password: Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 94Server version: 5.7.21-21-log Percona Server (GPL), Release 21, Revision 2a37e4e Copyright (c) 2009-2018 Percona LLC and/or its affiliatesCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. Percona [(none)]> 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         || MyISAM             | YES     | MyISAM storage engine                                                      | NO           | NO   | NO         || TokuDB             | DEFAULT | Percona TokuDB Storage Engine with Fractal Tree(tm) Technology             | YES          | YES  | YES        || InnoDB             | YES     | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        || ARCHIVE            | YES     | Archive storage engine                                                     | NO           | NO   | NO         || MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables                  | NO           | NO   | NO         || FEDERATED          | NO      | Federated MySQL storage engine                                             | NULL         | NULL | NULL       |+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+10 rows in set (0.07 sec)

看到tokudb即为成功。

原创文章转载请注明

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-05-16,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 快速和可扩展性:
  • Percona TokuDB可以:
相关产品与服务
对象存储
对象存储(Cloud Object Storage,COS)是由腾讯云推出的无目录层次结构、无数据格式限制,可容纳海量数据且支持 HTTP/HTTPS 协议访问的分布式存储服务。腾讯云 COS 的存储桶空间无容量上限,无需分区管理,适用于 CDN 数据分发、数据万象处理或大数据计算与分析的数据湖等多种场景。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档