前言:因为现在tokuDB直接整合到Percona server里面了,下载页面直接跳转到下载Percona Server 页面了。安装方法跟以前不一样了,下面就来看一下新版本怎么安装了

##准备阶段就不说了,

#首先配置文件不能先有tokudb相关配置,因为默认是没有启用这个引擎,所以得初始化安装成功之后,启动MySQL之后才能安装该引擎。

[root@node12 mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/mydata/3306/data --defaults-file=/usr/local/mysql/my.cnf

Installing MySQL system tables...2016-07-21 20:52:39 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.31-77.0-log) starting as process 2173 ...

2016-07-21 20:52:39 2173 [Note] InnoDB: Using atomics to ref count buffer pool pages

2016-07-21 20:52:39 2173 [Note] InnoDB: The InnoDB memory heap is disabled

2016-07-21 20:52:39 2173 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2016-07-21 20:52:39 2173 [Note] InnoDB: Memory barrier is not used

2016-07-21 20:52:39 2173 [Note] InnoDB: Compressed tables use zlib 1.2.3

2016-07-21 20:52:39 2173 [Note] InnoDB: Using Linux native AIO

2016-07-21 20:52:39 2173 [Note] InnoDB: Using CPU crc32 instructions

2016-07-21 20:52:39 2173 [Note] InnoDB: Initializing buffer pool, size = 1.0G

2016-07-21 20:52:39 2173 [Note] InnoDB: Completed initialization of buffer pool

2016-07-21 20:52:39 2173 [Note] InnoDB: Highest supported file format is Barracuda.

2016-07-21 20:52:39 2173 [Note] InnoDB: 128 rollback segment(s) are active.

2016-07-21 20:52:39 2173 [Note] InnoDB: Waiting for purge to start

2016-07-21 20:52:39 2173 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.31-rel77.0 started; log sequence number 1600607

2016-07-21 20:52:39 2173 [ERROR] /usr/local/mysql/bin/mysqld: unknown variable 'tokudb-data-dir=/mydata/3306/tokudbData'

2016-07-21 20:52:39 2173 [ERROR] Aborting

2016-07-21 20:52:39 2173 [Note] Binlog end

2016-07-21 20:52:39 2173 [Note] InnoDB: FTS optimize thread exiting.

2016-07-21 20:52:39 2173 [Note] InnoDB: Starting shutdown...

2016-07-21 20:52:41 2173 [Note] InnoDB: Shutdown completed; log sequence number 1600617

2016-07-21 20:52:41 2173 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete

看到没有,直接报错了。未知参数。注释tukodb相关选项。再次初始化

###

初始化MySQL,并启动成功之后,才开始安装

[root@node12 mysql]# /etc/init.d/mysql start

Starting MySQL (Percona Server)...                         [  OK  ]

[root@node12 mysql]# mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.6.31-77.0-log Percona Server (GPL), Release 77.0, Revision 5c1061c

Copyright (c) 2009-2016 Percona LLC and/or its affiliates

Copyright (c) 2000, 2016, 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.

mysql>

mysql>

mysql> \q

Bye

##注意要关闭selinux,不然安装不成功

[root@node12 bin]# ps_tokudb_admin --enable -uroot -p

Enter password:

Continuing without password...

Checking SELinux status...

ERROR: SELinux is in enforcing mode and needs to be disabled (or put into permissive mode) for TokuDB to work correctly.

[root@node12 bin]# vim /etc/selinux/config

[root@node12 bin]# setenforce 0

[root@node12 bin]# getenforce

Permissive

###再次安装

[root@node12 bin]# ps_tokudb_admin --enable -uroot -p

Enter password:

Continuing without password...

Checking SELinux status...

INFO: SELinux is in permissive mode.

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 not set in the config file.

(needed only if THP is not disabled permanently on the system)

Checking TokuDB engine plugin status...

INFO: TokuDB engine plugin is not installed.

Adding thp-setting=never option into /etc/my.cnf

INFO: Successfully added thp-setting=never option into /etc/my.cnf

Installing TokuDB engine...

INFO: Successfully installed TokuDB engine plugin.

