MySQL雙主(master-master)+半同步(Semisync Replication)
阿新 • • 發佈:2019-02-14
1 2 3 4 5 6 7 8 9 10 |
server- id = 1
log-bin=mysql-bin # 開啟二進位制日誌功能,作為主庫時必須設定 log-slave-updates # 做為從庫時,資料庫的修改也會寫到bin-log裡
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
replicate-wild-ignore-table = mysql.%
replicate-wild-ignore-table = information_schema.%
replicate-wild-ignore-table = performance_schema.% expire_logs_days=5 # 表示自動刪除5天以前的binlog,可選
|
1 2 3 4 5 6 7 8 9 10 |
server- id = 2
log-bin=mysql-bin
log-slave-updates
binlog-ignore-db = mysql
binlog-ignore-db = information_schema
binlog-ignore-db = performance_schema
replicate-wild-ignore-table = mysql.%
replicate-wild-ignore-table = information_schema.%
replicate-wild-ignore-table = performance_schema.%
expire_logs_days=5
|
1 2 |
> GRANT REPLICATION SLAVE ON *.* TO 'repl_user' @ '172.16.4.%' IDENTIFIED |