前景提要
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’也不行。