今天,我们的主 mysql db 服务器和两个复制服务器之间的复制下降了。我在这里有一个很久以前写的程序,我不确定这是解决这个问题的最快方法。我想与您分享该程序,如果您能提出您的想法,甚至告诉我如何更快地完成,我将不胜感激。
At the master:
RESET MASTER;
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
And copy the values of the result of the last command somewhere.
Wihtout closing the connection to the client (because it would release the read lock) issue the command to get a dump of the master:
mysqldump mysq
Now you can release the lock, even if the dump hasn't end. To do it perform the following command in the mysql client:
UNLOCK TABLES; …
Run Code Online (Sandbox Code Playgroud)