ADMIN [SET|SHOW|UNSET] BDR ROLE
- Use
ADMIN SET BDR ROLEto set the BDR role of the cluster. Currently, you can set the following BDR roles for a TiDB cluster:PRIMARYandSECONDARY. For more information about BDR roles, see DDL Synchronization in TiCDC Bidirectional Replication. - Use
ADMIN SHOW BDR ROLEto show the BDR role of the cluster. - Use
ADMIN UNSET BDR ROLEto unset the BDR role of the cluster.
Synopsis
- AdminShowBDRRoleStmt
- AdminSetBDRRoleStmt
- AdminUnsetBDRRoleStmt
Examples
By default, a TiDB cluster has no BDR role. Run the following command to show the BDR role of the cluster.
ADMIN SHOW BDR ROLE;+------------+
| BDR_ROLE |
+------------+
| |
+------------+
1 row in set (0.01 sec)Run the following command to set the BDR role to PRIMARY.
ADMIN SET BDR ROLE PRIMARY;Query OK, 0 rows affected (0.01 sec)ADMIN SHOW BDR ROLE;
+----------+
| BDR_ROLE |
+----------+
| primary |
+----------+
1 row in set (0.00 sec)Run the following command to unset the BDR role of the cluster.
ADMIN UNSET BDR ROLE;Query OK, 0 rows affected (0.01 sec)ADMIN SHOW BDR ROLE;
+----------+
| BDR_ROLE |
+----------+
| |
+----------+
1 row in set (0.01 sec)MySQL compatibility
This statement is a TiDB extension to MySQL syntax.