Taking backup remotely using innobackupex
Asked Answered
P

2

9

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 ?

Pentacle answered 19/1, 2016 at 9:53 Comment(0)
I
6

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.

What you can do is stream the contents of the backup to a remote machine:

innobackupex --stream=tar ./ | ssh user@desthost "cat - > /data/backups/backup.tar"

Or just save the resulting backup file onto a different server with the method of your choice (e.g. shared drive, scp, rsync)

Indene answered 22/1, 2016 at 19:4 Comment(1)
I think we may use this option or might run the command using ssh and then copy the files to the remote machinePentacle
C
0

I have the same needs, and I use nfs to solve it.

mysql on server A, and i want to backup to server B.


on server A mount server B's directory /data/mysql_data:
[root@server_a ~]# mount -t nfs server_b:/data/mysql_data /mysql_data_server_b
and then jest point the output to mysql_data_server_b;


nfs environment is needed: yum install -y nfs-utils

Cyanosis answered 24/8, 2019 at 8:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.