- 论坛徽章:
- 0
|
本帖最后由 mengchang_cu 于 2012-02-29 16:33 编辑
A和B两台机器,互为master和slave,A为B的slave的同时也是B的master,B为A的master也是A的slave,其中B机器能数据能同步,但是A机器则同步不了同步时伴随如下信息:
mysql> load data from master;
Query OK, 0 rows affected, 2 warnings (0.16 sec)
mysql> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'LOAD DATA FROM MASTER' is deprecated; use 'mysqldump or future BACKUP/RESTORE DATABASE facility' instead |
| Note | 1007 | Can't create database 'test'; database exists |
+---------+------+-----------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: ********
Master_User: replication
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000050
Read_Master_Log_Pos: 98
Relay_Log_File: mysql-bin.000064
Relay_Log_Pos: 235
Relay_Master_Log_File: mysql-bin.000050
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: test
Replicate_Ignore_DB: mysql
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)
ERROR:
No query specified
看A的/var/log/mysqld.log里边看到如下报错:
[root@mysql ~]# tail -f /var/log/mysqld.log
120229 16:10:27 mysqld started
120229 16:10:30 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
120229 16:10:30 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
120229 16:10:30 [Warning] The syntax for replication startup options is deprecated and will be removed in MySQL 5.2. Please use 'CHANGE MASTER' instead.
120229 16:10:32 InnoDB: Started; log sequence number 0 43665
120229 16:10:33 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.77-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
120229 16:10:33 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000033' at position 98, relay log '/var/log/mysql/mysql-bin.000061' position: 235
120229 16:10:33 [Note] Slave I/O thread: connected to master 'replication@192.168.62.101:3306', replication started in log 'mysql-bin.000033' at position 98
120229 16:11:34 [Note] Slave I/O thread killed while reading event
120229 16:11:34 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000050', position 98
120229 16:11:34 [Note] Error reading relay log event: slave SQL thread was killed
120229 16:11:34 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000050' at position 98, relay log '/var/log/mysql/mysql-bin.000063' position: 4
120229 16:11:34 [Note] Slave I/O thread: connected to master 'replication@192.168.62.101:3306', replication started in log 'mysql-bin.000050' at position 98
120229 16:12:23 [Note] Slave I/O thread killed while reading event
120229 16:12:23 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000050', position 98
配置文件如下:
[root@mysql ~]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
pid-file=/var/run/mysqld/mysqld.pid
log-error=/var/log/mysqld.log
user=mysql
server-id=1
log-bin=/var/log/mysql/mysql-bin.log
master-connect-retry=60
replicate-do-db=test
replicate-ignore-db=mysql
binlog_do_db=test
binlog-ignore-db=mysql
max_binlog_size=1073741824
relay-log=/var/log/mysql/mysql-bin.relay
relay-log-index=/var/log/mysql/mysql-bin.relay.index
auto_increment_increment=2
auto_increment_offset=1
sync_binlog=1
log-slave-updates
#replicate-wild-ignore-table = %temp%
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
谁遇到过类似的问题,如果解决了帮忙看下怎么解决联系方式:
qq:1091262364 |
|