56,687
社区成员
发帖
与我相关
我的任务
分享
[root@centos databackup]# innobackupex --user=root --password='145690' --stream=tar ./ | ssh root@192.168.0.129 "cat - > /data/backups/backup.tar"
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p
150713 17:56:41 innobackupex: Executing a version check against the server...
150713 17:56:41 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root' (using password: YES).
root@192.168.0.129's password: 150713 17:56:41 innobackupex: Connected to MySQL server
150713 17:56:41 innobackupex: Done.
150713 17:56:41 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root' (using password: YES).
150713 17:56:41 innobackupex: Connected to MySQL server
150713 17:56:41 innobackupex: Starting the backup operation
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".
innobackupex: Using server version 5.6.25
innobackupex: Created backup directory /data/databackup
150713 17:56:41 innobackupex: Starting ibbackup with command: xtrabackup --defaults-group="mysqld" --backup --suspend-at-end --target-dir=/tmp --innodb_log_file_size="50331648" --innodb_data_file_path="ibdata1:12M:autoextend" --tmpdir=/tmp --extra-lsndir='/tmp' --stream=tar
innobackupex: Waiting for ibbackup (pid=2078) to suspend
innobackupex: Suspend file '/tmp/xtrabackup_suspended_2'
xtrabackup version 2.2.11 based on MySQL server 5.6.24 Linux (x86_64) (revision id: )
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /var/lib/mysql
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
>> log scanned up to (58238384)
xtrabackup: Generating a list of tablespaces
[01] Streaming ./ibdata1
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
>> log scanned up to (58238384)
[root@centos databackup]# ssh root@192.168.0.129 "( nc -l 9999 > /data/backups/backup.tar & )" && innobackupex --user=root --password='145690' --stream=tar ./ | nc 192.168.0.129 9999
root@192.168.0.129's password:
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p
150713 17:57:38 innobackupex: Executing a version check against the server...
150713 17:57:38 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root' (using password: YES).
150713 17:57:38 innobackupex: Connected to MySQL server
150713 17:57:38 innobackupex: Done.
150713 17:57:38 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root' (using password: YES).
150713 17:57:38 innobackupex: Connected to MySQL server
150713 17:57:38 innobackupex: Starting the backup operation
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".
innobackupex: Using server version 5.6.25
innobackupex: Created backup directory /data/databackup
tar: -:无法 write: 断开的管道
tar: Error is not recoverable: exiting now
innobackupex: 'tar chf -' returned with exit code 2.
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 4921
main::backup_file_via_stream('/tmp', 'backup-my.cnf') called at /usr/bin/innobackupex line 4970
main::backup_file('/tmp', 'backup-my.cnf', '/tmp/backup-my.cnf') called at /usr/bin/innobackupex line 4994
main::write_to_backup_file('/tmp/backup-my.cnf', '# This MySQL options file was generated by innobackupex.\x{a}\x{a}# T...') called at /usr/bin/innobackupex line 3801
main::write_backup_config_file('/tmp/backup-my.cnf') called at /usr/bin/innobackupex line 3728
main::init() called at /usr/bin/innobackupex line 1574
innobackupex: Error: Failed to stream '/tmp/backup-my.cnf': 2 at /usr/bin/innobackupex line 4921.
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:Strahlex/CentOS_CentOS-6/home:Strahlex.repo
yum install sshpass
如下命令成功执行:
innobackupex --user=root --password=root --stream=tar ./ | gzip | sshpass -p 'root123' ssh root@10.6.32.28 "cat - > /usr/programs/xtraback/backup.tar.gz"