MYSQL主機Master磁盤寫滿,導致主從數據無法同步各種問題解決

由於主機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;


重新與主機同步即可。







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章