(5.4) mysql highly available asynchronous replication series --MySQL

Keywords: mysql replication, mysql asynchronous replication, mysql traditional asynchronous replication

[1] experimental environment

Operating System: CentOS linux 7.5

Database Version: 5.7.24

Database schema: copy from the master, the master for the production of library, from the library and the master library for disaster recovery data backup server, the default traditional asynchronous replication.

Main Library IP: 192.168.1.201 Port: 3306

From the library IP: 192.168.1.202 Port: 3306

[2] configured to start master-slave replication


# [2.1 ] Configuration my.cnf configuration file
Main parameters of library # 
increase primary library # Parameter 
[mysqld] 
log-error_verbosity =. 3 log_bin
= / MySQL / log / 3306 / MySQL- bin # open the binlog log_bin_index = / MySQL / log / 3306 / MySQL- bin.index binlog_format = Row binlog_rows_query_log_events = ON max_binlog_size = 2048 # the main library modify the parameters of the bind -address = 192.168 . 1.201 server_id = 2013306 expire_logs_days = 7 # binlog more than seven days of cleaning up innodb_support_xa = 1 the binlog_cache_size = 1M log_bin_trust_function_creators = . 1 # synchronization procedures, functions, triggers the innodb_flush_log_at_trx_commit = . 1 sync_binlog = . 1 Transaction -isolation = Read-The committed # parameters from the database
log. 3-error_verbosity = relay_log
= / MySQL / log / 3306 / relaylog / MySQL- relay.log log -slave-Updates = . 1 READ_ONLY = . 1 Slave -parallel-type = LOGICAL_GLOCK Slave -parallel-Workers = . 4 master_info_repository = Table relay_log_info_repository = the Table relay_log_recovery = 1 slave_skip_error = ddl_exist_errors slave_preserve_commit_order = 1

# Note After setting the parameters, we must remember to restart mysql, otherwise it will not take effect.

# [2.2] need to create an account replication traffic in the main library
the Create the User 'rpl'@'192.168.1.%' IDENTIFIED by '123456';
. * ON * Replication Grants to 'rpl'@'192.168.1.*' ;
the SELECT the User, Host from the mysql.user;
# use this account from the library to the main library login, can log on to be successful;

# [2.3] to copy account verification is successful, run from the library
mysql -u ' RPL '-p123456 -h192.168.1.201

# If not, please verify

  (1) network can ping each other

  (2) whether the port is listening on both sides open: netstat -an | grep 3306

  (3) the firewall policy: service iptables stop; (this is just a test, I'll just shut Kazakhstan)

  (4) selinux policy: getenforce (View Status) setenforce 0 (closed)

 

 

Guess you like

Origin www.cnblogs.com/gered/p/11373011.html