This topic describes how to perform a failover.
Scenarios
When the primary tenant becomes unavailable, you can perform a failover to switch a standby tenant to the primary role to provide services.
Prerequisites
In this topic, the standby tenant is specifically a standby tenant for which you want to perform a failover, and the primary tenant is specifically the primary tenant associated with the standby tenant. In a cascading primary/standby relationship between tenants, for example, Tenant A > Tenant B > Tenant C, both Tenant B and Tenant C are standby tenants. However, when you perform a failvover for Tenant C, Tenant C is called the standby tenant, and Tenant B is called the primary tenant.
- The primary tenant is unavailable. If the primary tenant is available, you can decouple the standby tenant from the primary tenant.
- The primary and standby tenants have been added to OceanBase Cloud Platform (OCP) for management. In multi-cluster mode, the primary and standby tenants can belong to different OCP clusters.
- The standby tenant is available, and the cluster to which the standby tenant belongs is normal.
Procedure
Log on to the OCP console.
In the left-side navigation pane, click Tenants. On the Tenants tab, select the target standby tenant.
On the page that appears, click the More icon in the upper-right corner and select Failover from the menu.
OCP displays the consistency timestamps of all standby tenants of the primary tenant. We recommend that you perform a failover for the standby tenant with the latest consistency timestamp, because it contains the latest data.
Click Failover to submit a failover task. After the task succeeds, the failover is completed.
FAQ
What are the differences between failover and decoupling in OCP?
OCP performs the following additional checks in a failover:
- Check whether the primary and standby tenants have been added to OCP for management.
- Check whether the primary tenant is unavailable. This check prevents the existence of two primary tenants after the failover, to avoid upper-layer business errors.
When you decouple a standby tenant from the primary tenant, OCP assumes that the primary tenant is available and therefore does not perform additional checks.