免费注册 查看新帖 |

Chinaunix

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

同步表出现的一个奇怪问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-02-24 18:03 |只看该作者 |倒序浏览
做表同步,失败了,错误日志里什么错误信息都没有,主从上的状态也都正常,但就是数据没同步更新,大家帮忙看下,到底问题出在哪里,THX。

从服务器:

mysql> show slave status\G
*************************** 1. row ***************************
             Slave_IO_State: Waiting for master to send event
                Master_Host: 192.168.0.100
                Master_User: repl
                Master_Port: 3306
              Connect_Retry: 10
            Master_Log_File: mysql-bin.000001
        Read_Master_Log_Pos: 34225
             Relay_Log_File: localhost-relay-bin.000003
              Relay_Log_Pos: 10496
      Relay_Master_Log_File: mysql-bin.000001
           Slave_IO_Running: Yes
          Slave_SQL_Running: Yes
            Replicate_Do_DB: test2
        Replicate_Ignore_DB:
         Replicate_Do_Table: test1.test1
     Replicate_Ignore_Table:
    Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
                 Last_Errno: 0
                 Last_Error:
               Skip_Counter: 0
        Exec_Master_Log_Pos: 34225
            Relay_Log_Space: 10496
            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)

主服务器:

mysql> show master status\G
*************************** 1. row ***************************
            File: mysql-bin.000001
        Position: 34225
    Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)

论坛徽章:
0
2 [报告]
发表于 2008-02-24 18:04 |只看该作者
从服务器my.cnf

server-id = 3
master-user = repl
master-password = test
master-port = 3306

replicate-do-table=test1.test1
replicate-do-db=test2

master-connect-retry = 10
#log-bin=

论坛徽章:
0
3 [报告]
发表于 2008-02-24 18:05 |只看该作者
主服务器my.cnf

server-id = 1
#log-bin =

论坛徽章:
0
4 [报告]
发表于 2008-02-24 18:07 |只看该作者
主服务器*.err

080224 16:14:38  mysqld started
080224 16:14:39  InnoDB: Started; log sequence number 0 2653316938
080224 16:14:39 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.0.26-max-log'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Edition - Experimental (GPL)


从服务器*.err

080224 17:34:45 [Note] Slave I/O thread killed while reading event
080224 17:34:45 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000001', position 23964
080224 17:34:45 [Note] Error reading relay log event: slave SQL thread was killed
080224 17:34:48 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000001' at position 23964, relay log './localhost-relay-bin.000002' position: 24101
080224 17:34:48 [Note] Slave I/O thread: connected to master 'repl@192.168.0.100:3306',  replication started in log 'mysql-bin.000001' at position 23964

论坛徽章:
0
5 [报告]
发表于 2008-02-24 18:12 |只看该作者
replicate-do-db=test2

去掉,或者改成 replicate-do-db=test1 即可

其他状态正常

论坛徽章:
0
6 [报告]
发表于 2008-02-25 08:32 |只看该作者
原帖由 showsa 于 2008-2-24 18:12 发表
replicate-do-db=test2

去掉,或者改成 replicate-do-db=test1 即可

其他状态正常



乱盖嘛

论坛徽章:
0
7 [报告]
发表于 2008-02-25 11:41 |只看该作者
找到原因了,表同步和库同步一起做似乎不支持

replicate-do-table=test1.test1
replicate-do-db=test2

改成

replicate-do-db=test1
replicate-do-db=test2

或者

replicate-do-table=test1.test1
replicate-do-table=test2.test2

就行了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP