Сравнение версий
Ключ
- Эта строка добавлена.
- Эта строка удалена.
- Изменено форматирование.
This topic covers Ubersmith's disaster recovery best practices. The best practices are recommended when preparing for an Ubersmith installation or upgrade, and dealing with hardware failures or data corruption.
Platform
Ubersmith and its related components are continuously being updated and upgraded, therefore ensuring your platform adheres to our system requirements is recommended.
Data Backup
The most critical aspect of the Ubersmith install is the database. To ensure the integrity of your data:
Perform daily database backups using mysqldump.
mysqldump effectively backs up databases to prevent total data loss in the event that the instance host and/or appliance is compromised.Информация mysqldump must be invoked every time you make a backuptitle Note .
- Save a copy of your database to a secure host.
- Configure MySQL replication on a separate host.
This allows This can also allow you to offload some queriesSELECTqueries to the secondary MySQL slavehost, which can improve performance. - Use a commercial backup solution, such as R1Soft, which is fully integrated with Ubersmith.
Backing Up the Ubersmith Instance Host
The Ubersmith software is easily replaced, as all data is stored in the database. Backing up the Ubersmith files themselves is not critical. If you have custom scripts or other files added to your Ubersmith install, ensure they are backed up or located in an external source control application such as SVN or CVS.
Run mysqldump
mysqldump --opt --quote-names -u user -p database > backup.sql
git.
Use mysqldump
Creating a logical backup using mysqldump can be completed fairly easily. Installation of the MySQL or Percona Server client utilities on your host is required; this package will include mysqldump. Percona Server (a MySQL fork) is running in Ubersmith's database container and by default is listening on 127.0.0.1:3306. Make a backup using mysqldump like so:
| Блок кода |
|---|
$ mysqldump -h 127.0.0.1 -u root -p --opt --quote-names ubersmith > ubersmith_backup.sql |
To restore this logical backup, you can run:
| Блок кода |
|---|
$ mysql -h 127.0.0.1 -u root -p ubersmith < ubersmith_backup.sql |
Use Ubersmith's backup container
Creating a physical or 'hot' backup is faster, and has less impact on production database use, but is more complicated to restore. To generate a physical backup with our built-in facility using Percona's xtrabackup utility (https://www.percona.com/software/mysql-database/percona-xtrabackup), run the following as root:
| Блок кода |
|---|
# cd /usr/local/ubersmith
# docker-compose -p ubersmith up backup |
This will output the details of the backup as it progresses. To run the backup in the background, run:
| Блок кода |
|---|
# docker-compose -p ubersmith up -d backup |
Once complete, a tarball of your database files will be placed in /usr/local/ubersmith/backup.
| Примечание |
|---|
The following commands use an example filename; ensure that you use the filename appropriate for the backup created by the steps above. |
Restoring this physical backup is a bit more involved. Copy the tarball into the database container (first ensuring you have enough available disk space to do so):
As root, run:
| Блок кода |
|---|
# cd /usr/local/ubersmith/backup
# docker cp backup-2017-03-13-08-24.tar.gz ubersmith_db_1:/tmp
# docker exec -ti ubersmith_db_1 bash |
The command above will place you in a shell within the Ubersmith database container. Run:
| Блок кода |
|---|
# cd /tmp
# tar zxf backup-2017-03-13-08-24.tar.gz
# cd backup-2017-03-13-08-24
# rsync -rvt --exclude 'xtrabackup_checkpoints' --exclude 'xtrabackup_logfile' ./ /var/lib/mysql
# chown -R mysql:mysql /var/lib/mysql/ |
To exit the container shell, press CTRL-D or type exit and hit return.
After restoring the files, restarting the database container is suggested.
| Блок кода |
|---|
# cd /usr/local/ubersmith
# docker-compose -p ubersmith restart db |
| Предупреждение |
|---|
The backup container automatically deletes backups older than 90 days whenever it is run. |
Backing Up the Ubersmith Appliance
These files The RRD files created by Ubersmith's Appliance store the collected bandwidth, power, environmental, and other data stored by your instance, and are vital to the proper processing of bandwidth billing and other monitoring capabilities within Ubersmith.
Run backup_rrds.sh
/useBackup RRD files
Run the following as root:
| Блок кода |
|---|
# cd /usr/local/ubersmith # ./backup_rrds.ssh |
This command will place a tarball of the Appliance's RRD files
. Save everything in the following directory: /home/uberm/appliance/rrds/in /usr/local/ubersmith.
Restoring Backups
If you need assistance to restore your instance or appliance from a backup, Ubersmith Support will assist you to restore and process our databases. We will need a host with a bare OS install and a copy of your database. Depending on the size of your database, restoration will take between 10 minutes to over an hour, for large databases (multiple GB in size).
| панель | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
On this page:
|
| Свойства страницы | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
|
|
| |