OceanBase Database provides an enterprise-level native distributed architecture, which allows you to deploy OceanBase Database in distributed cluster mode. A distributed cluster provides financial-grade high availability and smooth scaling capabilities. It is highly compatible with Oracle and MySQL databases and is suitable for core business systems that demand high data security.
This topic describes how to create a primary distributed OceanBase cluster to be managed by OceanBase Cloud Platform (OCP).
Applicability
OCP Community Edition supports creating only a primary cluster.
Background information
- A cluster deployed on multiple hosts in a single zone can be scaled up only in terms of computing capabilities. The cluster does not support high availability and applies only to a development or test environment.
- A cluster with an even number of zones cannot meet the high availability requirements and has data security risks. We recommend that you adjust the configurations to ensure an odd number of zones or enable the arbitration service for the cluster or tenant.
Prerequisites
-
- You have logged in to the OceanBase Cloud Platform (OCP) console and been assigned the ADMIN or ORG_ADMIN role.
(Optional) An OBProxy cluster exists in OCP. This is required if you want to create a multi-replica OceanBase cluster. For more information about how to create an OBProxy cluster, see the following topics:
Procedure
Log in to the OCP console, click
Clusters in the left-side navigation pane to go to theClusters page. Find the entry to cluster creation based on the actual business scenario.If you do not have a manageable cluster, the system displays a message on the
Clusters tab, prompting you to create one. ClickCreate Cluster in the message.If you already have a manageable cluster, go to the
Clusters tab and then clickCreate Cluster in the upper-right corner.
In the
Create Cluster dialog box, selectDistributed Cluster .Set the basic information of the cluster. The following table describes the parameters in the
Basic Settings section.Parameter Description Cluster Type Select Primary Cluster .Cluster Name The name of the cluster to be created. The cluster name must be 2 to 48 characters in length and can contain uppercase and lowercase letters, digits, and underscores (_). The cluster name must start with letters. root@sys Password This password can be customized or randomly generated. The password must meet the following complexity requirements: - The password must be 8 to 32 characters in length.
- The password must contain characters of at least three of the following types: digits (0 to 9), uppercase letters (A to Z), lowercase letters (a to z), and special characters. Supported special characters are:
~ ! @ # % ^ & * _ - + = \
( ) { } [ ] : ; , . ? /. OceanBase version You can select an OceanBase Database version from the drop-down list or click Add Version at the bottom of the list to upload an OceanBase Database version. Associate OBProxy Cluster You can associate the cluster with an OBProxy cluster. If you want to create a multi-replica OceanBase cluster, we recommend that you enable this option and select an existing OBProxy cluster to associate with the OceanBase cluster. After the association, the SQL requests of your business will be accurately forwarded to a replica. This ensures good experience that can rival access to a standalone database when you access an OceanBase database.
1. By default, the proxyro user is used for association. You do not need to enter a username or password.
2. Select the OBProxy cluster for association from the drop-down list. If no OBProxy cluster is available in the drop-down list, create an OBProxy cluster. For more information, see the Prerequisites section of this topic.
The limitations on the OBProxy cluster to be associated are as follows:- You can select only a non-empty OBProxy cluster on the same network as the OceanBase cluster.
- If the version of the OceanBase cluster is V4.0 or later, you can select only an OBProxy cluster of V4.0.0 or later.
Load Type You can select a load type for the cluster. The load type mainly affects the time required to identify SQL queries (parameter name: large_query_threshold). The RT of OLTP loads may be seriously affected. Proceed with caution. OCP supports five types of cluster loads. - Express OLTP: suitable for workloads such as trading and core payment systems and high-throughput online applications. Such workloads do not involve restrictions such as foreign keys, stored procedures, long-running or large transactions, complex join operations, or complex subqueries.
Supported versions: This template applies to OceanBase Database V4.2.5 and later. - HTAP: suitable for hybrid transaction and analytical processing (HTAP) workloads. You can use it to quickly get insights from campaign operation data, fraud detection, and scenario-specific recommendations.
Supported versions: This template applies to OceanBase Database V4.2.5 and later. - OLAP: suitable for real-time data warehouse analytics.
Supported versions: This template applies to OceanBase Database V4.3.0 and later. - Complex OLTP: suitable for workloads such as banking and insurance systems. These workloads often involve complex join operations, complex subqueries, batch processing jobs compiled in PL, long-running transactions, and large transactions. Short-running queries are sometimes executed in parallel.
Supported versions: This template applies to OceanBase Database V4.2.5 and later. - OBKV: suitable for workloads that involve a high throughput and are sensitive to latency, such as key-value workloads and wide-column workloads of an HBase database.
Supported versions: This template applies to OceanBase Database V4.2.5 and later.
Set the deployment mode of the cluster.
By default, three zones are added for a cluster. To deploy more than three zones for the cluster, click + NewZone. To deploy less than three zones for the cluster, click the Delete icon after the zone to be deleted.