###因为我这个是Oracle的系统,默认就关闭了透明大页,红帽子和centos系统要关闭透明大页

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

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

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

并写到开启启动里面

[root@node12 bin]# mysql

mysql> show engines;

+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+

| Engine             | Support | Comment                                                                    | Transactions | XA   | Savepoints |

+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+

| CSV                | YES     | CSV storage engine                                                         | NO           | NO   | NO         |

| MRG_MYISAM         | YES     | Collection of identical MyISAM tables                                      | NO           | NO   | NO         |

| MyISAM             | YES     | MyISAM 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        |

| FEDERATED          | NO      | Federated MySQL storage engine                                             | NULL         | NULL | NULL       |

| ARCHIVE            | YES     | Archive storage engine                                                     | NO           | NO   | NO         |

| PERFORMANCE_SCHEMA | YES     | Performance Schema                                                         | NO           | NO   | NO         |

| InnoDB             | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |

+--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+

10 rows in set (0.00 sec)

mysql>

###关闭MySQL,加上自定义配置

####加上配置文件

如果你要自定义tukodb目录,你要把刚才安装命令的文件拷贝相应目录里面,不然会报错

2016-07-21 21:05:32 0 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.6.31-77.0-log) starting as process 3641 ...

2016-07-21 21:05:32 3641 [Note] Plugin 'FEDERATED' is disabled.

2016-07-21 21:05:32 3641 [Note] InnoDB: Using atomics to ref count buffer pool pages

2016-07-21 21:05:32 3641 [Note] InnoDB: The InnoDB memory heap is disabled

2016-07-21 21:05:32 3641 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2016-07-21 21:05:32 3641 [Note] InnoDB: Memory barrier is not used

2016-07-21 21:05:32 3641 [Note] InnoDB: Compressed tables use zlib 1.2.3

2016-07-21 21:05:32 3641 [Note] InnoDB: Using Linux native AIO

2016-07-21 21:05:32 3641 [Note] InnoDB: Using CPU crc32 instructions

2016-07-21 21:05:32 3641 [Note] InnoDB: Initializing buffer pool, size = 1.0G

2016-07-21 21:05:32 3641 [Note] InnoDB: Completed initialization of buffer pool

2016-07-21 21:05:32 3641 [Note] InnoDB: Highest supported file format is Barracuda.

2016-07-21 21:05:32 3641 [Note] InnoDB: 128 rollback segment(s) are active.

2016-07-21 21:05:32 3641 [Note] InnoDB: Waiting for purge to start

2016-07-21 21:05:32 3641 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.31-rel77.0 started; log sequence number 1626017

2016-07-21 21:05:32 3641 [ERROR] TokuDB: Recovery log is missing (persistent environment information is present) while looking for recovery log files in [/mydata/3306/tokudbLog]

2016-07-21 21:05:32 3641 [ERROR] TokuDB unknown error 2

2016-07-21 21:05:32 3641 [ERROR] Plugin 'TokuDB' init function returned error.

2016-07-21 21:05:32 3641 [ERROR] Plugin 'TokuDB' registration as a STORAGE ENGINE failed.

2016-07-21 21:05:32 3641 [Note] RSA private key file not found: /mydata/3306/data//private_key.pem. Some authentication plugins will not work.

2016-07-21 21:05:32 3641 [Note] RSA public key file not found: /mydata/3306/data//public_key.pem. Some authentication plugins will not work.

2016-07-21 21:05:32 3641 [Note] Server hostname (bind-address): '*'; port: 3306

2016-07-21 21:05:32 3641 [Note] IPv6 is available.

2016-07-21 21:05:32 3641 [Note]   - '::' resolves to '::';

2016-07-21 21:05:32 3641 [Note] Server socket created on IP: '::'.

2016-07-21 21:05:32 3641 [Warning] 'user' entry 'root@node12' ignored in --skip-name-resolve mode.

2016-07-21 21:05:32 3641 [Warning] 'user' entry '@node12' ignored in --skip-name-resolve mode.

2016-07-21 21:05:32 3641 [Warning] 'proxies_priv' entry '@ root@node12' ignored in --skip-name-resolve mode.

