码迷,mamicode.com
首页 > 数据库 > 详细

MySQL级联复制配置

时间:2017-10-25 14:21:23      阅读:264      评论:0      收藏:0      [点我收藏+]

标签: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
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配置:

[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配置:

[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级联复制配置

标签:mysql级联

原文地址:http://4044619.blog.51cto.com/4034619/1975951

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!