LINUX.ORG.RU

Сломалась репликация MYSQL


0

0

Есть два сервера MYSQL мастер и слейв:

Сейчас начали сыпаться ошибки на мастере:
m1 mysql # tail -f /var/log/mysql/mysqld.err
InnoDB: The InnoDB memory heap is disabled
InnoDB: use atomic builtins.
091016 16:37:15 InnoDB: Started; log sequence number 0 43675
091016 16:37:16 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=mysqld-relay-bin' to avoid this problem.
091016 16:37:16 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.84-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Gentoo Linux mysql-5.0.84-r1
091016 16:37:16 [Note] Slave SQL thread initialized, starting replication in log '.000768' at position 327502125, relay log './mysqld-relay-bin.000245' position: 98
091016 16:37:16 [Note] Slave I/O thread: connected to master 'root@192.168.10.3:3306', replication started in log '.000768' at position 327502125
091016 16:37:16 [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).
091016 16:37:16 [Note] Slave I/O thread exiting, read up to log '.000768', position 327502125

Такое ощущение, что мастер пытается почему-то сам с себя реплицироваться. На нём же:

mysql> show master status \G
*************************** 1. row ***************************
File: .000849
Position: 2310293
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)

А на слейве вот такая ситуация:
mysql> show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.10.3
Master_User: slaveuser
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: .000849
Read_Master_Log_Pos: 2946124
Relay_Log_File: mysqld-relay-bin.000094
Relay_Log_Pos: 226
Relay_Master_Log_File: .000829
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error: Query caused different errors on master and slave. Error on master: 'Invalid error code' (34), Error on slave: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1' (1064). Default database: ''. Query: ''
Skip_Counter: 0
Exec_Master_Log_Pos: 345092033
Relay_Log_Space: 5002666476
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: NULL
1 row in set (0.00 sec)

091016 16:49:47 [Warning] Neither --relay-log nor --relay-log-index were used; s o replication may break when this MySQL server acts as a slave and has his hostn ame changed!! Please use '--relay-log=mysqld-relay-bin' to avoid this problem.
091016 16:49:47 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.84' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Gentoo Lin ux mysql-5.0.84-r1
091016 16:49:47 [Note] Slave SQL thread initialized, starting replication in log '.000829' at position 345092033, relay log './mysqld-relay-bin.000094' position : 226
091016 16:49:47 [ERROR] Slave: Query caused different errors on master and slave . Error on master: 'Invalid error code' (34), Error on slave: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server vers ion for the right syntax to use near '' at line 1' (1064). Default database: ''. Query: '', Error_code: 0
091016 16:49:47 [ERROR] Error running query, slave SQL thread aborted. Fix the p roblem, and restart the slave SQL thread with "SLAVE START". We stopped at log ' .000829' position 345092033
091016 16:49:47 [Note] Slave I/O thread: connected to master 'slaveuser@192.168.10.3:3306', replication started in log '.000849' at position 10792789


Re: Сломалась репликация MYSQL

091016 16:37:16 [ERROR] The slave I/O thread stops because [b]master and slave have equal MySQL server ids[/b]; 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).
drull ★☆☆☆ ()

Re: Сломалась репликация MYSQL

а на слейве:

091016 16:49:47 [Warning] Neither --relay-log nor --relay-log-index were used; s o replication may break when this MySQL server acts as a slave and has his hostn ame changed!! Please use '--relay-log=mysqld-relay-bin' to avoid this problem.

у тебя ж id мастера и слейва одинаковые

drull ★☆☆☆ ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.