When a primary tenant becomes unavailable, you can perform a failover in the OceanBase Cloud Platform (OCP) console to switch a standby tenant of this primary tenant to the new primary tenant. After the failover, the original standby tenant becomes an independent primary tenant that supports read and write services, and is no longer associated with the original primary tenant.
This topic describes the failover procedure. You can choose one of the following failover methods based on the business needs:
- Method 1: Perform a failover for a specified standby tenant.
- Method 2: Perform a failover for all standby tenants in a cluster.
Method 1: Perform a failover for a specified standby tenant
You can switch a specified standby tenant to a primary tenant.
Prerequisites
The current tenant is a standby tenant in the Running state.
The primary tenant of the current standby tenant is unavailable.
Procedure
Log on to the OCP console. In the left-side navigation pane, click Tenants. On the Tenants page, select the target standby tenant.
On the page that appears, click the More icon in the upper-right corner and select Switchover from the menu.
In the dialog box that appears, click Switchover. Then, the system performs a tenant precheck and submits a task.
If the precheck or task submission fails, you can view the failure cause in the dialog box and resolve the issue.
After the task is submitted, click the task ID in the dialog box to view the task progress.
Method 2: Perform a failover for all standby tenants in a cluster
You can switch all standby tenants in a cluster to primary tenants.
Prerequisites
You have created standby tenants in the current cluster.
Procedure
Log on to the OCP console. In the left-side navigation pane, click Clusters. On the Clusters page, go to the Overview page of the cluster where the standby tenants that you want to manage reside.
Click the More icon in the upper-right corner and select Tenant Switchover from the menu.
In the dialog box that appears, select the tenants for the failover and click Switchover.
Before you perform a failover, the system checks the primary and standby tenants against the following conditions. If the check fails, you cannot perform a failover for the selected tenants.
- The primary and standby tenants belong to different clusters.
- The standby tenants are in the Running state and their primary tenants are unavailable.
- The cluster of the standby tenants is in the Running state.
Note
A failover will revoke the primary/standby relationship between the specified primary and standby tenants and forcibly switch the specified standby tenant to an independent tenant that supports read and write services. This operation is irreversible. Proceed with caution.
Click the task ID in the dialog box to view the task progress.