Mysql Slave 未更新

发布于 2024-08-24 05:00:39 字数 1292 浏览 5 评论 0原文

我已经设置了复制,一切看起来都很好,我没有错误,但数据没有被移动到从站

mysql> show slave status \G
*************************** 1. row ***************************
             Slave_IO_State: Waiting for master to send event
                Master_Host: xxxxx
                Master_User: xxxxxx
                Master_Port: xxxx
              Connect_Retry: 30
            Master_Log_File: mysql-bin.000006
        Read_Master_Log_Pos: 98
             Relay_Log_File: xxxxx-relay-bin.002649
              Relay_Log_Pos: 235
      Relay_Master_Log_File: mysql-bin.000006
           Slave_IO_Running: Yes
          Slave_SQL_Running: Yes
            Replicate_Do_DB:
        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: 98
            Relay_Log_Space: 235
            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: 0
1 row in set (0.00 sec)

I have replication set up every thing looks fine I have not errors , but the data is not being moved to the Slave

mysql> show slave status \G
*************************** 1. row ***************************
             Slave_IO_State: Waiting for master to send event
                Master_Host: xxxxx
                Master_User: xxxxxx
                Master_Port: xxxx
              Connect_Retry: 30
            Master_Log_File: mysql-bin.000006
        Read_Master_Log_Pos: 98
             Relay_Log_File: xxxxx-relay-bin.002649
              Relay_Log_Pos: 235
      Relay_Master_Log_File: mysql-bin.000006
           Slave_IO_Running: Yes
          Slave_SQL_Running: Yes
            Replicate_Do_DB:
        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: 98
            Relay_Log_Space: 235
            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: 0
1 row in set (0.00 sec)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

So要识趣 2024-08-31 05:00:39

在主数据库上运行 show master statusshow master status\G。它会给你正确的值来更新你的从站。

从您的从站状态来看,您的从站似乎已成功连接到主站并正在等待日志事件。对我来说,这意味着您的从属用户已正确设置,并且具有正确的访问权限。看起来您确实只需要同步正确的日志文件位置。

小心,因为要获得良好的同步,您可能应该停止主服务器,转储数据库,记录主日志文件位置,然后启动主服务器,在从服务器上导入数据库,最后使用正确的从服务器模式启动从服务器主日志文件位置。我已经这样做了大约 30 次,如果您不几乎完全遵循这些步骤,您将会得到一个糟糕的同步。

Run a show master status or show master status\G on the master DB. It will give you the correct values to update your slave with.

From your slave status, it looks like your slave has successfully connected to the master and is awaiting log events. To me, this means your slave user has been properly set up, and has the correct access. It really seems like you just need to sync the correct log file position.

Careful, because to get a good sync, you should probably stop the master, dump the DB, record the master log file positions, then start the master, import the DB on the slave, and finally start the slave in slave mode using the correct master log file pos. I've done this about 30 times, and if you don't follow those steps almost exactly, you will get a bad sync.

春花秋月 2024-08-31 05:00:39

可能有一些

  1. 主人不知道奴隶的问题。
  2. 从站和主站与中继日志文件不同步。

您必须将从属设备与未更新的主设备同步。然后你开始奴隶。它应该工作正常。

there could be couple of issues

  1. master did not know about slave.
  2. slave and master are not in sync with relay log file.

you have to sync the slave with master from where it did not updated. then you start slave. it should work fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文