2016-07-21 21:05:32 3641 [Note] Event Scheduler: Loaded 0 events

2016-07-21 21:05:32 3641 [Note] /usr/local/mysql/bin/mysqld: ready for connections.

Version: '5.6.31-77.0-log'  socket: '/mydata/3306/run/mysql.sock'  port: 3306  Percona Server (GPL), Release 77.0, Revision 5c1061c

#

添加配置文件

tokudb-data-dir = /mydata/3306/tokudbData

tokudb-log-dir = /mydata/3306/tokudbLog

#TokuDB的行模式,建议用 FAST ,如果磁盘空间很紧张,建议用 SMALL

#tokudb_default: 设置默认的压缩行为。在 TokuDB 7.1.0版本,默认使用zlib 库进行压缩,未来版本可能会改变。

#tokudb_fast: 使用quicklz 库的压缩模式。

#tokudb_small: 使用 lzma 库的压缩模式。

#tokudb_zlib: 使用 zlib 库的压缩模式,提供了中等级别的压缩比和中等级别的CPU消耗。

#tokudb_quicklz: 使用 quicklz 库的压缩模式, 提供了轻量级的压缩比和较低基本的CPU消耗。

#tokudb_lzma: 使用lzma库压缩模式,提供了高压缩比和高CPU消耗。

#tokudb_uncompressed: 不使用压缩模式。

#tokudb_row_format = tokudb_small

tokudb_row_format = tokudb_fast

tokudb_cache_size = 1G ###建议内存的一半

tokudb_commit_sync = 0

tokudb_directio = 1

tokudb_read_block_size = 128K

tokudb_read_buf_size = 128K

optimizer_switch = 'mrr=on,mrr_cost_based=off'

[mysqld_safe]

log_error=/mydata/3306/logs/error.log

pid_file=/mydata/3306/run/mysqld.pid

malloc-lib= /usr/local/mysql/lib/mysql/libjemalloc.so

user=mysql

plugin-dir = /usr/local/mysql/lib/mysql/plugin/

plugin-load=ha_tokudb.so

##

移动tokudb文件到相应目录

[root@node12 ~]#mkdir -p /mydata/3306/{tokudbData,tokudbLog}

[root@node12 ~]#chown -R mysql.mysql  /mydata/3306/

[root@node12 data]# mv __tokudb_lock_dont_delete_me_data /mydata/3306/tokudbData/

[root@node12 data]# mv __tokudb_lock_dont_delete_me_temp /mydata/3306/tokudbData/

[root@node12 data]# mv __tokudb_lock_dont_delete_me_environment /mydata/3306/tokudbData/

#log目录

[root@node12 data]# mv __tokudb_lock_dont_delete_me_logs /mydata/3306/tokudbData/

[root@node12 data]# mv __tokudb_lock_dont_delete_me_recovery /mydata/3306/tokudbData/

[root@node12 data]# mv tokudb.rollback /mydata/3306/tokudbLog/

[root@node12 tokudbLog]# ll

total 16

-rw-------. 1 mysql mysql     0 Jul 21 21:05 __tokudb_lock_dont_delete_me_logs

-rw-------. 1 mysql mysql     0 Jul 21 21:05 __tokudb_lock_dont_delete_me_recovery

-rw-rw----. 1 mysql mysql 16384 Jul 21 21:02 tokudb.rollback

###重启MySQL

[root@node12 data]#mysql

mysql> show global variables like '%toku%';

+-----------------------------------------+-------------------------+

| Variable_name                           | Value                   |

+-----------------------------------------+-------------------------+

| tokudb_alter_print_error                | OFF                     |

| tokudb_analyze_delete_fraction          | 1.000000                |

| tokudb_analyze_in_background            | OFF                     |

| tokudb_analyze_mode                     | TOKUDB_ANALYZE_STANDARD |

| tokudb_analyze_throttle                 | 0                       |

| tokudb_analyze_time                     | 5                       |

| tokudb_auto_analyze                     | 0                       |

| tokudb_block_size                       | 4194304                 |

| tokudb_bulk_fetch                       | ON                      |

| tokudb_cache_size                       | 1073741824              |

| tokudb_cachetable_pool_threads          | 0                       |

