Cacti Backup migration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.