MySQL級聯複製配置

來源:互聯網
上載者:User

標籤: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級聯複製配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.