MySQL級聯復制配置
環境:
10.0.0.51/172.16.1.51 mysql01 主庫 CentOS 7.2
10.0.0.52/172.16.1.52 mysql02 中繼從庫 CentOS 7.2
10.0.0.53/172.16.1.53 mysql03 從庫 CentOS 7.2
mysql01配置:
[mysqld]
bind-address = 172.16.1.51
innodb_buffer_pool_size = 512M
log_bin=/application/mysql/logs/mysql-bin
server_id = 1
character-set-server=utf8
key_buffer_size = 16M
basedir = /application/mysql
datadir = /application/mysql/data/
slow-query-log = ON
log_queries_not_using_indexes = ON
slow-query-log-file = /application/mysql/slow.log
min_examined_row_limit = 800
innodb_flush_log_at_trx_commit=2
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error = /application/mysql/logs/oldboy.err
mysql02配置:
[mysqld]
bind-address = 172.16.1.52
innodb_buffer_pool_size = 512M
expire_logs_days=7
log-slave-updates=1
log_bin=/application/mysql/logs/mysql-bin
server_id = 2
slave-skip-errors = 1032,1062,1007
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
log-error = /application/mysql/logs/oldboy.err
mysql03配置:
[mysqld]
bind-address = 172.16.1.53
server_id = 3
innodb_buffer_pool_size = 512M
slave-skip-errors = 1032,1062,1007
log_bin = /application/mysql/logs/oldboy-bin
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error = /application/mysql/logs/oldboy.err
註意:
mysql02也要配置binlog,不然,mysql03上會報:
2017-10-25 19:21:20 2352 [ERROR] Error reading packet from server: Binary log is not open (server_errno=1236)
2017-10-25 19:21:20 2352 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: ‘Binary log is not open‘, Error_code: 1236
2017-10-25 19:21:20 2352 [Note] Slave I/O thread exiting, read up to log ‘mysql-bin.000001‘, position 120
這樣的錯誤。
本文出自 “小胖子的博客” 博客,請務必保留此出處http://4044619.blog.51cto.com/4034619/1975951
MySQL級聯復制配置