Repoint Replica Servers in MySQL/Percona Server for MySQL 8.0
source link: https://www.percona.com/blog/repoint-replica-servers-in-mysql-percona-server-for-mysql-8-0/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Repoint Replica Servers in MySQL/Percona Server for MySQL 8.0
When doing migrations or failovers in MySQL, there is usually a need to do a topology change and repoint replica servers to obtain replication data from a different server.
For example, given servers {A, B, and C} and the following topology:
If you need to repoint C to be a replica of B, i.e:
You can follow the next steps:
Note: log_replica_updates should be enabled on the soon-to-be primary as it is a prerequisite for chain replication.
Note: It is assumed that both replicas only stream from Server A and there are no conflicting replication filters in place that might break replication later on.
If Using File/Position-Based Replication:
If Using GTID-Based Replication:
Doing the opposite replication change from chain replication (A->B->C) into one primary with two replicas should be simpler:
If Using File/Position-Based Replication:
If Using GTID-Based Replication:
Conclusion:
Doing topology changes might seem hard at first, but with the above procedure, it should be easy and error-free! If you do not want to do the manual approach, then you can consider using tools like Orchestrator which allows for automatic failover and promotions.
Percona Distribution for MySQL is the most complete, stable, scalable, and secure, open-source MySQL solution available, delivering enterprise-grade database environments for your most critical business applications… and it’s free to use!
STAY UP-TO-DATE With Percona!
Join 50,000+ of your fellow open-source enthusiasts! Our newsletter provides updates on Percona open source software releases, technical resources, and valuable MySQL, MariaDB, PostgreSQL, and MongoDB-related articles. Get information about Percona Live, our technical webinars, and upcoming events and meetups where you can talk with our experts.
By submitting my information I agree that Percona may use my personal data in send communication to me about Percona services. I understand that I can unsubscribe from the communication at any time in accordance with the Percona Privacy Policy.
Author
Computer engineer from Montevideo, Uruguay, joined Percona on February 2018, first as a support engineer, then moving to the consulting team. Working in complex IT solutions for more than 10 years, Carlos now specializes in MySQL and related technologies
Leave a Reply Cancel reply
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK