MySQL master-slave replication asynchronous semi-sync instance
MySQL master-slave replication asynchronous semi-sync instance
Create mysql Replication
Node1:
Mysql> show master status;
+ ------------------ + ---------- + -------------- + -------------------- + ------------------- +
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+ ------------------ + ---------- + -------------- + -------------------- + ------------------- +
| Mysql-bin.000003 | 120 |
+ ------------------ + ---------- + -------------- + -------------------- + ------------------- +
1 row in set (0.00 sec)
Mysql>
Node2:
Mysql> change master to master_host = '2017. 168.56.102 ', master_user = 'qwer', master_password = 'system', master_log_file = 'mysql-bin.000003 ', master_log_pos = 120, master_port = 3306;
Query OK, 0 rows affected, 2 warnings (0.04 sec)
Mysql> start slave;
Query OK, 0 rows affected (0.03 sec)
Mysql> show slave status \ G
* *************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.56.102
Master_User: qwer
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 120
Relay_Log_File: node2-relay-bin.000002
Relay_Log_Pos: 283
Relay_Master_Log_File: mysql-bin.000003
Slave_IO_Running: Yes
Slave_ SQL _Running: Yes
Replicate_Do_DB: tongs
2. Load the plug-in
Node1:
Mysql> install plugin rpl_semi_sync_master soname 'semisync _ master. so ';
Mysql> set global rpl_semi_sync_master_enabled = 1; -- enable semi-sync
Mysql> set global rpl_semi_sync_master_timeout = 1000; -- 1000 milliseconds for semi-sync
Node2:
Mysql> install plugin rpl_semi_sync_slave soname 'semisync _ slave. so ';
Mysql> set global rpl_semi_sync_slave_enabled = 1;
3. view the status
Node1:
Mysql> show variables like '% rpl _ % ';
+ ------------------------------------------- + ------------ +
| Variable_name | Value |
+ ------------------------------------------- + ------------ +
| Rpl_semi_sync_master_enabled | ON |
| Rpl_semi_sync_master_timeout | 1000 |
| Rpl_semi_sync_master_trace_level | 32 |
| Rpl_semi_sync_master_wait_for_slave_count | 1 |
| Rpl_semi_sync_master_wait_no_slave | ON |
| Rpl_semi_sync_master_wait_point | AFTER_SYNC |
| Rpl_stop_slave_timeout | 31536000 |
+ ------------------------------------------- + ------------ +
7 rows in set (0.00 sec)
Mysql>
Node2:
Mysql> show variables like '% rpl _ % ';
+ --------------------------------- + ---------- +
| Variable_name | Value |
+ --------------------------------- + ---------- +
| Rpl_semi_sync_slave_enabled | ON |
| Rpl_semi_sync_slave_trace_level | 32 |
| Rpl_stop_slave_timeout | 31536000 |
+ --------------------------------- + ---------- +
3 rows in set (0.00 sec)
Mysql>
Load Nginx in Ubuntu for high-performance WEB Server 5 --- MySQL master/Master Synchronization
Production Environment MySQL master/Master synchronization primary key conflict handling
MySQL Master/Slave failure error Got fatal error 1236
MySQL master-slave replication, implemented on a single server
Build a MySQL proxy server for read/write splitting + Master/Slave Synchronization
MySQL 5.5 master-slave bidirectional Synchronization
MySQL 5.5 master-slave synchronization troubleshooting
This article permanently updates the link address: