2009/09/19 17:21
文章作者:Enjoy 转载请注明原文链接。
下午主服务器,由于一些原因,导致死机,重启后,发现从服务器的数据没有跟上。配好MYSQL主从也才前几天的事,没多少经验,第一次碰上这问题,有点焦急。不过,自己试了下,还算解决了:)
从服务器上
Master_Log_File: mysqlhxmaster.000007
Read_Master_Log_Pos: 84285377
看一下主服务器:mysqlhxmaster.000007 | 84450528 |
已经过后很多了,确实没跟上。
show slave status\G
Slave_IO_Running: Yes
Slave_SQL_Running: No
有问题了,Slave_SQL_Running应该是Yes才对。
再往下看,有错误的提示:
Last_Errno: 1053
Last_Error: Query partially completed on the master (error on master: 1053) and was aborted. There is a chance that your master is inconsistent at this point. If you are sure that your master is ok, run this query manually on the slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; . Query: 'INSERT INTO hx_stat_record ......(一句SQL语句)'
这里有说明要怎么操作了:)
先stop slave,然后执行了一下提示的语句,再SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;
show slave status\G
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
OK了,从服务器也在几分钟内把堆积的log处理完了,两边又同步了:)

谷歌管理员工具新增 参数处理
MYSQL实现按某列排序ID唯一的语句

