Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to repair nodes with inconsistent data by MySQL MGR

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces MySQL MGR how to repair inconsistent data nodes, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to know about it.

1. Create a full backup (mysqldump or xtrabackup) on the current primary node:

# / usr/bin/innobackupex-defaults-file=/etc/my.cnf-user=root-password='xxxx' / data/backup

two。 Stop the MySQL of the failed instance

# mysqladmin-uroot-p shutdown

3. Clear the current data directory

Remarks: clear unprecedented backup

4. Restore full backup to the failed instance:

# / usr/bin/innobackupex-- defaults-file=/etc/my.cnf-- user root-- socket=/tmp/mysql.sock-- apply-log / data/backup

# / usr/bin/innobackupex-- defaults-file=/etc/my.cnf-- user root-- socket=/tmp/mysql.sock-- move-back / data/mysql

5. Start MySQL:

# mysqld_safe-- user=mysql &

6. Update GTID_PURGE

Mysql > RESET MASTER

Mysql > RESET SLAVE ALL

Mysql > SET SQL_LOG_BIN=OFF

Mysql > SOURCE datadir/backup_gtid_executed.sql

Mysql > SET SQL_LOG_BIN=ON

Mysql > CHANGE MASTER TO MASTER_USER='rpl_user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery'

Start group replication:

Mysql > START GROUP_REPLICATION

7. Check the node status:

Mysql > SELECT * member_host, member_port, member_state FROM performance_schema.replication_group_members

Thank you for reading this article carefully. I hope the article "how to fix data inconsistencies in MySQL MGR" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report