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 PRIMARY role. 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 either 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 the PRIMARY role.
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. In the tenant list, find the target standby tenant and click its name to go to its basic information page.
On the page that appears, click the More icon in the upper-right corner and select Failover from the menu.
In the dialog box that appears, click Failover. Then, the system performs a tenant precheck and submits the task.
If the precheck or task submission fails, you can view the cause of the failure in the dialog box that appears and perform troubleshooting accordingly.
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 the PRIMARY role.
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 Cluster List page, go to the Overview page of the target cluster.
On the page that appears, click the More icon in the upper-right corner and select Tenant Failover from the menu.
In the dialog box that appears, select the tenants for the failover and click Failover.
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 switchover for the selected tenants.
- The primary tenant and the 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.