故障现象

MySQL slave status详情

mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.10.10.101
Master_User: root
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000010
Read_Master_Log_Pos: 143861468
Relay_Log_File: slave-relay-bin.000525
Relay_Log_Pos: 128835579
Relay_Master_Log_File: mysql-bin.000010
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table: mysql.%,information_schema.%,test.%
Last_Errno: 0
Last_Error: Could not parse relay log event entry. The possck this by running 'mysqlbinlog' on the binary log), the slave's relay log iay log), a network problem, or a bug in the master's or slave's MySQL code. you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this
Skip_Counter: 0
Exec_Master_Log_Pos: 128835442
Relay_Log_Space: 143862393
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
1 row in set (0.00 sec) mysql>

MySQL 错误日志中显示了问题的根源,磁盘空间满.

thatsit-mysql:/var/lib/mysql # grep -i disk mysqld.log-20160114
/usr/sbin/mysqld: Disk is full writing './mysql-bin.000319' (Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space)
/usr/sbin/mysqld: Disk is full writing './mysql-bin.000320' (Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space)
thatsit-mysql:/var/lib/mysql #

MySQL 错误日志中同样还记录了binlog执行截至的位置点.

thatsit-mysql:/var/lib/mysql # grep ERROR mysqld.log-20160114|grep stopped|tail -1
160114 13:16:16 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000010' position 128835442
thatsit-mysql:/var/lib/mysql #

修复

① 清理MySQL datadir所在的磁盘

② 恢复MySQL SLAVE (STOP SLAVE → CHANGE MASTER → START SLAVE)

※: 位置点为上面从SLAVE STATUS的"Exec_Master_Log_Pos"或者错误日志中获取的.

mysql> stop slave;
Query OK, 0 rows affected (0.00 sec) mysql>
mysql> CHANGE MASTER TO
-> MASTER_HOST='10.10.10.101',
-> MASTER_PORT=3306,
-> MASTER_USER='REP_USER',
-> MASTER_PASSWORD='REP_PASSWORD',
-> MASTER_LOG_FILE='mysql-bin.000010',
-> MASTER_LOG_POS=128835442;
Query OK, 0 rows affected (0.41 sec) mysql> start slave;
Query OK, 0 rows affected (0.00 sec) mysql>

操作后状态确认

mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.10.10.101
Master_User: root
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000010
Read_Master_Log_Pos: 144444705
Relay_Log_File: slave-relay-bin.000002
Relay_Log_Pos: 38259
Relay_Master_Log_File: mysql-bin.000010
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table: mysql.%,information_schema.%,test.%
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 128873466
Relay_Log_Space: 15609498
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 99299
1 row in set (0.00 sec) mysql>

此故障至此修复完毕.

MySQL Replication Error 处理一例的更多相关文章

  1. 常见的MySQL Replication Error

    现在不少公司都在用MySQL(master)-->MySQL(slave)的框架,当然也有一主多从的架构,这也是MySQL主从的一个延伸架构;当然也有的公司MySQL主主的架构,MySQL主主架 ...

  2. mysql replication principle--转

    原文地址:http://www.codeweblog.com/mysql-replication-principle/ 1, the replication process Mysql replica ...

  3. MySQL Replication 优化和技巧、常见故障解决方法

    MySQL 主从同步错误(error)解决(转) sql_slave_skip_counter参数 附: 一些错误信息的处理,主从服务器上的命令,及状态信息. 在从服务器上使用show slave s ...

  4. MySQL replication illegal mix of collations

    MySQL replication case 一则 转载:http://www.vmcd.org/2013/09/mysql-replication-case-%E4%B8%80%E5%88%99/ ...

  5. MySQL Replication 主从复制全方位解决方案

    1.1 主从复制基础概念 在了解主从复制之前必须要了解的就是数据库的二进制日志(binlog),主从复制架构大多基于二进制日志进行,二进制日志相关信息参考:http://www.cnblogs.com ...

  6. MySQL Replication Report

    很多人都会MySQL主从框架的搭建,但很多人没有真正理解同步基本用途.同步的基本原理,还有当Master和Slave同步断开后的处理以及导致Master和slave不同步的原因等等,当你对这些都了如指 ...

  7. 在Docker平台实现MySQL Replication(复制)

    MySQL Replication提供了数据库之间复制数据的功能,通过这个功能可以让一个数据库的数据更改自动同步到另外一个数据库.通常用这个功能来实现数据备份.数据容灾.数据冗余,进一步实现数据的读写 ...

  8. mysql: Error Codes and Messages

    Appendix B. Error Codes and MessagesTable of Contents B.1. Server Error Codes and MessagesB.2. Clien ...

  9. mysql replication常见错误整理

    这篇文章旨在记录MySQL Replication的常见错误,包括自己工作中遇到的与网友在工作中遇到的,方面自己及别人以后进行查找.每个案例都是通过Last_IO_Errno/Last_IO_Erro ...

随机推荐

  1. Python购物车的实现课程

    需求: 1.用户输入工资收入 2.打印商品列表 3.用户选择商品,不断的加入购物车 4.检测用户余额,直接捐款,不足提示余额不足 5.允许主动退出,退出时,打印已购商品列表 重点方法: 打印列表下标的 ...

  2. DateBox( 日期输入框) 组件

    本节课重点了解 EasyUI 中 DateBox(日期输入框)组件的使用方法,这个组件依赖于 Combo(自定义下拉框)和 Calendar(日历). 一. 加载方式//class 加载方式<i ...

  3. Asp.net简单实现forms验证

    <configuration> <system.web> <compilation debug="true" targetFramework=&quo ...

  4. django: startproject

    python 的 django 框架的安装教程很多,这里不列举安装过程,直接开始记开发应用过程. 1  startprojec,新建项目 $ django-admin.py startproject ...

  5. @Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction

    1.带有Render的方法返回值是void,在方法内部进行输出: 不带的返回值类型为MvcHtmlString,所以只能这样使用: @Html.Partial 对应 @{Html.RenderPart ...

  6. Codeforces Round #278 (Div. 1)

    A A monster is attacking the Cyberland! Master Yang, a braver, is going to beat the monster. Yang an ...

  7. 解决IE10以下对象不支持“bind”属性或方法

    IE10一下的浏览器,如果在JS代码中用了bind函数,那么就会报“SCRIPT438: 对象不支持“bind”属性或方法” 因为浏览器没有提供这个参数的方法,所以我们就自己写一个bind,来让这个参 ...

  8. Ubuntu 12.04 更新源

    转载自:http://www.cnblogs.com/eastson/archive/2012/08/24/2654163.html 1.首先备份Ubuntu12.04源列表 sudo cp /etc ...

  9. Android ndk第一步,构建jni headers

    转载请注明出处:http://www.cnblogs.com/fpzeng/p/4281801.html 源码请见 https://github.com/fpzeng/HelloJNI PC系统: u ...

  10. jQuery插件autoComplete使用

    安装/需要引入的文件 <script type="text/javascript" src="../js/jquery-1.8.3.min.js.js"& ...