Cacti Monitoring Server data migration
In response to customer demand and discuss with Wang colleagues, in the BJD environment is missing a standby cacti monitoring server, the original cacti monitoring server needs to be migrated to the new monitoring host to achieve monitoring data synchronization.
Migration ideas: The cacti data host is made up of MySQL data and RRA data, and you only need to restore these two pieces of data back to the newly deployed cacti.
Specific procedures:
Original cacti host ip:192.168.0.2 standby cacti host ip:192.168.122.3
1. Backup the MySQL and RRD data on the original cacti monitor host
SSH 192.168.0.2
Backup database: #mysqldump cacti >cacti.sql cacti is the name of the library in the database, if the password was changed before the database:
#mysqldump-U root-p * * * * * * cacti >cacti.sql is the password.
2, Backup Rra file, online said backup Rra file needs to be backed up with RRDtool dump command, I am here to use tar packaging.
#tar-CVF Rra.tar/var/www/html/cacti/rra
3. Copy the Cacti.sql and Rra.tar files to the new cacti server.
#scp Cacti.sql 192.168.122.3:/root
#scp Rra.tar 192.168.122.3:/var/www/html/cacti/
4, into the standby cacti host: #ssh 192.168.122.3
5, restore the database data: The MySQL cacti database is deleted (I do not change the database here password, do not need a password to enter MySQL).
#mysql
mysql> drop database cacti; Delete Cacti Database
Mysql>create database cacti; To create a new cacti database
Mysql>quit
#mysql Cacti <cacti.sql Recovery database
6. Restore the RRD file
#cd/var/www/html/cacti/
#tar XVF Rra.tar
7. Restart Mysqld and httpd services
# Service Mysqld Restart
# Service httpd Restart
8, open the site will prompt the database error, click: Check can open cacti. Note that the password to login here is the original cacti password.
9. Check the size of MySQL specified library
Database changed
Mysql> Select concat (Round (sum (data_length/1024/1024), 2), ' MB ') as DATA from TABLES where
Table_schema= ' cacti ';
+--------+
| Data |
+--------+
| 4.24MB |
+--------+
1 row in Set (0.11 sec)
This article from the "Practical Notes" blog, reproduced please contact the author!
Cacti Monitoring Server data migration