Percona5.7 TokuBackup支持TokuDB热备份
admin
2023-04-28 11:42:08
0

Percona5.7 TokuBackup支持TokuDB热备份


一、安装tokudb引擎

执行以下脚本,自动安装tokudb。

# bin/ps-admin --defaults-file=/etc/my3308.cnf --enable -uroot -p123456 -S /tmp/mysql3308.sock
Checking SELinux status...
INFO: SELinux is disabled.

Checking if TokuDB plugin is available for installation ...
INFO: ha_tokudb.so library for TokuDB found at /usr/local/Percona/lib/mysql/plugin/ha_tokudb.so.

Checking location of jemalloc library ...
INFO: jemalloc library needed for TokuDB found at /usr/local/Percona/lib/mysql/libjemalloc.so.1

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 installed.

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



二、增加mysqld_safe启动参数preload-hotbackup至my.cnf配置文件里

# bin/ps_tokudb_admin --defaults-file=/etc/my3308.cnf --enable-backup -uroot -p123456 -S /tmp/mysql3308.sock
WARNING: This script is deprecated and will be removed in 8.0. You can use ps-admin script which has more functionality.

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 if preload-hotbackup option is already set in config file...
INFO: Option preload-hotbackup is not set in the config file.

Checking TokuDB engine plugin status...
INFO: TokuDB engine plugin is installed.

Checking TokuBackup plugin status...
INFO: TokuBackup plugin is not installed.

Adding preload-hotbackup option into /etc/my3308.cnf
INFO: Successfully added preload-hotbackup option into /etc/my3308.cnf
PLEASE RESTART MYSQL SERVICE AND RUN THIS SCRIPT AGAIN TO FINISH INSTALLATION!



三、重启mysqld服务

/etc/init.d/mysql restart



四、安装热备份TokuBackup plugin工具插件

# bin/ps_tokudb_admin --defaults-file=/etc/my3308.cnf --enable-backup -uroot -p123456 -S /tmp/mysql3308.sock
WARNING: This script is deprecated and will be removed in 8.0. You can use ps-admin script which has more functionality.

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 if preload-hotbackup option is already set in config file...
INFO: Option preload-hotbackup is set in the config file.

Checking TokuDB engine plugin status...
INFO: TokuDB engine plugin is installed.

Checking TokuBackup plugin status...
INFO: TokuBackup plugin is not installed.

Checking if Percona Server is running with libHotBackup.so preloaded...
INFO: Percona Server is running with libHotBackup.so preloaded.

Installing TokuBackup plugin...
INFO: Successfully installed TokuBackup plugin.


五、开始全量热备份

执行下面的命令即可开启热备份:

MySQL [(none)]> set tokudb_backup_dir='/data/tokudb_bak/';
Query OK, 0 rows affected (0.408 sec)

注:创建一个空目录/data/tokudb_bak,并将其属性改成mysql


注意事项:

1、关闭异步IO,否则备份失败。

innodb_use_native_aio = 0

2、不支持增量备份


六、恢复

直接拷贝备份文件至你的数据目录下,启动mysqld进程即可。



相关内容

热门资讯

从“看山看水”到“乐享山水”—... “十五五”首个“五一”假期,文旅市场热力迸发、全线升温。从“看山看水”到“乐享山水”,从品文化到入生...
工作时间减少1%,肥胖率或下降... 澎湃新闻记者 季敬杰合理调整生活与工作的平衡可能会给健康带来意想不到的好处。近日一项研究指出,年度工...
美媒:中美元首会晤或讨论AI护... 据凤凰卫视援引美国媒体报道,美方希望借中美领导人会晤的机会,开启有关人工智能安全与管控的对话,并推动...
卫生间水管布置图尺寸高度 卫生间的水管布置可能比较复杂一些,因为卫生间的管道比较多。比如有热水器的通水管道,有座便器的冲水管道...
电脑尺寸在哪里看 电脑尺寸在哪里看1、可以选择手工测量法来测量电脑尺寸,这时测量一下屏幕对角线,因为显示面积都会小于显...
电脑机箱尺寸标准 常规的机箱一般是立体式,或桌面式,再就是横式。电脑机箱尺寸,目前市面上根据不同的规格有不同的方案。 ...
斯塔默发声:不会辞职 【环球时报驻英国特约记者 纪双城 环球时报特约记者 甄翔 于文】执政党工党在英国地方选举中遭遇“历史...
抽油烟机管道有异味怎么办 抽油烟机是厨房中不可或缺的设备,它能有效地排出油烟,保证室内空气的清新。但是,长时间使用后,抽油烟机...
抽油烟机管道有油垢怎么办 抽油烟机管道是我们家庭生活中必不可少的设备,但长时间的使用会导致管道内部积累大量的油垢,如不及时清理...
沈伯洋与台北市长格局有落差,叶... 海峡导报综合报道 民进党将正式拍板征召民代沈伯洋出战台北市长,并发布采访通知,预计在13日下午举行台...