我在主服务器和从服务器之间设置了
mysql gtid复制.有趣的是,我发现复制在几分钟后停止工作,我必须使用stop slave并启动slave来重启mysql复制.谁能告诉我是什么原因导致这个问题?
改变奴隶主:
mysql> change master to
-> master_host = 'master.com',
-> master_user = 'replica',
-> master_password = 'password',
-> master_port = 3306,
-> MASTER_CONNECT_RETRY = 5,
-> MASTER_RETRY_COUNT = 0,
-> MASTER_AUTO_POSITION=1;
主配置文件:
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /data/mysql_data
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
binlog-format = MIXED
interactive_timeout=180
wait_timeout=180
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover = BACKUP
max_connections = 300
query_cache_limit = 1M
query_cache_size = 16M
general_log = 1
log_error = /var/log/mysql/error.log
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
log_bin_trust_function_creators = 1
log-slave-updates = true
# enable GTID
gtid-mode = on
enforce-gtid-consistency = true
master-info-repository=TABLE
relay-log-info-repository=TABLE
sync-master-info=1
binlog-checksum=CRC32
master-verify-checksum=1
expire_logs_days = 10
max_binlog_size = 100M
奴隶配置:
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /data/mysql_data
tmpdir = /data/mysql_data/tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
binlog-format = MIXED
interactive_timeout=180
wait_timeout=180
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover = BACKUP
max_connections = 100
query_cache_limit = 1M
query_cache_size = 16M
general_log = 1
log_error = /var/log/mysql/error.log
server-id = 2
log_bin = /var/log/mysql/mysql-bin.log
log_bin_trust_function_creators = 1
log-slave-updates = true
# enable GTID
gtid-mode = on
enforce-gtid-consistency = true
sync-master-info=1
binlog-checksum=CRC32
master-verify-checksum=1
slave-sql-verify-checksum=1
binlog-rows-query-log_events=1
expire_logs_days = 10
max_binlog_size = 100M
我没有看到显示奴隶状态有任何问题,但问题仍然在打扰我.任何帮助都会提前感谢.