xtrabackup --defaults-file=/****/****/etc/mysql*.cnf --backup
--ftwrl-wait-threshold=10 --ftwrl-wait-query-type=all --ftwrl-wait-timeout=20 --kill-long-query-type=all
--kill-long-queries-timeout=60 --stream=xbstream --parallel=4 --compress-threads=4 --user=用户名
--password='用户密码' --socket=socket路径
--target-dir=/tmp | sshpass -p'远程主机密码' ssh -p22 -oPreferredAuthentications=password -o StrictHostKeyChecking=no
-o GSSAPIAuthentication=no 远程主机ssh用户@远程主机IP 'xbstream -x -C远程主机保存备份路径
--user --password --socket
连接数据库
--backup 备份需要指定
--target-dir 备份的目录
--parallel 并发备份
--ftwrl-wait-timeout=20 --ftwrl-wait-threshold=10 --ftwrl-wait-query-type=all
加全局读锁之前,指定的时间内ftwrl-wait-timeout依然有执行时长超过ftwrl-wait-threshold的操作,会报错退出。ftwrl-wait-query-type是等待的操作类型。
--kill-long-query-type --kill-long-queries-timeout
执行FTWRL之后,有堵塞全局读锁的操作,等待kill-long-queries-timeout秒之后杀掉类型为kill-long-query-type的sql
--stream=xbstream
使用流式备份
--compress-threads
用于并行数据压缩的线程数