OCP allows you to create associated primary and standby tenants in different clusters. When a failure occurs at the host site and the OCP cluster is switched, you can switch the standby tenant to the primary tenant, providing a physical standby database solution at the tenant level, and offering database services to external users.
In OCP, a tenant managed by another OCP cluster is called a remote tenant. When a remote tenant is displayed on the page of the current OCP cluster, it is marked with the Remote label.
Applicability
This topic applies only to OCP Enterprise Edition. OCP Community Edition does not support this feature.
Prerequisites
The current login user in OCP must have the following permissions:
- Cluster Maintenance or Tenant Maintenance permissions.
- The Overview menu permissions.
OceanBase Database V4.2 or later is supported.
The cluster where the standby tenant is to be created is in the running state.
The primary and standby OCP clusters in multi-cluster mode have been created.
The current login user has the sysadmin role, the OCP tenant admin role, or another role with the permission to manage the cluster.
If the standby tenant to be created is earlier than OceanBase Database V4.2.1.8, do not use the baseline backup data from 30 days ago to restore the physical standby tenant. Otherwise, the physical standby tenant may fail to function properly, which affects tenant compaction.
If the primary tenant is in a cluster that has enabled SSL encryption and the primary-standby synchronization method is Network-based, the cluster where the standby tenant is located must also have SSL encryption enabled, and the root certificate must be the same as that of the primary tenant's cluster.
Before you enable the arbitration service for the tenant, make sure that the following conditions are met:
The tenant's cluster has added the arbitration service, and the arbitration service is in the RUNNING state.
The tenant to which the arbitration service is to be enabled has a locality of 2F (F: full-featured replicas) or 4F.
The remaining resources on the host where the arbitration service is located meet the resource requirements.
You can modify the resource requirements based on the actual situation. For more information, see Modify a system parameter.
ocp.arbitration.min.remain.disk.size: specifies the minimum remaining disk space for the CLOG disk of the arbitration service host when the tenant arbitration service is enabled, in MB. The value in the (a,b) format indicates the values for tenants with 2F and 4F replicas respectively. The default value is [12,24].ocp.arbitration.max.cpu.used.percentage: specifies the maximum CPU usage of the arbitration service host when the tenant arbitration service is enabled, in %. The default value is 90.ocp.arbitration.max.memory.used.percentage: specifies the maximum memory usage of the arbitration service host when the tenant arbitration service is enabled, in %. The default value is 90.
Procedure
You can perform the following steps to create a backup tenant for a tenant managed by another OCP in the current OCP.
Log in to the OCP console.
Click Tenant in the left-side navigation pane to go to the Tenant page.
In the upper right corner of the page, click Create Tenant.
Fill out Basic Information.
The following table describes the basic configurations and their related information.
Configuration Description Tenant Type Select Standby Tenant. Note
When you create a standby tenant by using the Overview page of a specified tenant, you cannot specify a tenant type. The default value is standby tenant.
OCP Cluster of Primary Tenant In Multi-cluster Mode, the value must be the OCP where the primary tenant is located. Note
If you create a secondary tenant through the overview page of a specified tenant, this field is not required.
Cluster of Primary Tenant Select the cluster to which the primary tenant belongs. Note
If you create a tenant under the specified tenant on the Overview page of that tenant, the cluster will be the current cluster by default and cannot be modified.
Primary Tenant Select the master tenant to which the standby tenant belongs. Note
When you create a standby tenant on the dashboard of the tenant, the master tenant is by default the current tenant and cannot be modified.
Cluster of Standby Tenant Select the cluster to which the tenant belongs. Note
When you create a tenant through the tenant management page of the specified cluster, the default is the current cluster, and it cannot be modified.
Standby Tenant Name A standby tenant name must start with an English letter and end with an English letter or a number. The name can contain English letters, numbers, and underscores (_) and must be 2 to 32 characters long. Service Name Optional. A service name is a new method for accessing databases in OceanBase. It serves as an alias for the cluster name and tenant name, allowing applications to access databases by using the service name. For more information about service names, see Manage service names. - A service name must start with an English letter and can contain English letters, numbers, and underscores. It must be 2 to 64 characters long.
- To configure a service name for a tenant, the version must meet the following requirements:
- OceanBase Database: V4.2.1.9, [V4.2.4.0, V4.3.0.0), [V4.3.3.0, +∞).
- OBProxy: [V4.3.1.0, +∞).
Note
If you set Service Name for the primary tenant, the existing service name is automatically populated.
Primary/Standby Synchronization Method The two synchronization modes supported are Network-based Synchronization and Archiving-based. - Network-based Synchronization is to synchronize logs between OBServer nodes in RPC synchronization mode, so that the standby tenant can directly read logs of the primary tenant through
ip + port. By default, Network-based Synchronization is selected as the Active/Standby synchronization mode for tenants. - Archiving-based is to synchronize logs by using shared storage. The primary tenant writes logs to a network disk or an OSS bucket, and the standby tenant reads logs from shared storage. To configure Archiving-based as the Active/Standby synchronization mode, the current tenant must enable archiving. Otherwise, data cannot be synchronized by using archiving. For information about how to enable archiving in OCP, see Immediately back up the tenant.
Note
If a primary/standby relationship (cascading, one-to-many) already exists, the default selected Active/Standby synchronization mode is used and cannot be modified.
Load Type You can select a load type for a tenant. To avoid affecting database performance, select a load type that matches your actual workload. Specific descriptions of the supported load types are as follows: - Express OLTP: suitable for workloads such as core systems of trading and payment, and high-throughput internet applications. It has no restrictions on foreign keys. It does not involve stored procedures, long transactions, or large transactions. It does not have complex joins or subqueries.
Version restrictions: applicable to OceanBase Database V4.2.5 and later versions. - HTAP: suitable for hybrid OLAP and OLTP workloads. It is often used to obtain insights into active operations, fraud detection, and personal recommendations in real time.
Version restrictions: applicable to OceanBase Database V4.2.5 and later versions. - OLAP: suitable for real-time data warehouse analysis scenarios.
Version restrictions: applicable to OceanBase Database V4.3.0 and later versions. - Complex OLTP: suitable for workloads such as banking and insurance systems. These workloads often involve complex joins, complex correlated subqueries, batch PL jobs, long transactions, and large transactions. They also sometimes use parallel execution for queries that run for a short time.
Version restrictions: applicable to OceanBase Database V4.2.5 and later versions. - OBKV: suitable for key-value workloads and wide-column workloads that are similar to HBase. These workloads typically have very high throughput and are sensitive to latency.
Version restrictions: applicable to OceanBase Database V4.2.5 and later versions.
Note
We recommend that you select the same load type as your tenant cluster.
Fill in Restore Standby Tenant Settings to set the backup information. You can choose whether to set an independent storage directory for the standby tenant based on different use cases.
Note
If Primary/Standby Synchronization is set to Based on Network and the primary tenant has complete Redo logs, you do not need to configure Restore Standby Tenant Settings. However, you can also click Restore from Backup Set to configure the backup set information and restore the standby tenant using the backup set.
Set an independent storage directory
Applicable scenario: When you did not use the tenant backup feature of the OCP and have performed tenant backup on the command line, or you have copied external backup files of the primary tenant to a shared storage and want to restore a standby tenant using the backup files.
Configuration Description Backup Set Storage Type Select the medium for storing backup files. The value can be: - File: local file storage, generally NFS.
- OSS: Alibaba Cloud OSS object storage, supported only in OceanBase Database V2.2.76 and later.
- COS: Tencent Cloud COS object storage, supported only in OceanBase Database V2.2.76 and later, V4.0.0 earlier, or V4.2.1 and later.
- S3: compatible with the AWS S3 protocol, including native AWS S3, Huawei Cloud OBS, HUAWEI Cloud OBS, and Google GCS. It is supported only in OceanBase Database V4.2.1-BP7 and V4.2.3-BP1 (inclusive) and later. For more information about storage media that support the AWS S3 protocol, see AWS S3 protocol.
Data Backup Directory The data storage directory for backup files on the current medium. Log Backup Directory Enter the log storage directory where backup files are stored on the current media. Domain Enter the domain name for accessing the backup set on Alibaba Cloud. - When Backup Set Storage Type is set to OSS, enter the domain name for accessing backup files on Alibaba Cloud. You can add a port number to the domain name, such as
oss.ap-shanghai.myqcloud.com:8080. - When Backup Set Storage Type is set to COS, enter the domain name for accessing objects in a Tencent Cloud COS bucket. For example,
cos.ap-beijing.myqcloud.com.
User The access user of the Alibaba Cloud storage endpoint. The field is displayed when Backup Set Storage Type is set to OSS. Resource Identity (APPID) Displays only when Backup Set Storage Type is set to COS. This unique identifier from the perspective of the developer is used to access the COS service. You can obtain it in the API key management page of the corresponding service. Project ID The ID of the project owned by the developer, which can be obtained on the API key management page for the corresponding service. This ID is displayed only when Backup Set Storage Type is set to COS. Access Key When Backup Set Storage Type is OSS or COS, fill in the access user key for Alibaba Cloud or Tencent Cloud storage. Do not set an independent storage directory
Applicable scenario: Backup of the tenant has been performed using the backup restore feature in OCP. If you do not configure an independent storage directory, the system automatically fills in the relevant storage directory configurations and they cannot be modified.
Configuration Description Storage Directory The storage directory where backup files are stored on the current media. Domain Fill in the domain name of the cloud storage of the backup set. - When Backup Set Storage Type is set to OSS, enter the domain name of the object at the Alibaba Cloud storage. You can also add the port number to the end of the domain name, for example:
oss.ap-shanghai.myqcloud.com:8080. - When Backup Set Storage Type is set to COS, enter the domain name of the Tencent Cloud storage bucket where the object is stored, for example:
cos.ap-beijing.myqcloud.com.
- When Backup Set Storage Type is set to OSS, enter the domain name of the object at the Alibaba Cloud storage. You can also add the port number to the end of the domain name, for example:
Click Backup Set Verification to check whether the directory tenant in the current backup set can be accessed in the cluster where the primary tenant is located, and whether there are log missing between the maximum restorable time of the current backup set and the current main tenant's time. If the check fails, you can trace the cause and make the necessary fixes based on the error message.
Fill in Standby Tenant Replica Settings.
Note
We recommend that the specifications of a standby tenant be the same as that of the primary tenant.The default system displays a list of configurable zones based on the zones information of the selected cluster. You can click the Delete icon next to the zone whose replicas are not distributed to delete the zone. The following table describes the configurable zones and their related information.
Configure Description Replica Type Select multiple All-Purpose replicas to ensure the majority of replicas are All-Purpose. - All-Purpose Replica: A general-purpose replica that contains all complete data and features such as transaction logs, MemTables, and SSTables. It can be quickly switched to a leader to provide services as needed.
- Read-Only Replica: A replica that contains complete logs, MemTables, and SSTables. It does not serve as a member of Paxos, and instead acts as an observer that synchronizes logs from Paxos members in real time and then performs local replay.
- Log Replica: A replica that contains only logs. It does not contain MemTables or SSTables. It participates in log voting and provides log services for external applications. It can assist other replicas in recovery, but it cannot become a leader to provide database services.
- Read-Only Columnar Replica: A replica that does not participate in Paxos voting. All baseline data for user tables is stored in a columnar format. It supports only read operations and is optimized for TP-enhanced hybrid workloads (quasi-real-time decision-making analytics).
When you select this replica type, the current OceanBase cluster must be associated with at least two OBProxy clusters. This way, you can ensure that one of the OBProxy clusters is dedicated for forwarding client requests related to the columnar-only replicas. The dedicated OBProxy cluster must be V4.3.2 or later and configured with the following parameters:alter proxyconfig set route_target_replica_type='ColumnStore';alter proxyconfig set proxy_route_policy='TARGET_REPLICA_TYPE_FOLLOWER_ONLY';alter proxyconfig set init_sql='set @@ob_route_policy = COLUMN_STORE_ONLY';alter proxyconfig set obproxy_read_only=0;alter proxyconfig set obproxy_read_consistency=1;
Note
- For distributed clusters of V4.3.3 or later, Full-featured Replica, Read-only Replica, and Read-only Columnstore Replica are supported.
- For distributed clusters of V4.2.0 or later but earlier than V4.3.3, Full-featured Replica and Read-only Replica are supported.
- For distributed clusters of V4.0.0 or later but earlier than V4.2.0, only Full-featured Replica is supported.
- For distributed clusters of V3.x, Full-featured Replica, Read-only Replica, and Log Replica are supported.
- For standalone databases, only Full-featured Replica is supported.
Unit Specifications OceanBase Cloud provides a set of built-in unit specifications. You can select one from the OCP unit specifications list, or you can click Add Specification at the bottom of the list to add a custom unit specification. Notice
- It is recommended to set the same unit specification and quantity for all-in-one replicas. Different unit specifications and quantities may cause performance or stability issues.
- When the tenant cluster is V4.0.0 or later, note the following points:
- CPU cannot be configured with specifications less than 1 core.
- By default, the minimum memory specification is restricted for the cluster. You can adjust this using the
__min_full_resource_pool_memoryparameter. As an example, in a V4.1.0 cluster, you can follow the steps outlined in Modify cluster parameter.
Units The number of units specified for the zone. The number of units must not exceed the number of servers in the zone. - When you select a cluster version of V4.0 or later, the number of units can be set at the zone level. It is not allowed to set a different value for each zone. All zones share the same number of units (default value: 1).
- When you select a cluster version earlier than V4.0, different values of the number of units can be set for different zones.
Note
The default value of the number of units for a standalone server is 1, and this value cannot be changed.
Zone Priority Rankings Specifies whether to assign priority to zones for a tenant. The priority will affect the primary zone of the sys tenant. - If not specified, the tenant zone will inherit the priority from the sys tenant.
- If you enable "Zone Priority Sorting" but do not configure any zone priorities, the priority will be set to random.
- You can select one or more zones from the left list box and move them to the right list box. The left list box shows all the zones in the cluster. By default, the priority of the first selected zone is higher than that of the later selected zone. The priority of multiple selected zones is the same. After moving a zone to the right list box, you can also drag the zone to adjust the priority. The priority of a zone above another is higher than that of the zone below.
Note
Zones are not displayed in standalone mode. By default, Zone1 has the highest priority.
Enable Arbitration Service Specifies whether to enable the arbitration service for the tenant. The arbitration service is disabled by default. Go to the Parameter Configuration module and configure tenant parameters.
If you specify a workload type in Basic Settings, the system will automatically select the corresponding parameter template.
You can select each startup parameter item and specify its value.
You can also click Select Parameter Template, and select a parameter template. The system will then automatically populate the parameters from the template along with the configurations. If no tenant parameter template exists, you can click Create Tenant Template to create one. For more information, see Manage tenant parameter templates.
The system provides four built-in templates, which contain common parameter settings. You can directly apply the templates for the initialization settings of a cluster. The following table describes the built-in templates of the system.
Template Description COMPLEX_OLTP default parameters Corresponds to the Complex OLTP workload type and applies only to OceanBase Database V4.2.5 and later. Default HTAP Parameter Template The parameter template for the HTAP workload type. This template applies only to OceanBase Database V4.2.5 and later. Default Parameters Template for OLAP The OLAP parameter template is applicable only to OceanBase Database V4.3.0 and later versions. Default Express OLTP parameters Default parameters for the Express OLTP load type. Applies only to OceanBase Database V4.2.5 and later. Note
If your tenant mode is MySQL and the parameter template you selected contains parameters defined only in Oracle, you need to manually remove these parameters after the template is populated.
Click Submit.
The page displays a message indicating that the tenant creation task was successfully submitted: Tenant creation task submitted.. You can view a summary of the task on this page.
- To view the details, click View Task Details.
- You can also click Return to Tenants List to return to the tenant list page. On this page, you can view the creation status and task details of the new tenant, and delete a created tenant.
Note
When the task status is Completed and the status of the new tenant in the Tenant list section of the Tenant Management page is Running, the tenant creation is complete.