Replication

Features

  • Compatible with MySQL Binlog file format and Dump protocol. The global Binlog of PolarDB-X is generated based on the physical Binlog of the DN node, removing the details of distributed transactions and retaining only the characteristics of single-node transactions. At the same time, the global Binlog is compatible with the MySQL Binlog file format, and the data subscription method is also fully compatible with the MySQL Dump protocol. This means that you can subscribe to the binlog of PolarDB-X just like you would with a single-node MySQL database.

  • Ensures the integrity and orderliness of distributed transactions. The global Binlog does not simply aggregate the physical Binlog files, but ensures the integrity and orderliness of distributed transactions through merging and sorting, thereby achieving high data consistency. For example, in a transfer scenario, downstream MySQL that accesses PolarDB-X can query a consistent balance at any time, thanks to the capability offered by the global Binlog.

  • Provides 7x24 service capability and simple operation and maintenance. The global Binlog removes the internal details of PolarDB-X (at this time, you can regard PolarDB-X as a single-node MySQL) to avoid the impact of changes that occur internally in the instance on the data subscription link. PolarDB-X ensures the service capability of the global Binlog through a series of protocols and algorithms, ensuring that various changes that occur internally in the instance (such as HA switchover, node addition or deletion, execution of Scale Out, or distributed DDL operations) will not affect the normal operation of the data subscription link.

Usage limitations

  • Data subscription methods under the Gtid (Global Transaction Identifier) mode are not supported at this time.

  • Merging of distributed transactions is supported only when the transaction strategy is specified as TSO (that is, a higher level of consistency guarantee).

SQL statements supported by data subscription source ends

Note: Executing the following SQL statements requires SUPER or REPLICATION CLIENT permissions. For permission operations, please refer to Account and Permission System.

  • View PolarDB-X global Binlog file list.

    SHOW BINARY LOGS
    
  • View the Binlog information of PolarDB-X as the primary master role.

    SHOW MASTER STATUS
    
  • View specific event information in the global Binlog file.

    SHOW BINLOG EVENTS
    [IN 'log_name']
    [FROM pos]
    [LIMIT [offset,] row_count]
    

SQL statements supported by the data subscription target end

If the data subscription target end is standard MySQL, the Replicate command of MySQL is currently supported.

  • Set the source end data source information that needs to be synchronized at the data subscription target end.

    CHANGE MASTER TO option [, option] ... [ channel_option ]
    option: {
        MASTER_BIND = 'interface_name'
      | MASTER_HOST = 'host_name'
      | MASTER_USER = 'user_name'
      | MASTER_PASSWORD = 'password'
      | MASTER_PORT = port_num
      | PRIVILEGE_CHECKS_USER = {'account' | NULL}
      | REQUIRE_ROW_FORMAT = {0|1}
      | REQUIRE_TABLE_PRIMARY_KEY_CHECK = {STREAM | ON | OFF}
      | ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS = {OFF | LOCAL | uuid}
      | MASTER_LOG_FILE = 'source_log_name'
      | MASTER_LOG_POS = source_log_pos
      | MASTER_AUTO_POSITION = {0|1}
      | RELAY_LOG_FILE = 'relay_log_name'
      | RELAY_LOG_POS = relay_log_pos
      | MASTER_HEARTBEAT_PERIOD = interval
      | MASTER_CONNECT_RETRY = interval
      | MASTER_RETRY_COUNT = count
      | SOURCE_CONNECTION_AUTO_FAILOVER = {0|1}
      | MASTER_DELAY = interval
      | MASTER_COMPRESSION_ALGORITHMS = 'value'
      | MASTER_ZSTD_COMPRESSION_LEVEL = level
      | MASTER_SSL = {0|1}
      | MASTER_SSL_CA = 'ca_file_name'
      | MASTER_SSL_CAPATH = 'ca_directory_name'
      | MASTER_SSL_CERT = 'cert_file_name'
      | MASTER_SSL_CRL = 'crl_file_name'
      | MASTER_SSL_CRLPATH = 'crl_directory_name'
      | MASTER_SSL_KEY = 'key_file_name'
      | MASTER_SSL_CIPHER = 'cipher_list'
      | MASTER_SSL_VERIFY_SERVER_CERT = {0|1}
      | MASTER_TLS_VERSION = 'protocol_list'
      | MASTER_TLS_CIPHERSUITES = 'ciphersuite_list'
      | MASTER_PUBLIC_KEY_PATH = 'key_file_name'
      | GET_MASTER_PUBLIC_KEY = {0|1}
      | NETWORK_NAMESPACE = 'namespace'
      | IGNORE_SERVER_IDS = (server_id_list)
    }
    channel_option:
        FOR CHANNEL channel
    server_id_list:
        [server_id [, server_id] ... ]
    
  • Start the master-slave synchronization

    START {SLAVE | REPLICA}
    
  • Stop the master-slave synchronization

    STOP {SLAVE | REPLICA}
    
  • Reset the master-slave synchronization, which requires stopping the master-slave synchronization first

    RESET {SLAVE | REPLICA} [ALL] [channel_option]
    channel_option:
        FOR CHANNEL channel
    

Note: If the target end is PolarDB-X, the relevant Replicate command is currently not supported.

results matching ""

    No results matching ""