Preparations
Before enabling binary logging on a PolarDB-X instance, configure the required privileges and review the feature's limitations and resource considerations.
Permission configuration
The binary logging feature of PolarDB-X follows the same privilege model as MySQL replication.
A privileged account has full access to binary logging by default. For other accounts, grant privileges based on your PolarDB-X version:
PolarDB-X V5.4.11 and later
Grant the SELECT privilege so the account can view and subscribe to binary logs:
GRANT SELECT ON *.* TO 'user'@'host';PolarDB-X V5.4.12 and later
Two separate privileges control binary log access:
Execute the following statement to obtain the REPLICATION CLIENT privilege. This allows you to query binary log metadata:
GRANT REPLICATION CLIENT ON *.* TO 'user'@'host';| Privilege | What it enables |
|---|---|
REPLICATION CLIENT | Query binary log metadata: SHOW MASTER STATUS, SHOW BINARY LOGS |
Execute the following statement to obtain the REPLICATION SLAVE privilege. This allows you to read binary log events and subscribe:
GRANT REPLICATION SLAVE ON *.* TO 'user'@'host';| Privilege | What it enables |
|---|---|
REPLICATION SLAVE | Read binary log events and subscribe: SHOW BINLOG EVENTS, CHANGE MASTER |
Limitations
The data replication feature has the following limitations:
Global transaction identifiers (GTIDs) are not supported.
Data compression is not supported for data transmission.
SSL-based data transmission is not supported.
In single-stream mode, distributed transaction merging requires the Timestamp Oracle (TSO) transaction policy.
Usage notes
Creating multiple binary log consumption links on a single PolarDB-X instance increases memory usage on the compute node. Before deploying multiple links, run a stress test under expected load to measure memory consumption, then size your compute node accordingly. For assistance with capacity planning, contact us.