Environment:
10.0.0.51/172.16.1.51 mysql01 main Repository CentOS 7.2
10.0.0.52/172.16.1.52 mysql02 relay from the library CentOS 7.2
10.0.0.53/172.16.1.53 mysql03 from the library CentOS 7.2
MYSQL01 configuration:
[Mysqld]
Bind-address = 172.16.1.51
Innodb_buffer_pool_size = 512M
Log_bin=/application/mysql/logs/mysql-bin
Expire_logs_days=7
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 configuration:
[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
[Mysqld_safe]
Log-error =/application/mysql/logs/oldboy.err
MYSQL03 configuration:
[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
Attention:
MYSQL02 also want to configure Binlog, otherwise, MYSQL03 will report:
2017-10-25 19:21:20 2352 [ERROR] Error reading packet from server: Binary log was 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 lo G 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
Such a mistake.
This article is from the "Little Fat Blog" blog, please be sure to keep this source http://4044619.blog.51cto.com/4034619/1975951
MySQL Cascade replication Configuration