| tokudb_cardinality_scale_percent        | 50                      |

| tokudb_check_jemalloc                   | ON                      |

| tokudb_checkpoint_lock                  | OFF                     |

| tokudb_checkpoint_on_flush_logs         | OFF                     |

| tokudb_checkpoint_pool_threads          | 0                       |

| tokudb_checkpointing_period             | 60                      |

| tokudb_cleaner_iterations               | 5                       |

| tokudb_cleaner_period                   | 1                       |

| tokudb_client_pool_threads              | 0                       |

| tokudb_commit_sync                      | OFF                     |

| tokudb_compress_buffers_before_eviction | ON                      |

| tokudb_create_index_online              | ON                      |

| tokudb_data_dir                         | /mydata/3306/tokudbData |

| tokudb_debug                            | 0                       |

| tokudb_directio                         | ON                      |

| tokudb_disable_hot_alter                | OFF                     |

| tokudb_disable_prefetching              | OFF                     |

| tokudb_disable_slow_alter               | OFF                     |

| tokudb_disable_slow_update              | OFF                     |

| tokudb_disable_slow_upsert              | OFF                     |

| tokudb_empty_scan                       | rl                      |

| tokudb_enable_partial_eviction          | ON                      |

| tokudb_fanout                           | 16                      |

| tokudb_fs_reserve_percent               | 5                       |

| tokudb_fsync_log_period                 | 0                       |

| tokudb_hide_default_row_format          | ON                      |

| tokudb_killed_time                      | 4000                    |

| tokudb_last_lock_timeout                |                         |

| tokudb_load_save_space                  | ON                      |

| tokudb_loader_memory_size               | 100000000               |

| tokudb_lock_timeout                     | 4000                    |

| tokudb_lock_timeout_debug               | 1                       |

| tokudb_log_dir                          | /mydata/3306/tokudbLog  |

| tokudb_max_lock_memory                  | 134217728               |

| tokudb_optimize_index_fraction          | 1.000000                |

| tokudb_optimize_index_name              |                         |

| tokudb_optimize_throttle                | 0                       |

| tokudb_pk_insert_mode                   | 1                       |

| tokudb_prelock_empty                    | ON                      |

| tokudb_read_block_size                  | 131072                  |

| tokudb_read_buf_size                    | 131072                  |

| tokudb_read_status_frequency            | 10000                   |

| tokudb_row_format                       | tokudb_fast             |

| tokudb_rpl_check_readonly               | ON                      |

| tokudb_rpl_lookup_rows                  | ON                      |

| tokudb_rpl_lookup_rows_delay            | 0                       |

| tokudb_rpl_unique_checks                | ON                      |

| tokudb_rpl_unique_checks_delay          | 0                       |

| tokudb_strip_frm_data                   | OFF                     |

| tokudb_support_xa                       | ON                      |

| tokudb_tmp_dir                          |                         |

| tokudb_version                          | 5.6.31-77.0             |

| tokudb_write_status_frequency           | 1000                    |

+-----------------------------------------+-------------------------+

64 rows in set (0.00 sec)

mysql> use test;

Database changed

mysql> create table test1 ( id int not null primary key , c_name char(10) not null) engine=tokudb;

Query OK, 0 rows affected (0.02 sec)

mysql>

