This document is a guide to backing up Abiquo. Every Abiquo installation is different so you must ensure that your backup configuration is appropriate for your installation. This guide gives a general explanation of which parts of Abiquo need to be backed up and how to do this manually and with Rsnapshot.
What to
...
back up?
Abiquo Server, Remote Services and V2V
Save Abiquo directory
Code Block |
---|
$ cp -R /opt/abiquo /path/to/backup/ |
Abiquo Server
Save MySQL data:
Code Block |
---|
$ mysqldump kinton --routines --triggers > /path/to/backup/mysql/kinton-dump.sql $ mysqldump kinton_accounting --routines --triggers > /path/to/backup/mysql/kinton_accounting-dump.sql |
Save Redis data:
Code Block |
---|
$ redis-cli redis> SAVE redis> exit $ cp /var/lib/redis/dump.rdb /path/to/backup/redis |
Abiquo Remote Services
Save DHCPD leases generated by Abiquo:
...
Code Block |
---|
$ cp /etc/fstab /path/to/backup/fstab |
Restore Abiquo Backups
Abiquo Server, Remote Services and V2V
Restore Abiquo properties:
Code Block |
---|
$ cp /path/to/backup/abiquo/config/abiquo.properties /opt/abiquo/config/abiquo.properties |
Abiquo Server
Restore MySQL data:
Code Block |
---|
$ /etc/init.d/abiquo-tomcat stop $ mysql kinton < /path/to/backup/mysql/kinton-dump.sql $ mysql kinton_accounting < /path/to/backup/mysql/kinton_accounting-dump.sql $ /etc/init.d/abiquo-tomcat start |
...
Code Block |
---|
$ /etc/init.d/redis stop $ cp /path/to/backup/redis/dump.rdb /var/lib/redis $ /etc/init.d/redis start |
Abiquo Remote Services
Restore /etc/fstab configuration:
...
Code Block |
---|
$ /etc/init.d/dhcpd stop $ cp /path/to/backup/dhcp/dhcpd.leases* /var/lib/dhcpd/ $ /etc/init.d/dhcpd start |
Restart Abiquo
Now you can restart the Abiquo Tomcat daemon:
Code Block |
---|
$ service abiquo-tomcat restart |
Configure a Remote Backup Server
Now we will describe how to configure a remote CentOS server to do the backups via rsnapshot. In this example we have an Abiquo Server (10.60.20.100) and an Abiquo Remote Services Server (10.60.20.101).
Prepare backup server
First of all, on the backup server, install RPMForge repositories (you can follow the CentOS RPMForge guide) and then install rsnapshot:
...
Code Block |
---|
$ mkdir /opt/backups |
Generate SSH keys
We need to set up SSH passwordless keys without passwords in order to do backups automatically. Generate a pair of public/private keys on the backup server, leaving the passphrase empty:
Code Block |
---|
$ ssh-keygen -t dsarsa Generating public/private dsarsa key pair. Enter file in which to save the key (/root/.ssh/id_dsarsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsarsa. Your public key has been saved in /root/.ssh/id_dsarsa.pub. The key fingerprint is: |
...
Code Block |
---|
$ ssh-copy-id -i ~/.ssh/id_dsarsa.pub root@10.60.20.100 $ ssh-copy-id -i ~/.ssh/id_dsarsa.pub root@10.60.20.101 |
Install rsync
After you have successfully completed the above steps, you can install rsync on the target hosts:
Code Block |
---|
$ ssh root@10.60.20.100 "yum -y install rsync" $ ssh root@10.60.20.101 "yum -y install rsync" |
Configure rsnapshot
Note |
---|
Elements in this file must be separated by tabs, and directories must end with a trailing slash '/'. Be careful of this if you do a copy & paste. You can split long lines by beginning a new line with a space or a tab character. All leading and trailing whitespace will be stripped off the new line, then it will be joined to the previous line with a tab character during configuration file parsing. |
...
Code Block |
---|
$ chmod +x /opt/backups/*.sh |
...
Set up crontab
Automation is easily attainable using a simple crontab entry. Open /etc/crontab and add the following:
...