This topic describes how to switch primary and standby instances. When the primary instance is unavailable, you can switch the standby instance to primary to take over the Binlog service.
In OCP, you can switch primary and standby instances in the following two ways:
- Method 1: Go to the Binlog Cluster Overview page. In the Binlog Instance List list, find the standby instance you want to switch and click ... > Switch in its Actions column.
- Method 2: Go to the Binlog Instance Overview page of the standby instance. Click ... > Switch in the upper-right corner.
Prerequisites
Ensure the current OCP user has the following permissions:
- The Binlog Service Maintenance resource permission.
- The Binlog Cluster Overview menu permission for the Binlog service.
The Binlog instance to be switched is a standby instance, and the corresponding Binlog cluster is in the RUNNING state.
Procedure
The following procedure uses Method 2 as an example.
Log in to OCP.
In the left navigation bar, click Binlog Service. The system goes to the Clusters page by default.
On the Clusters page, select the target Binlog cluster and click its name to go to the Binlog Cluster Overview page.
In the Binlog Instance List section, find the standby Binlog instance you want to switch and click its name.
On its Binlog Instance Overview page, click ... > Switch in the upper-right corner.
In the dialog box, select the switching method and click Switch.
- Switchover (recommended): A new connection will be created on the new primary instance, while the old connection remains on the old primary instance, without interrupting access to the old primary instance.
- Downtime Switchover: Access to the old primary instance is interrupted, causing the service to become unavailable.
You can view the task execution progress in Task Center. The switch is successful when the task status is Completed and the instance status is Running.
