异常关机,同时出现:Last_IO_Errno: 1236,Last_SQL_Errno: 1594 _MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 2024 | 回复: 0   主题: 异常关机,同时出现:Last_IO_Errno: 1236,Last_SQL_Errno: 1594         下一篇 
第五种族
注册用户
等级:列兵
经验:103
发帖:78
精华:0
注册:2011-11-3
状态:离线
发送短消息息给第五种族 加好友    发送短消息息给第五种族 发消息
发表于: IP:您无权察看 2014-12-24 11:25:18 | [全部帖] [楼主帖] 楼主

一主两从的结构,由于异常关机,导致两个从库都出现如下问题:

mysql> show slave status \G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.56.110
Master_User: replica
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: 561103306-bin.000007
Read_Master_Log_Pos: 1250488
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 1207291
Relay_Master_Log_File: 561103306-bin.000007
Slave_IO_Running: No
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1594
Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Skip_Counter: 0
Exec_Master_Log_Pos: 1250488
Relay_Log_Space: 1207754
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
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event '561103306-bin.000007' at 1250488, the last event read from './561103306-bin.000007' at 4, the last byte read from './561103306-bin.000007' at 4.'
Last_SQL_Errno: 1594
Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
Replicate_Ignore_Server_Ids:
Master_Server_Id: 561103306
Master_UUID:
Master_Info_File: /var/lib/mysql/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp: 141020 09:57:15
Last_SQL_Error_Timestamp: 141020 09:57:15
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
1 row in set (0.00 sec)


当着两个问题同时出现时,先处理后面一个(errno:1594) ,再处理(error:1236)

 Last_SQL_Errno: 1594的处理方法:

mysql>stop slave ;
mysql> change master to master_log_file ='561103306-bin.000007' ,master_log_pos = 1250488;


 Last_IO_Errno: 1236的处理方法:

# mysqlbinlog  561103306-bin.000007  >yyf.log


在yyf.log里面找离  1250488位置最近的事件,发现该日志最后一个pos是1248558,那就可以直接切到下一个log的开始位置即可:

mysql> stop slave;
mysql>  change master to master_log_file='561103306-bin.000008' ,master_log_pos=0;


--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论