mysql interview question 14: Tell me what is full synchronous replication in MySQL? The underlying implementation?

Insert image description here

This article focuses on interviews. In interviews, you only need to answer the key points. You do not need to have a very in-depth answer to the framework. If you want to cope with the interview, it is enough. Grasp the key points.

Interviewer: Tell me what is full synchronous replication in MySQL? The underlying implementation?

Fully synchronous replication (Synchronous Replication) in MySQL is a replication mode. After the write operation is completed, the master server must wait for confirmation from at least one slave server before returning a successful confirmation of the write operation to the client. This ensures data consistency between the primary and secondary servers.

The following are the specific implementation steps and related commands for full synchronous replication:

  1. Configure the master server:

    In the master server's configuration file, set the following parameters to enable full synchronous replication:

    sync_binlog = 1
    
  2. Configure the slave server:

    In the configuration file of the slave server, set the following parameters to enable full synchronous replication:

    relay_log_info_repository = TABLE
    sync_relay_log = 1
    
  3. Start the main server:

    Start the master server and ensure data is written to the binary log:

    SET GLOBAL

Guess you like

Origin blog.csdn.net/qq_27471405/article/details/133563719