MYSQL-MHA Pre-release environment architecture share (iii) AB replication

Source: Internet
Author: User

"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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.