MYSQL主机Master磁盘写满,导致主从数据无法同步各种问题解决
2012-12-28 19:21
1281 查看
由于主机Master磁盘写满导致主从无法同步,为Master增加磁盘并恢复服务后,导致从机如下错误:
mysql> SHOW SLAVE STATUS\G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.1.60
Master_User: syncuser
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000016
Read_Master_Log_Pos: 1011285945
Relay_Log_File: syncuser022-relay-bin.000003
Relay_Log_Pos: 253
Relay_Master_Log_File: mysql-bin.000001
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: 145
Last_Error: Error 'Table './mysql/proc' is marked as crashed and should be repaired' on query. Default database: 'imusers'. Query: 'DROP SCHEMA IF EXISTS `imusers`'
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 17117426719
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: 'binlog truncated in the middle of event; consider out of disk space on master; the last event was read from './mysql-bin.000016' at 1011285945, the last byte
read was read from './mysql-bin.000016' at 1011286016.'
Last_SQL_Errno: 145
Last_SQL_Error: Error 'Table './mysql/proc' is marked as crashed and should be repaired' on query. Default database: 'imusers'. Query: 'DROP SCHEMA IF EXISTS `imusers`'
Replicate_Ignore_Server_Ids:
Master_Server_Id: 60
1 row in set (0.00 sec)
ERROR:
No query specified
处理方法:
在从机上解决异常:'Table './mysql/proc' is marked as crashed and should be repaired' on query.错误。
或
ERROR 145 (HY000): Table './mysql/proc' is marked as crashed and should be repaired
解决方法
mysql> repair table mysql.proc;
+------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+------------+--------+----------+----------+
| mysql.proc | repair | status | OK |
+------------+--------+----------+----------+
然后再在从机上执行:
slave stop;
CHANGE MASTER TO MASTER_HOST='192.168.1.60',MASTER_USER='syncuser', MASTER_PASSWORD='st@rhu6kb00k',MASTER_LOG_FILE='binlog.000023',MASTER_LOG_POS=189;
slave start;
slave stop;
reset slave;
slave start;
SHOW SLAVE STATUS\G;
重新与主机同步即可。
mysql> SHOW SLAVE STATUS\G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.1.60
Master_User: syncuser
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000016
Read_Master_Log_Pos: 1011285945
Relay_Log_File: syncuser022-relay-bin.000003
Relay_Log_Pos: 253
Relay_Master_Log_File: mysql-bin.000001
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: 145
Last_Error: Error 'Table './mysql/proc' is marked as crashed and should be repaired' on query. Default database: 'imusers'. Query: 'DROP SCHEMA IF EXISTS `imusers`'
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 17117426719
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: 'binlog truncated in the middle of event; consider out of disk space on master; the last event was read from './mysql-bin.000016' at 1011285945, the last byte
read was read from './mysql-bin.000016' at 1011286016.'
Last_SQL_Errno: 145
Last_SQL_Error: Error 'Table './mysql/proc' is marked as crashed and should be repaired' on query. Default database: 'imusers'. Query: 'DROP SCHEMA IF EXISTS `imusers`'
Replicate_Ignore_Server_Ids:
Master_Server_Id: 60
1 row in set (0.00 sec)
ERROR:
No query specified
处理方法:
在从机上解决异常:'Table './mysql/proc' is marked as crashed and should be repaired' on query.错误。
或
ERROR 145 (HY000): Table './mysql/proc' is marked as crashed and should be repaired
解决方法
mysql> repair table mysql.proc;
+------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+------------+--------+----------+----------+
| mysql.proc | repair | status | OK |
+------------+--------+----------+----------+
然后再在从机上执行:
slave stop;
CHANGE MASTER TO MASTER_HOST='192.168.1.60',MASTER_USER='syncuser', MASTER_PASSWORD='st@rhu6kb00k',MASTER_LOG_FILE='binlog.000023',MASTER_LOG_POS=189;
slave start;
slave stop;
reset slave;
slave start;
SHOW SLAVE STATUS\G;
重新与主机同步即可。
相关文章推荐
- 大数据实验增加,导致虚拟机的根目录/ 磁盘空间不够,会带来各种问题, 使用gpated工具解决!!
- mysql中的ERROR 1146 (42S02)问题解决方案(主从服务器数据同步引起)
- MYSQL 主从 同步问题解决方案
- mysql-bin日志文件过大导致磁盘空间不足问题解决方法
- 解决mysql开启GTID主从同步出现1236错误问题
- mysql主从同步失败Last_IO_Error: Got fatal error 1236 from master解决方法
- 记录一次Mysql主从不同步事故问题于事故解决办法
- Win10由于服务主机本地系统进程导致磁盘占用很高的问题的解决
- 解决MySQL主从不同步问题
- 解决mysql无法插入中文数据及插入后显示乱码的问题【亲测图文解说!】
- 减少mysql主从数据同步延迟问题的详解
- 维度用法设置不当导致的数据无法正确聚合的问题及解决
- MySql主从配置文件问题详解(数据不同步解决方案)
- mysql主从库不同步问题解决方法
- ubuntu下磁盘空间不足导致mysql无法启动的解决方法
- 解决mysql无法插入中文数据及插入后显示乱码的问题【亲测 图文解说!】
- MySQL主从数据库同步延迟问题解决(转)
- HttpWebResponse无法准确获取CharacterSet导致网页数据乱码问题的解决
- 减少mysql主从数据同步延迟问题的详解
- MySQL Master/Slave 主从数据同步