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进程即可。



相关内容

热门资讯

烈焰熊熊,堪比“原子弹”,欧洲... 据美国有线电视新闻网(CNN)7月29日报道,席卷法国西南部的大片野火燃烧得如此猛烈,以至于形成了一...
外交部:对日本熊本县地震遇难者... 据凤凰卫视报道,针对日本熊本县发生强震造成人员伤亡,中国外交部发言人毛宁7月29日在例行记者会上表示...
高铁喧哗被劝阻后叫嚣全家体制内... “女子高铁喧哗被劝阻后叫嚣全家体制内”一事迎来官方通报。据新京报报道,7月29日,辽宁北票市公安局发...
广东专业蓝牙耳机定制厂家推荐,... 在珠三角腹地,广东早已成为全球蓝牙耳机产业链的“心脏地带”。从深圳华强北的声学元件批发,到东莞、惠州...
格雷厄姆葬礼变地缘竞价场!两大... 有些葬礼,送别的是逝者;有些葬礼,演的却是活人最现实的政治博弈。当地时间7月28日,美国老牌鹰派参议...
一道小学数学题难住3名医学博士... 3名不同学校的博士同做一道数学题,谁最厉害?近日,一陕西网友发布的视频引发热议。29日,视频发布者“...
华为全新“小艺任务”亮相:整合... 7月29日,在华为鸿蒙电脑新品技术沟通会上,终端云服务小艺业务部总裁贾永利宣布,小艺将迎来“从对话到...
广西日报特稿《王的猜想》火了,... 澎湃新闻记者 蒋子文 实习生 汤煜炜为应对外界购买纸质版特稿《王的猜想》的热情,《广西日报》宣布紧急...
月租20元内!2026年平价云... 不少手游玩家、账号运营从业者挑选云手机时,首要诉求就是低价够用,想要控制每月支出在20元以内,同时兼...
诺奖得主如何看待王虹境遇?“我... 中村修二(2014年诺贝尔物理学奖得主)【导读】近日王虹与邓煜双双获得2026年菲尔兹奖,成为了首批...