Xtrabackup8 对docker中容器的mysql备份
< 返回列表时间: 2020-03-14来源:开源中国
HDC调试需求开发(15万预算),能者速来!>>>
我想对docker部署的mysql8.0.19进行备份,一开始试了一下Xtrabackup8.0.9 发现宿主机安装Xtrabackup不能连接到docker的mysql,需在docker容器里面安装。因为是微服务系统,数据库会有多个不想在每个容器中都安装Xtrabackup,请教各路大神宿主机安装Xtrabackup怎么对docker 容器的mysql备份,或者还有没有其它更好用的备份工具, mysqldump 这种方式不考虑
一下是允许命令后的异常信息 xtrabackup: recognized server arguments: --log_bin=mysql-bin --server-id=1 --innodb_flush_log_at_trx_commit=1 --innodb_log_buffer_size=1M --innodb_buffer_pool_size=64M --innodb_log_file_size=48M --innodb_autoextend_increment=64 --innodb_open_files=300 --innodb_file_per_table=1 --innodb_checksum_algorithm=0 --open_files_limit=4161 xtrabackup: recognized client arguments: --user=root --password=* --host=172.17.0.2 --port=8250 --backup=1 --parallel=4 --target-dir=/home/back/db_cms_ xtrabackup version 8.0.9 based on MySQL server 8.0.18 Linux (x86_64) (revision id: c5cbbe4) 200314 15:23:24 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;host=172.17.0.2;port=8250' as 'root' (using password: YES). Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;host=172.17.0.2;port=8250','root',...) failed: Can't connect to MySQL server on '172.17.0.2' (111) at - line 1535. 200314 15:23:24 Connecting to MySQL server host: 172.17.0.2, user: root, password: set, port: 8250, socket: not set Failed to connect to MySQL server: Can't connect to MySQL server on '172.17.0.2' (111).
脚本 xtrabackup --defaults-file=/home/mysql/xxx/master/config/my.cnf -uroot -pXXX -Hlocalhost --port=8250 --backup --parallel=4 --target-dir=/home/back/db_xxx_ $name
-H 一开始设置的是localhost不行,我换了mysql容器中的ip地址‘172.17.0.2’也不行。
热门排行