简体   繁体   中英

Mysql Replication SLAVE go down

I have a problem with mysql replication.

I configure two virtual host.

Server 1 Apache + mysql Ver 15.1 Distrib 5.5.41-MariaDB

Master and SLAVE OF Server2

Server 2 mysql Ver 14.14 Distrib 5.5.42

Master and SLAVE OF Server1

Topologi MASTER + MASTER

When I restart slaves all work good, short latency and fast update. But when I wait a few minutes the replication not work more. If I update some row or make a insert or delete the slave not update the changes.

The logs not write any error, but the master_position_log is diferent between master and slave.

And if I restart the slaves all works again, the bdd is updated and the replication works well.

I don't know what happen, seems the threads sleep or death.

Thanks for some idea for fix the problem

In two cases the processes seems ok.

SERVER1

Kill 168 system user None Connect 1146 Waiting for master to send event ---

Kill 169 system user None Connect 945 Slave has read all relay log; waiting for the slave I/O thread to update it ---

Kill 170 master XXXXXXX:59273 None Binlog Dump 1145 Master has sent all binlog to slave; waiting for binlog to be updated ---

SERVER2

Kill 73 root XXXXXX:55089 None Binlog Dump 1137 Master has sent all binlog to slave; waiting for binlog to be updated ---

Kill 76 system user None Connect 1137 Waiting for master to send event ---

Kill 77 system user None Connect 985 Slave has read all relay log; waiting for the slave I/O thread to update it ---

The problem is latency.

My solution, create a CRON every minut for stop and start slave.

Now all works.

Cristian

SHOW SLAVE STATUS;

on each server. That is likely to tell you what is wrong.

You do understand the potential problems with AUTO_INCREMENT and UNIQUE keys when you are writing to both heads of a dual-Master topology?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM