免费注册 查看新帖 |

Chinaunix

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

mysql 复制报错,帮我看看.谢谢 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-01 12:30 |只看该作者 |倒序浏览
mysqld started
060301 12:01:45  InnoDB: Started; log sequence number 0 43677
060301 12:01:45 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log './lantide11-relay-bin.000001' position: 4
/usr/local/mysql/bin/mysqld: ready for connections.
Version: '4.1.15-debug-log'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Edition - Debug (GPL)
060301 12:01:45 [Note] Slave I/O thread: connected to master 'passpod@192.168.123.49:3306',  replication started in log 'FIRST' at position 4
060301 12:01:45 [ERROR] The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).
060301 12:01:45 [ERROR] Slave I/O thread exiting, read up to log 'FIRST', position 4


Slave I/O 这个是不有问题, 怎么配置,高手帮忙看看
show slave status 显示 有两个NO ,我看文档说要都为YES 才可以.这是哪里出了问题?
|                | 192.168.123.49 | passpod     |        3306 |            30 |                 |                   4 | lantide11-relay-bin.000001 |             4 |                       | No               | Yes               | passpod         |                     |                    |                        |                         |                             |          0 |            |            0 |                   0 |               4 | None            |                |             0 | No                 |                    |                    |                 |                   |                |                  NULL |


我的my.cnf文件
[client]
port            = 3306
socket          = /tmp/mysql.sock

[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin=mysql-bin
log-bin
server-id       = 2
binlog-do-db = passpod
sql-bin-update-same
master-host = 192.168.123.49
master-user = passpod
master-password = '1234'
master-port = 3306
master-connect-[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
retry = 30
replicate-do-db = passpod
log-slave-updates

[ 本帖最后由 乱数 于 2006-3-1 12:49 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-03-01 12:50 |只看该作者
另一台机器的my.cnf
[client]
port            = 3306
socket          = /tmp/mysql.sock

[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log-bin
server-id       = 1
sql-bin-update-same
binlog-do-db = passpod
master-host = 192.168.123.48
master-user = passpod
master-password = '1234'
master-port = 3306
master-connect-retry = 30
replicate-do-db=passpod
log-slave-updates

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

论坛徽章:
0
3 [报告]
发表于 2006-03-03 11:23 |只看该作者

你好象server-id = 2跟其他机器重复了

This has to be one of the most elusive problems you can encounter with MySQL replication. If you accidentally configure two slaves with the same server ID they'll appear to work just fine if you're not watching closely. But if you watch their error logs carefully or watch the master with mytop (covered in Appendix B), you'll notice something very odd.

On the master, you'll see only one of the two slaves connected at a given moment. Usually all slaves are connecting and replicating all the time. On the slave you'll see frequent disconnect/reconnect messages appearing in the error log, but none of those messages will lead you to believe that the server ID of one slave might be misconfigured.

The only real harm in this situation is that the slaves can't replicate very quickly. Because the slaves (not the master) keep track of their replication progress, there's no need to worry about giving one query to the first slave, one to the other slave, and so on. Both slaves get all the data; they just get it much more slowly.

The only solution to this problem is to be careful when setting up your slaves. If you see symptoms like this, double check the configuration of each slave to ensure that it has the server ID you expect it to. You may find it helpful to keep a master list of slave-to-server-ID mappings so that you don't lose track of which ID belongs to each slave. Consider using numeric values that have some sort of meaning in your setup, such as the last octet of each machine's IP address.

论坛徽章:
0
4 [报告]
发表于 2006-03-03 16:32 |只看该作者
mysql  默认的server id=1
你没有注释掉吧?
提示两个mysql server的server id是一样的,所以不能复制
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP