使用innobackupex远程备份 [英] Taking backup remotely using innobackupex
问题描述
我正在尝试使用innobackupex从远程计算机进行备份.
I am trying to take backup from a remote machine using innobackupex.
./innobackupex --host=<mysql_server> --user=<username> <backup_dir>.
由于无法在服务器中找到目录而失败.
Its failing as it is unable to locate a directory in the server.
(Errcode: 2 - No such file or directory)
我假设它正在本地计算机中搜索目录. 请让我知道如何远程运行备份?
I am assuming it is searching for the directory in the local machine. Please let me know how can we run the backup remotely ?
推荐答案
我怀疑您将innobackupex
与类似mysqldump
的东西混淆了.前者备份实际的表文件,而后者连接到数据库服务器并提取数据.
I suspect you are confusing innobackupex
with something like mysqldump
. The former backs up the actual table files, while the latter connects to the database server and pulls the data.
因为它是尝试备份数据库文件当然,它需要访问数据库服务器上的文件系统,并且不能远程运行.
Since it is trying to backup the database files it will of course need access to the filesystem on the database server, and can't be run remotely.
您可以做的是流备份内容到远程计算机:
innobackupex --stream=tar ./ | ssh user@desthost "cat - > /data/backups/backup.tar"
或者只是使用您选择的方法将生成的备份文件保存到其他服务器上(例如共享驱动器,scp
,rsync
)
Or just save the resulting backup file onto a different server with the method of your choice (e.g. shared drive, scp
, rsync
)
这篇关于使用innobackupex远程备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!