The article provides advice on how to configure the backup/restore environment for the OBAS Management Node (MN) and database server to allow the Provider to quickly restore the OBAS system in the event of a disaster.
First, consider using separate servers for the OBAS system MySQL database and the OBAS application. This is recommended for performance and backup management reasons.
Refer to the Knowledgebase article #114852 for detailed instructions on how to do this.
General OBAS MN backup procedure
Configure regular backups of the OBAS application and database servers
An OBAS system installed into a Virtuozzo Container can be backed up using the native Virtuozzo Backup Tools on the local or a remote Virtuozzo backup server. Backups of the OBAS container should be performed with the container stopped during the backup procedure to guarantee database consistency. Refer to the official Virtuozzo Containers documentation and to the Knowledgebase article How to automate backup operations in PVC for more details about container backups.
If the OBAS system database is running on a remote database server, back up the remote database server when the OBAS container is stopped (or, at least, the OBAS service is stopped in the container).
Clone OBAS application and database server containers
Another way to create a backup of an OBAS system installed inside a container is to create a clone of the container; this will allow you to quickly restore the container from the clone. To do this, you simply need to stop and disable the broken container and start the cloned container.
A clone of a container may be created using the Virtuozzo native utility vzmlocal. For example, to clone container #99 as container #10099, the following command may be used on the Virtuozzo server where the container is running:
# vzmlocal -C 99:10099
In the event of problems with the original OBAS Management Node (e.g., during an OBAS upgrade), the system can be restored from the clone if it was created right before the upgrade using a command like the following:
# vzmlocal 10099:99
Use the "hspc-mn-backup" utility on the OBAS Management Node
Another possible backup solution suitable for OBAS systems installed on physical servers and Virtuozzo containers is to use the hspc-mn-backup utility shipped with the OBAS distribution. For the detailed information regarding the utility, refer to this article in the OBAS Advanced Configuration Manual.
Advanced backup solutions
You may install and configure additional servers to make it possible to restore the OBAS system quickly in the event of a disaster:
- MySQL database replica
- OBAS spare server
OBAS system database replica
Install and configure a replica for the OBAS system MySQL database using the instructions on the official MySQL website: Replication.
If you have a replica, you will have an almost instant copy of the OBAS system database on the replica server and will be able to restore the OBAS system from the most recent backup using the following procedure:
Restore OBAS containers (Management Node and Database server) from the most recent backup. Do not start the OBAS Management Node after the restoration.
Copy the MySQL database from the replica server to the OBAS database server, e.g., using the rsync utility on the Virtuozzo Hardware Node where the OBAS container is located; copy the entire /var/lib/mysql folder from the database replica server to the OBAS Database Server container.
Start the OBAS database server, and then start the OBAS Management Node.
Make sure that OBAS is functioning correctly.
On the restored MySQL master server (OBAS Database Server), run SHOW MASTER STATUS in MySQL to show the current replication status. The command will show an output like the following:
mysql> SHOW MASTER STATUS; +-------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +-------------------+----------+--------------+------------------+ | mysqld-bin.144099 | 7082512 | aspc | mysql,test | +-------------------+----------+--------------+------------------+
- On the replica, update the replication point using the File and Position values above and the SET MASTER TO command.
OBAS hot spare server
Install and configure the OBAS spare server, which will store a copy of the OBAS application.
Configure regular synchronization of the OBAS application files from the main OBAS server to the spare server, e.g., using the rsync utility.
With the spare server, you can restore the OBAS system using the following steps:
Switch the IP address on the hot spare server to the IP address of the main OBAS server.
Configure OBAS on the spare server to use the MySQL database on the replica server.
Start the OBAS service on the spare server.
- Configure the ex-master server to be the spare one (you will be able to switch to it in case there are problems with the current main OBAS server).
Add the SSD hard disk on the server used to host the OBAS Management Node and database server containers or on the server where these containers are being backed up (for remote backups). You can back up to the SSD disk very quickly:
- Stop OBAS containers (MN and database servers)
- Back up servers
- Start OBAS containers
- Copy backup from the SSD disk to separate backup storage