MySQL master-slave replication asynchronous semi-sync instance

Source: Internet
Author: User

MySQL master-slave replication asynchronous semi-sync instance

MySQL master-slave replication asynchronous semi-sync instance

  1. 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:

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.