tokudb_tmp_dir导致的tokudb加载失败

时间:2023-03-08 17:38:56
tokudb_tmp_dir导致的tokudb加载失败

安装TOKUDB数据库,安装完成后为了使配置生效,重启完数据库后,发现:

mysql> show engines;
+--------------------+---------+
| Engine  | Support |
+--------------------+---------+
| InnoDB   | DEFAULT |
| CSV   | YES |
| MRG_MYISAM     | YES |
| BLACKHOLE    | YES |
| MEMORY   | YES |
| PERFORMANCE_SCHEMA | YES |
| ARCHIVE   | YES |
| MyISAM    | YES |
| FEDERATED   | NO |
+--------------------+---------+
9 rows in set (0.06 sec)

无tokudb存储引擎,检查错误日志发现:

2016-06-15 20:08:18 5163 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.25-rel73.0 started; log sequence number 1626012
Couldn't start tokuft because some other tokuft process is using the same directory [/mysql/data/tmpdir] for [temp]
2016-06-15 20:08:18 5163 [ERROR] TokuDB unknown error 2
2016-06-15 20:08:18 5163 [ERROR] Plugin 'TokuDB' init function returned error.
2016-06-15 20:08:18 5163 [ERROR] Plugin 'TokuDB' registration as a STORAGE ENGINE failed.

原来是tokudb的配置参数tokudb_tmp_dir指定的目录不存在

解决方法:

mkdir /mysql/data/tmpdir
chown -R mysql.mysql /mysql/data/tmpdir

重启数据库:

mysql> show engines;
+--------------------+---------+-
| Engine | Support |
+--------------------+---------+-
| InnoDB | DEFAULT |
| CSV | YES |
| MRG_MYISAM | YES |
| BLACKHOLE | YES |
| MEMORY | YES |
| TokuDB | YES |
| PERFORMANCE_SCHEMA | YES |
| ARCHIVE | YES |
| MyISAM | YES |
| FEDERATED | NO |
+--------------------+---------+-
10 rows in set (0.08 sec)

如上所示,tokudb已支持。