我正在尝试将mysql master master复制设置为 https://www.digitalocean.com/community/tutorials/how-to-set-up-mysql-master-master-replication
我的两个服务器配置。
服务器C:
ubuntu version mysql /etc/mysql/my.cnf
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = example
auto-increment-increment = 2
服务器D:
centos /etc/my.cnf
server-id = 2
log_bin = mysql-bin
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = example
auto-increment-increment = 2
auto-increment-offset = 2
我配置了这个并按照链接中提到的帖子。
我只能从服务器C复制到D. D到C不起作用
服务器D
stop slave;
CHANGE MASTER TO MASTER_HOST = '192.168.0.203', MASTER_USER = 'hopereplicate', MASTER_PASSWORD = 'password', MASTER_LOG_FILE = 'mysql-bin.000002', MASTER_LOG_POS = 107;
start slave;
SERVER C
stop slave;
CHANGE MASTER TO MASTER_HOST = '192.168.0.205', MASTER_USER = 'hopereplicate', MASTER_PASSWORD = 'password', MASTER_LOG_FILE = 'mysql-bin.000008', MASTER_LOG_POS = 311;
strat slave;
请帮忙吗?
Error log on Server D.
2016-12-14T07:19:36.888867Z 0 [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 '--r$
2016-12-14T07:19:36.980635Z 1 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PA$
2016-12-14T07:19:36.980976Z 1 [Note] Slave I/O thread for channel '': connected to master 'hopereplicate@192.168.0.203:3306',replication started in log 'mysql-bin.000231' at position 1720
2016-12-14T07:19:36.981192Z 1 [Warning] Slave I/O for channel '': Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error: Unknown system variable 'binlog_checksum', E$
2016-12-14T07:19:36.981248Z 1 [Warning] Slave I/O for channel '': Unknown system variable 'SERVER_UUID' on master. A probable cause is that the variable is not supported on the master (version: 5.5.53-0u$
2016-12-14T07:19:36.983493Z 0 [Note] Event Scheduler: Loaded 0 events
2016-12-14T07:19:36.983572Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.16-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2016-12-14T07:19:36.988889Z 2 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0
2016-12-14T07:19:37.159916Z 2 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000231' at position 1720, relay log './server05-relay-bin.000002' position:$
2016-12-14T07:19:55.186781Z 2 [Note] Error reading relay log event for channel '': slave SQL thread was killed
2016-12-14T07:19:55.208979Z 1 [Note] Slave I/O thread killed while reading event for channel ''
2016-12-14T07:19:55.208999Z 1 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000231', position 1720
2016-12-14T07:24:10.481707Z 5 [Warning] IP address '192.168.0.203' could not be resolved: Name or service not known
2016-12-14T07:24:10.484472Z 5 [Note] Start binlog_dump to master_thread_id(5) slave_server(1), pos(mysql-bin.000007, 154)
2016-12-14T07:24:10.484491Z 5 [Warning] Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them
2016-12-14T07:25:25.669710Z 4 [Note] 'CHANGE MASTER TO FOR CHANNEL '' executed'. Previous state master_host='192.168.0.203', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New $
2016-12-14T07:25:34.553928Z 6 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PA$
2016-12-14T07:25:34.563892Z 7 [Warning] Slave SQL for channel '': If a crash happens this configuration does not guarantee that the relay log info will be consistent, Error_code: 0
2016-12-14T07:25:34.563921Z 7 [Note] Slave SQL thread for channel '' initialized, starting replication in log 'mysql-bin.000002' at position 107, relay log './server05-relay-bin.000001' position: 4
2016-12-14T07:25:34.749727Z 6 [Note] Slave I/O thread for channel '': connected to master 'hopereplicate@192.168.0.203:3306',replication started in log 'mysql-bin.000002' at position 107
2016-12-14T07:25:34.749962Z 6 [Warning] Slave I/O for channel '': Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error: Unknown system variable 'binlog_checksum', E$
2016-12-14T07:25:34.750009Z 6 [Warning] Slave I/O for channel '': Unknown system variable 'SERVER_UUID' on master. A probable cause is that the variable is not supported on the master (version: 5.5.53-0u$
2016-12-14T07:26:26.348302Z 8 [Note] Start binlog_dump to master_thread_id(8) slave_server(1), pos(mysql-bin.000008, 311)
2016-12-14T07:26:26.348326Z 8 [Warning] Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them
2016-12-14T07:47:15.388940Z 0 [Note] Giving 2 client threads a chance to die gracefully
2016-12-14T07:47:15.388957Z 0 [Note] Shutting down slave threads
2016-12-14T07:47:15.388973Z 7 [Note] Error reading relay log event for channel '': slave SQL thread was killed
2016-12-14T07:47:15.437794Z 6 [Note] Slave I/O thread killed while reading event for channel ''
2016-12-14T07:47:15.437812Z 6 [Note] Slave I/O thread exiting for channel '', read up to log 'mysql-bin.000002', position 327
2016-12-14T07:47:15.446619Z 0 [Note] Forcefully disconnecting 0 remaining clients
答案 0 :(得分:2)
问题是两个版本的MySQL服务器不一样。
这创建了日志中标识的不兼容性:
[警告]通道''的从属I / O:未知的系统变量 主人上的'SERVER_UUID'。可能的原因是变量不是 在master上支持(版本:5.5.53-0u $
将服务器更新为两者都应该排除这个问题。