【问题标题】:My MySQL Slave server has stopped replicating its' Master我的 MySQL 从服务器已停止复制其主服务器
【发布时间】:2011-12-10 19:49:20
【问题描述】:

我有一个备份服务器来复制我的生产服务器的 mysql 数据库,不久前我用相同的 php 脚本设置了一个登台服务器,唯一的区别是我给它一个只读的 mysql 用户,所以它不能对数据库,并且只能从中读取。我不确定它是否与此有关,但今天我看到备份已停止工作,并且出现以下错误:

Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position'

以下是 maser 的输出:

  File: mysql-bin.000208
        Position: 24383202
    Binlog_Do_DB: sexxymofo
Binlog_Ignore_DB:

和奴隶:

Slave_IO_State:
                  Master_Host: 184.168.76.5
                  Master_User: repl
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000193
          Read_Master_Log_Pos: 54442531
               Relay_Log_File: mysqld-relay-bin.000155
                Relay_Log_Pos: 54442676
        Relay_Master_Log_File: mysql-bin.000193
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB: sexxymofo
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 54442531
              Relay_Log_Space: 54442875
              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'
               Last_SQL_Errno: 0
               Last_SQL_Error:

如您所见,奴隶已经领先于主人并处于不存在的位置,有人可以帮忙吗?我可能会重新启动该过程,但我想确保它不会再次发生。

【问题讨论】:

    标签: mysql database-replication mysql-backup


    【解决方案1】:

    位置是 在文件中的位置,所以从服务器在文件 mysql-bin.000193 上,而主服务器已经在 mysql-bin.000208 上。

    这种设置不可能是主服务器清除了文件 mysql-bin.000193 并且由于从服务器没有运行 IO,所以该文件没有被传输。

    【讨论】:

    • 重启复制过程?你是对的,文件 mysql-bin.000210 是 master 保存的最后一个日志!
    • “正确”的做法是从主服务器进行新的转储并将其加载到从服务器并启动它。如果您有足够小的数据集并且可以忍受较短的停机时间,那么这很容易做到。
    猜你喜欢
    • 1970-01-01
    • 2013-05-26
    • 1970-01-01
    • 2016-09-29
    • 1970-01-01
    • 2015-06-07
    • 2014-01-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多