The following table describes the settings for each zone.
Parameter Description Zone Name You can retain the default name or define a custom name. A zone name must consist of 2 to 48 characters, including uppercase and lowercase letters, digits, and underscores (_), and start with a letter. In an OceanBase cluster that consists of multiple zones, the cluster must have a zone that shares the same region as that of the primary zone. IDC The IDC of the zone. Each zone can be deployed in only one IDC. Host Type Optional. If you select a type, the host list is filtered based on the type. CPU Architecture If multiple installation packages for different architectures are available for the selected OceanBase Database version, you must specify a host hardware architecture that matches the installation package to use. Notice
- By default, the architecture of the first installation package is used. You can change the architecture. After you change the architecture, you can select a host of the selected architecture from the
Host drop-down list. - You can set different architectures for the zones. However, the deployment mode with a hybrid architecture may have stability and performance issues. Proceed with caution.
Host You can select or add hosts. Root Service Select an IP address as the host for the RootService. If you want to create a multi-replica OceanBase cluster, you must specify this parameter for each zone. Zone Priority Rankings (This parameter is not required when you create a standby cluster.)Choose whether to specify priorities for the zones in which the leader and follower replicas of the sys tenant in the cluster are located. - When you specify the priorities, the zone with the top priority is treated as the only primary zone. Perform the following steps to specify zone priorities:
1. Select one or more zones in the left-side list that The left-side list shows all zones available in the cluster.
2. Click the closing angle bracket (>) in the middle. The selected zones are moved to thePriority Rankings list. The zones that are selected at the same time have the same priority.
3. Repeat the preceding two steps to add zones of a lower priority.
4. You can drag a zone in thePriority Rankings list to adjust its priority. The priorities of zones in the list are in descending order. - If you do not specify the priorities, the first zone takes the top priority.
Add Arbitration Service Choose whether to add an arbitration service for the cluster. You can select a service from the Services drop-down list or clickCreate Service to create an arbitration service for the cluster. For more information, see Add an arbitration service.Note
You can add an arbitration service only for a primary cluster of OceanBase Database V4.1.0 or later.- By default, the architecture of the first installation package is used. You can change the architecture. After you change the architecture, you can select a host of the selected architecture from the
Choose whether to enable the cgroup feature for the cluster.
The cgroup feature supports CPU resource isolation between tenants and within a tenant in the OceanBase cluster. When you create an OceanBase cluster of V4.0 or later, the cgroup feature is enabled by default to enhance CPU and IOPS isolation. It will cause a performance degradation of approximately 7%. If your business involves a single tenant and less than 14 CPU cores and requires high database performance, we recommend that you disable the cgroup feature. In addition, if the operating system kernel version on the host is earlier than V4.1.9, you cannot create tenants in the cluster. In this case, the cgroup feature is disabled by default, and you cannot enable it.
Enable
CPU Overallocation Settings and configure a CPU overprovisioning quota. You can configure the overprovisioning quota by dragging the slider or specifying a value ranging from 101% to 200% in the textbox. The default value is 120%.Loads of different tenants in the system can be alternately processed in a controlled manner. This allows you to improve resource utilization by overprovisioning CPU resources. An OceanBase cluster may be overloaded if the loads for different business scenarios are processed at the same time. This results in CPU contention among threads of different tenants and degrades business performance.
Note
- CPU overprovisioning is supported only in OceanBase Database V4.0 and later. You can configure an appropriate overprovisioning quota to make full use of the hardware resources.
- CPU overprovisioning depends on the cgroup configuration. Enable the cgroup feature for the cluster before you configure the CPU overprovisioning quota.

