Transfer Zabbix database using Xtrabackup and MySQL master-slave replication

Source: Internet
Author: User

A description of the application scenario

Currently, the server and Web side of the Zabbix monitoring system and MySQL are running on the same virtual machine, the virtual machine is not running very stable recently, and MySQL is frequently killed by Oom. It is necessary to migrate the Zabbix database to another physical machine with large memory in time.


Two migration steps

The idea is to build MySQL master-slave replication, the existing MySQL instance as master, the new MySQL instance as slave, now dump a copy of the existing data to the new MySQL instance, and then set the master-slave synchronization, and finally shut down the master-slave synchronization.

Here we use Xtrabackup to back up the master data without using mysqldump to back up the data, because the table is locked when the mysqldump is backed up and the backup time is longer.


1. Change the my.cnf of master

Log-bin=mysql-binlog-bin-index=mysql-bin.indexserver-id=1binlog_format=mixed

2. Change the my.cnf of slave

Server-id = 2relay-log-index = Slave-relay-bin.indexrelay-log = Slave-relay-binreplicate-ignore-db=mysql

3.

This article is from the Linux SA John blog, so be sure to keep this source http://john88wang.blog.51cto.com/2165294/1786970

Transfer Zabbix database using Xtrabackup and MySQL master-slave replication

Related Article

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.