Steps to follow when doing Remote MySQL Backup

This article is for Amanda Enterprise (AE)

Info Type: General

Info Description:Please check that the following are installed and configured properly on both MySQL ZRM server and ZRM Client:

  • Client Software — The ZRM client software is installed on the MySQL server. This is required for all backups except for full, logical backups and full or incremental logical backups using the SSH copy plugin.
  • Logical Backups — When you are performing a logical backup, the MySQL backup user must have rights to perform the backup and restore. Please follow the steps in the link below for all databases for which you are performing a logical backup of a remote MySQL server: How to set up MySQL user privileges for backup and restore
  • Snapshotting — When performing a raw backup, you can choose to use snapshotting if the volume on which the MySQL database directory resides supports this. When using snapshotting, the mysql user on the backup client must be able to run commands that require root privileges to perform the snapshot. This can be achieved by using the sudo command.

    For example, the following entry in the /etc/sudoers file provides mysql with the necessary privileges to run commands needed for an LVM snapshot using sudo
     
    mysql <FQDN_of_zrm_server> = NOPASSWD:/bin/mount, NOPASSWD:/bin/umount, NOPASSWD:/bin/df, NOPASSWD:/sbin/lvdisplay, NOPASSWD:/sbin/lvcreate, NOPASSWD:/sbin/lvremove

    Different snapshots require sudo permissions for different commands. For full explanation with examples and additional cases, see: How to create Sudoer configuration for snapshots The commands needed for each snapshot method is covered in the ZMC for MySQL User’s Manual.
  • Copy Plugin — The Copy Plugin is used for all backup methods except for full, logical backups and is provided by the ZRM client software. Please make sure the ZRM client software is installed on the remote MySQL server as appropriate. Depending on the Copy Plugin selected and the type of backup, additional configuration may be needed:
  • Date and Time

Date and time of the ZRM server and remote MySQL server must be in sync. Remote MySQL server should not be ahead of the ZRM server by time

  • Snapshot Backup

When performing a snapshot backup, all files and directories in the MySQL database directory must be readable by the mysql user or the Copy Plugin will fail to copy all files and the backup will fail.

  • Copying Binary Logs

During incremental backup, binary logs from the remote MySQL server are copied to the ZRM server. There are several reasons that copying binary logs may fail as describe in Could not copy bin log file