Enable
Parameter Settings and specify related cluster parameters.You can adjust the CPU, memory, data disk, and log disk capacities at the cluster level by specifying the following parameters:
cpu_count,memory_limit_percentage,system_memory,data_disk_usage_limit_percentage,datafile_size,clog_disk_usage_limit_percentage, andlog_disk_size. For more information about the parameters, see Overview.If you have selected a load type in the
Basic Settings section, the system automatically selects the parameter template corresponding to the selected load type.You can click the button in section ① of the following figure to add startup parameters one by one and set their values.
You can also click
Select Parameter Template as shown in section ② of the following figure and then select a parameter template. The system will automatically populate parameters in this section by using the template. If no cluster parameter template is available, click Create Cluster Template to create one. For more information, see Manage cluster parameter templates.

The system provides six built-in templates that contain general parameters. You can use a template for cluster configuration. The following table describes the built-in templates.
Template Description Default Parameter Template for COMPLEX_OLTP The default template for the Complex OLTP load type. It applies only to OceanBase Database V4.2.5 and later. Default Parameter Template for HTAP The default template for the HTAP load type. It applies only to OceanBase Database V4.2.5 and later. Default Parameter Template for KV The default template for the OBKV load type. It applies only to OceanBase Database V4.2.5 and later. Default Parameter Template for EXPRESS_OLAP The default template for the Express OLAP load type. It applies only to OceanBase Database V4.2.5 and later. Default Parameter Template for OLAP The default template for the OLAP load type. It applies only to OceanBase Database V4.3.0 and later. Default Parameter Template for OceanBase Database V2.2.77 The template recommended for a production cluster of OceanBase Database V2.2.77. Enable
Custom Settings and specify custom cluster-level parameters for users (such as the OS user), paths (such as software installation paths, data disk paths, and log disk paths), and ports (such as SQL ports and RPC ports).Configure the OS user.
The OS user is used to install, configure, and run the OBServer node, and cannot be edited after being set. You can change the OS user by changing the default value of the
ocp.operation.default.os.userparameter. The modification of the OS user has impact only when you create a distributed cluster, create an OBProxy cluster, and create an arbitration service, and does not affect other parameters of existing clusters.Configure the paths. The following table describes the path parameters.
Parameter Description Software Installation Path - If the OS user is
admin, the default software installation path is/home/admin/oceanbase. You can change the path. - If the OS user is not
admin, the default software installation path is/opt/oceanbase/oceanbase. You can change the path.
Data Disk Path The default value is /data/1. You can change the path.Log Disk Path The default value is /data/log1. You can change the path. In a production environment, we recommend that the size of the log disk be at least three times the memory size of the host. To avoid performance issues, we recommend that you do not create the data directory and the log directory on the same disk.Note
When you create an OceanBase cluster of the following versions in OCP V4.3.0 BP1 or later, theslogdirectory will be placed in the log disk and no longer bound to the data disk. If you set thelog_disk_sizeparameter to0, the log disk is exclusively occupied by theclogdirectory. In this case, the value of thelog_disk_percentageparameter is 90% by default. If the size of the disk where theslogandclogdirectories are placed is less than 40 GiB, the space reserved for theslogdirectory is less than 4 GiB, which may affect the writing of slogs.- OceanBase Database V4.2.4.0 or later but earlier than V4.3.0.0
- OceanBase Database V4.3.1.0 or later
slogdirectory, see Structure of the OBServer node installation directory.Click
Test to check whether the paths can be used. If a path cannot be used, you can perform troubleshooting based on the test results, or use another path.- If the OS user is
Configure the ports. The following table describes the port parameters.
Parameter Description SQL Port The default value is 2881. You can change the port.RPC Port The default value is 2882. You can change the port.Click
Test to check whether the ports are occupied. If a port is occupied, you must use another port.

After the test succeeds, click
Submit .In the
Confirm Information dialog box, confirm the information and then clickOK .
You can view the task progress in