tokudb引擎安装-2的更多相关文章

  1. TokuDB 引擎安装测试

    背景: TokuDB引擎是有Tokutek开发的一个数据库存储引擎,在设计之初便引入了独特的索引算法,在其官网测试的文章中看到TokuDB性能比InnoDB高出很多. MySQL是一个插件式的数据库, ...

  2. 【MySQL】TokuDB引擎初探(MySQL升级为Percona,MySQL升级为MariaDB)

    参考:http://blog.sina.com.cn/s/blog_4673e6030102v46l.html 参考:http://hcymysql.blog.51cto.com/5223301/14 ...

  3. TokuDB · 引擎特性 · HybridDB for MySQL高压缩引擎TokuDB 揭秘

    原文出处:阿里云RDS-数据库内核组 HybridDB for MySQL(原名petadata)是面向在线事务(OLTP)和在线分析(OLAP)混合场景的关系型数据库.HybridDB采用一份数据存 ...

  4. sphinx中文版Coreseek中文检索引擎安装和使用方法(Linux)

    sphinx中文版Coreseek中文检索引擎安装和使用方法(Linux)     众所周知,在MYSQL数据库中,如果你在百万级别数据库中使用 like 的话那你一定在那骂娘,coreseek是一个 ...

  5. 故障案例 | 主从复制环境中tokudb引擎报错排查过程

    欢迎来到 GreatSQL社区分享的MySQL技术文章,如有疑问或想学习的内容,可以在下方评论区留言,看到后会进行解答 GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 0 ...

  6. 安装TokuDB引擎

    前言:TokuDB 是一个高性能.支持事务处理的 MySQL 和 MariaDB 的存储引擎.TokuDB 的主要特点是高压缩比,高 INSERT 性能,支持大多数在线修改索引.添加字段,非常适合日志 ...

  7. zabbix使用tokudb引擎替换innodb引擎

    zabbix数据量大,数据量增长很快,使用tokudb可以更好的压缩 使用tokudb,用percona 或mariadb数据库 1.查看数据库版本 (1)登录数据库的时候可以看到 (2)status ...

  8. tokudb引擎磁盘空间不足导致写入失败的调查

    故障现象 2016.1.1号早上4点左右,zabbi数据库服务器报警,写入数据失败.登陆机器后检查发现磁盘空间使用95%没有用满,进去zabbix数据库,执行insert命令提示错误“errir 10 ...

  9. 深入剖析Windows专业版安装Docker引擎和Windows家庭版Docker引擎安装的区别

    原创声明:作者:Arnold.zhao  博客园地址:https://www.cnblogs.com/zh94 公司使用的电脑是Windows专业版,所以配置本机的Docker时会方便许多,后续由于需 ...

随机推荐

  1. c 指针兼容性问题

    指针兼容性问题: const指针不能赋值给非const指针. 非const指针可以赋值给const 指针,但前提是只是一层间接运算 Example: int *pt1; const *pt2; con ...

  2. 从零开始学ios开发(十六):Navigation Controllers and Table Views(下)

    终于进行到下了,这是关于Navigation Controllers和Table Views的最后一个例子,稍微复杂了一点,但也仅仅是复杂而已,难度不大,我们开始吧. 如果没有上一篇的代码,可以从这里 ...

  3. kruskal --- c++ (2)

    #include <cstdio> #include <algorithm> using namespace std; struct aaa{ int l,r,w; bool ...

  4. UML 小结(6)- UML九种图的比较与学习

    UML中的九种图: 用例图.类图.对象图.状态图.时序图.协作图.活动图.部署图.构件图. 1)用例图(Use Case Diagram) 它是UML中最简单也是最复杂的一种图.说它简单是因为它采用了 ...

  5. centos 64位linux系统下安装appt命令

    首先,安装apktool包 1. wget http://android-apktool.googlecode.com/files/apktool-install-linux-r04-brut1.ta ...

  6. Makedown常用符号整理

    整理自:http://www.jianshu.com/p/1e402922ee32 不过这里发现博客园的makedown语法支持还不完善,代码语法显示挺有问题的,比较遗憾. 标题 # 一级标题## 二 ...

  7. 多线程学习之AsyncOperation实现线程间交互

    1.首先我们要实现如下图的效果:                                                          a.主线程A运行方法段1时创建子线程B b.然后子线 ...

  8. TCP 滑动窗口和 拥塞窗口

    转http://coolshell.cn/articles/11609.html 滑动窗口 -- 表征发送端和接收端的接收能力 拥塞窗口-- 表征中间设备的传输能力 TCP滑动窗口 需要说明一下,如果 ...

  9. auto_ptr的设计动机

    auto_ptr的设计动机 C++标准程序库提供的auto_ptr是一种智能型指针(smart pointer),帮助程序员防止“被异常抛出时发生资源泄露”. 函数的操作经常依以下模式进行: 1.获取 ...

  10. POJ 1844

    #include <iostream> #define MAXN 20 using namespace std; int value[MAXN]; int place[MAXN]; ]; ...