简体   繁体   English

关闭从属服务器后,percona复制错误

[英]percona replication error after shutting down the slave

We had a shutdown on slave server (at 13:47) and after that slave does not follow the master. 我们关闭了从服务器(在13:47),此后从服务器不再跟随主服务器。 I have all the data until the shutdown in the slave server. 我拥有所有数据,直到从属服务器关闭为止。

Here is the slave: 这是奴隶:

mysql> show slave status \G <br>
*************************** 1. row ***************************<br>
              Master_Host: 192.168.0.56<br>
          Master_Log_File: mysql-bin.000226<br>
      Read_Master_Log_Pos: 695831819<br>
           Relay_Log_File: mysql-relay-bin.000001<br>
            Relay_Log_Pos: 4<br>
    Relay_Master_Log_File: mysql-bin.000226<br>
         Slave_IO_Running: No<br>
        Slave_SQL_Running: Yes<br>
      Exec_Master_Log_Pos: 695831819<br>
          Relay_Log_Space: 120<br>
            Last_IO_Errno: 1236<br>
            Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'<br>
  Last_IO_Error_Timestamp: 150709 14:26:07<br>

It seems slave receives the logs. 似乎奴隶收到了日志。
Actually we have "Master with Relay Slave" replication and the slave itself act as master for another slave. 实际上,我们具有“带有中继从站的主站”复制,并且从站本身充当另一个从站的主站。

How long was your slave shut down? 您的奴隶关闭了多长时间? This error message: 此错误信息:

Could not find first log file name in binary log index file

means that the slave asked the master for binary log file mysql-bin.000226 and the master replied "Sorry, I don't know about that file anymore." 表示从服务器向主服务器询问二进制日志文件mysql-bin.000226 ,而主服务器回答“抱歉,我不再知道该文件了。”

On you master type this: SHOW BINARY LOGS; 在您的主服务器上键入以下命令: SHOW BINARY LOGS; Do you see the log file the slave is asking for? 您是否看到从站正在请求的日志文件? If not and you see others, then someone or some script removed it. 如果没有,您看到其他人,则有人或某些脚本将其删除。

In any case, you either need to restore that binary log to the master (from a backup) or you will need to re-initialize your slave from the master using Percona XtraBackup. 无论如何,您要么需要将该二进制日志还原到主数据库(从备份),要么需要使用Percona XtraBackup从主数据库重新初始化从属服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM