免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5816 | 回复: 2
打印 上一主题 下一主题

【讨论中】环状SQL同步问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-10-09 16:53 |只看该作者 |正序浏览
本帖最后由 chinafenghao 于 2013-10-11 12:32 编辑

有三台服务器A B C,需要配置为:B主A从、C主B从、A主C从,组成环状,当修改ABC中任意一台的数据库时其他两台同步,但是当我配置完后发现,在其中一台的数据库中增加一个表时,只有一台同步,另一台没有反应,比如在A添加表时,B没有反应,C同步成功,但是show slave status\G显示的状态都正常,原因找了一下午也没找出来,求大神解惑!谢谢!
A:的状态
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 10.0.3.121
                  Master_User: atb
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: log-slave-updates.000002
          Read_Master_Log_Pos: 282
               Relay_Log_File: relay-bin.000002
                Relay_Log_Pos: 435
        Relay_Master_Log_File: log-slave-updates.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: test
          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: 282
              Relay_Log_Space: 584
              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
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
1 row in set (0.00 sec)

B的状态:
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 10.0.3.125
                  Master_User: btc
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: log-slave-updates.000002
          Read_Master_Log_Pos: 106
               Relay_Log_File: relay-bin.000002
                Relay_Log_Pos: 259
        Relay_Master_Log_File: log-slave-updates.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: test
          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: 106
              Relay_Log_Space: 408
              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
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
1 row in set (0.00 sec)

C的状态:
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 10.0.3.117
                  Master_User: cta
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: log-slave-updates.000002
          Read_Master_Log_Pos: 189
               Relay_Log_File: relay-bin.000002
                Relay_Log_Pos: 342
        Relay_Master_Log_File: log-slave-updates.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: test
          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: 189
              Relay_Log_Space: 491
              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
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
1 row in set (0.00 sec)

ABC中my.cnf文件(只贴了A的,除了severid不一样其他的都一样):
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
server-id=1
replicate-do-db=test
log-bin=log-slave-updates
log-slave-updates = on
binlog-ignore-db=mysql
auto_increment_offset = 1
auto_increment_increment = 2
relay-log=relay-bin

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

论坛徽章:
0
3 [报告]
发表于 2013-10-11 12:46 |只看该作者
回复 2# chinafenghao


    终于搞明白了,配置文件中log-slave-updates = on应该写为log-slave-updates

论坛徽章:
8
CU大牛徽章
日期:2013-09-18 15:20:48CU大牛徽章
日期:2013-09-18 15:20:58CU大牛徽章
日期:2013-09-18 15:21:06CU大牛徽章
日期:2013-09-18 15:21:12CU大牛徽章
日期:2013-09-18 15:21:17天秤座
日期:2013-10-30 14:01:03摩羯座
日期:2013-11-29 18:02:31luobin
日期:2016-06-17 17:46:36
2 [报告]
发表于 2013-10-11 12:32 |只看该作者
@liyaoxinchifan
没做过闭环的,不清楚原因。
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP