免费注册 查看新帖 |

Chinaunix

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

mysql双向复制问题? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-21 16:24 |只看该作者 |倒序浏览
我单向复制已经成功,然后我启动双向复制之后,在从服务器上用show master status;显示为空,而主服务器上的日志为:
081020 21:21:34 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.45-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
081020 21:21:34 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log '/var/run/mysqld/mysqld-relay-bin.000005' position: 98
081020 21:21:34 [Note] Slave I/O thread: connected to master 'bakup@192.168.0.85:3306',  replication started in log 'FIRST' at position 4
081020 21:21:34 [ERROR] Error reading packet from server: Binary log is not open ( server_errno=1236)
081020 21:21:34 [ERROR] Got fatal error 1236: 'Binary log is not open' from master when reading data from binary log
081020 21:21:34 [Note] Slave I/O thread exiting, read up to log 'FIRST', position 4


主服务器的配置文件:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
skip-innodb
server-id=1
log-bin=/var/run/mysqld/mysqld-bin
binlog-do-db=test
#relay-log
master-host=192.168.0.85
master-user=bakup
master-password=000000
master-port=3306
replicate-do-db=sc
master-connect-retry=10
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
sync-binlog=1
old_passwords=1

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


从服务器的配置文件:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
skip-innodb
server-id=2
master-host=192.168.0.86
master-user=bakup
master-password=000000
master-port=3306
master-connect-retry=10
replicate-do-db=test
binlog-do-db=sc
relay-log
log-bin
sync-binlog=1
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

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


也就说从服务器的master功能并没有启动起来!!请高手指点一下

论坛徽章:
0
2 [报告]
发表于 2008-10-22 07:49 |只看该作者

论坛徽章:
0
3 [报告]
发表于 2008-10-22 10:52 |只看该作者
做双击互备,如果互备的是同一个数据库,两台同时都写,那不会发生冲突啊!如果只有一台写!那做双击互备也没什么意义啊,只做单向复制就行了啊!
我采取的是这种方案!版主大人看看,看可行不可行:
两台服务器A  B  ,B复制A是test数据库,A复制B是bakup数据库,在A上面读写的是test数据库,而在B上面读写的是bakup服务器,这样是不是可以避免冲突问题啊!或者表自增字段问题啊!请指点一下???
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP