"Master: 10.142.132.52 mysql configuration file"
[Mysqld]
Datadir=/app/mysql/data
Socket =/app/mysql/data/mysql.sock
Lower_case_table_names=1
Character-set-server=utf8
Collation-server=utf8_general_ci
server_id =1
wait_timeout=360000
Log-bin=binlog
Log-bin-index=binlog.index
Log_slave_updates=1
Sync-binlog = 1
Auto_increment_offset = 2
Auto_increment_increment = 2
[Client]
#default-character-set=utf8
[Mysql.server]
User=mysql
Basedir=/app/mysql
Default-character-set=utf8
[Mysqld_safe]
Err-log=/app/mysql/errlog/mysqld.log
"MySQL config file from 1:10.142.132.51"
[Mysqld]
Datadir=/app/mysql/data
Socket =/app/mysql/data/mysql.sock
Lower_case_table_names=1
Character-set-server=utf8
Collation-server=utf8_general_ci
Relay_log_purge=0
server_id =2
wait_timeout=360000
Log-bin=binlog
Log-bin-index=binlog.index
Log_slave_updates=1
Sync-binlog = 1
Auto_increment_offset = 1
Auto_increment_increment = 2
[Client]
#default-character-set=utf8
[Mysql.server]
User=mysql
Basedir=/app/mysql
Default-character-set=utf8
[Mysqld_safe]
Err-log=/app/mysql/errlog/mysqld.log
"MySQL config file from 2:10.142.132.48"
[Mysqld]
Datadir=/app/mysql/data
Socket =/app/mysql/data/mysql.sock
Lower_case_table_names=1
Character-set-server=utf8
Collation-server=utf8_general_ci
Read_only=1
Relay_log_purge=0
server_id = 3
Relay_log =/app/mysql/mysql-relay-bin
Relay_log_index=/app/mysql/mysql-relay-bin.index
wait_timeout=360000
[Client]
#default-character-set=utf8
Socket =/app/mysql/data/mysql.sock
[Mysql.server]
User=mysql
Basedir=/app/mysql
Default-character-set=utf8
[Mysqld_safe]
Err-log=/app/mysql/errlog/mysqld.log
"MySQL config file from 3:10.142.132.47"
[Mysqld]
Datadir=/app/mysql/data
Socket =/app/mysql/data/mysql.sock
Lower_case_table_names=1
Character-set-server=utf8
Collation-server=utf8_general_ci
Read_only=1
Relay_log_purge=0
server_id = 4
Relay_log =/app/mysql/mysql-relay-bin
Relay_log_index=/app/mysql/mysql-relay-bin.index
wait_timeout=360000
[Client]
#default-character-set=utf8
[Mysql.server]
User=mysql
Basedir=/app/mysql
Default-character-set=utf8
[Mysqld_safe]
Err-log=/app/mysql/errlog/mysqld.log
AB replication
"Main Library"
mysql> GRANT replication Slave on * * to ' Lipengfei ' @ ' percent ' identified by ' Lipengfei ';
Mysql> Show Master Status\g;
1. Row ***************************
file:binlog.000001
position:120
binlog_do_db:
binlog_ignore_db:
Executed_gtid_set:
1 row in Set (0.00 sec)
"All from Library"
mysql> Change Master to master_host= ' 10.142.132.52 ', master_port=3306, master_user= ' Lipengfei ', master_password= ' Lipengfei ', master_log_file= ' binlog.000001 ', master_log_pos=120;
mysql> start slave;
This article is from "Allen Lee Oracle" blog, please make sure to keep this source http://lipengfei666666.blog.51cto.com/6384154/1613945
MYSQL-MHA Pre-release environment architecture share (iii) AB replication