The company has 1 cacti monitoring, but in order to prevent a single cacti fault, ready to add a cacti, as backup monitoring.
The currently used monitoring is 115.231.xx.xx below what I call Cacti-a
Newly installed monitoring for 59.63.xx.xx below I tqp for cacti-b
1. Backup cacti-a MySQL Database
Cacti-a above operation
#cd/var/www/
#mysqldump cacti >cacti.sql cacti-a data cacti export named Cacti.sql
If MySQL has a password set, the following
#mysqldump cacti-uroot-ppasswd >cacti.sql
Tip: Tables in individual databases can become corrupted and cause backups to fail.
For example: "ERROR 145 (HY000): Table './cacti/syslog_statistics ' is marked as crashed and should being repaired"
Repair method: # mysql-uroot-p into MySQL
Mysql> use cacti into the database cacti
mysql> Check Tables Syslog_statistics; Check Data Sheet
mysql> Repair table syslog_statistics; Repair Data Sheet
2. Restore the database files backed up by cacti-a to the Cacti-b database.
Cacti-b above operation
# mysql-uroot-p
mysql> drop database cacti; Delete the database created during system installation cacti
mysql> CREATE database cacti; Re-create a new database cacti
Mysql> exit
#cd/var/www
# SCP [email protected]:/var/www/cacti.sql./Copy the cacti-a backed up database file to Cacti-b
[email protected] ' s password: Enter the root password for cacti-a here
# MySQL Cacti <cacti.sql
Verification: #mysql-uroot-p
mysql> use cacti;
Mysql> Show tables;
If you see the following ... The message indicates that the import was successful
+---------------------------------------+
| Tables_in_cacti |
+---------------------------------------+
| Cdef |
| Cdef_items |
| Colors |
| Data_input |
| Data_input_data |
。。。。。。。。。。
3. Backup cacti-a cacti-related configuration files
Operate on Cacti-a
#cd/var/www
# tar-pcpzf/var/www/cacti-backup.tar.gz/var/www/html/* to package All files and folders in the/var/www/html directory
4. Restore the Cacti-a backup cacti configuration file to Cacti-b
Operation on Cacti-b
# SCP [email protected]:/var/www/cacti-backup.tar.gz./
[email protected] ' s password: Enter the root password for cacti-a here
# tar ZXVF cacti-backup.tar.gz unzip the packet, automatically overwrites the original Cacti-b configuration file
Note: The above operation must distinguish between primary and secondary, due to any impact of the operation error is not related to this note.
This article is from the "LIHONGWEIBJ" blog, make sure to keep this source http://lihongweibj.blog.51cto.com/6235038/1783420
Cacti Backup migration