Rate This Document
Findability
Accuracy
Completeness
Readability

Querying the Deployment Mode

Query the deployment mode (asynchronous replication or semisynchronous replication) of MySQL primary-secondary replication. The deployment mode of the primary database must be the same as that of secondary databases.

  1. Ensure that the primary database is in normal state.
    1. Log in to the primary database.
      1
      /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysql.sock
      
    2. Query the status of the primary database.
      show master status;

      If values are displayed in the File and Position columns, the primary database is running properly.

    3. Query the host information of secondary databases.
      show slave hosts;

      The primary database has the host information of two secondary databases, and the Host and Port values of the secondary databases are correct.

  2. Query the deployment mode of the primary database.

    Query the value of the semisynchronous replication parameter. If the value is ON, semisynchronous replication is deployed. If the value is OFF or empty, asynchronous replication is deployed.

    show variables like '%rpl_semi_sync_master_enabled%';
  3. Ensure that secondary databases are in normal state.
    1. Log in to a secondary database.
      1
      /usr/local/mysql/bin/mysql -uroot -p123456 -S /data/mysql/run/mysql.sock
      
    2. Query the status of the secondary database.
      show slave status\G;

      If the values of the following two parameters are Yes, the secondary database is normal.

      Slave_IO_Running: Yes

      Slave_SQL_Running: Yes

  4. Query the deployment mode of the secondary database.

    Query the value of the semisynchronous replication parameter. If the value is ON, semisynchronous replication is deployed. If the value is OFF or empty, asynchronous replication is deployed.

    show variables like '%rpl_semi_sync_slave_enabled%';