First of all, this article is not a hands-on teaching you to use Percona Xtrabackup, you can refer to my entry level article http://blog.csdn.net/zhu19774279/article/details/41693267, you can also search or read the official manual.
I've been trying to use the Percona xtrabackup compression feature and the ability to send it to a remote host today, but it's always "failed" and it's time to get off work and find out where the problem is. Altogether two questions. question 1:
I chose the stream mode is tar, but whether it is tar or tar.gz, but found that after packaging files with WinRAR a class of software decompression view, unexpectedly only one file: Backup-my.cnf. Repeated trial of various methods on the Internet, even the results are the same, so I am very different, even if updated to the latest version of the 2.2.6 results are the same. The following figure:
Finally, I finally found a place that I ignored: "To extract Percona Xtrabackup's archive You must use tar with-i option", that is, the decompression must be with-I parameters. And when using WinRAR view, and Linux under the TAR command decompression principle is not the same, so you can only get backup-my.cnf a file, other files can not see or extract. Switch to Linux, use the "Tar-xizf backup.tar.gz" decompression to get the desired results. Question 2:
Xtrabackup in a remote backup, the SSH command was used to log on to another host, but the SSH command did not provide the password parameter at all, so this remote backup is simply impossible to complete, and the command is enforced, and the log scanned up to (1600564) error appears. To solve this problem only need to install Sshpass, install the Sshpass, you can pass the password parameters to the SSH command, in the. sh file is very convenient.
Finally give me the statement I use:
Innobackupex--user=root--password=root--stream=tar./| gzip | Sshpass-p ' root123 ' ssh root@10.6.32.28 "cat->/usr/programs/xtraback/backup.tar.gz"