A distributed cluster is an enterprise-level native distributed database architecture of OceanBase. It features financial-grade high availability, smooth scaling, and high compatibility with Oracle/MySQL modes. It is suitable for core business systems with high data security requirements.
You can create a managed distributed primary cluster based on your business needs.
Applicability
OCP Community Edition only supports creating primary clusters.
Background information
- When the cluster Deployment Mode is set to Single Zone Multi-host, only the computing capability of the OceanBase service is scaled out. This configuration does not provide high availability through multiple replicas and is suitable for development and test environments.
- When the cluster Deployment Mode is set to an even number of zones, it cannot meet high availability requirements and poses data security risks. We recommend that you adjust the configuration to maintain an odd number of zones or enable the arbitration service for the cluster or tenant.
Prerequisites
The current user logged in to OCP has the ADMIN or ORG_ADMIN role.
(Optional) If you are creating a multi-replica OceanBase cluster, ensure there is an available OBProxy cluster in the current OCP. You can refer to the following links to add an OBProxy cluster.
Procedure
Step 1: Go to the cluster creation page
After logging in to OCP, click Cluster in the left navigation pane to go to the Cluster overview page. Locate the entry for creating a new cluster based on your actual business scenario.
If you have no manageable clusters, the system will prompt you to create a new cluster on the Clusters tab. Click Create Cluster directly in the prompt.
If you already have manageable clusters, click Create Cluster in the upper-right corner of the Clusters tab.
On the Create Cluster page, select the Distributed Cluster mode.
Step 2: Configure basic cluster information
The following is the basic information required when creating a distributed cluster:
Configuration |
Description |
|
|---|---|---|
| Cluster Type | Select Primary Cluster. | |
| Cluster Name | The name of the cluster to be managed. The cluster name must start with a letter and end with a letter or number, can contain letters, numbers, and underscores, and be 2 to 32 characters in length. | |
| root@sys password | Supports custom or randomly generated passwords. The password must meet the following complexity requirements:
|
(){}[]:;,.?/. |
| OceanBase Version | You can select an existing OceanBase cluster version from the list, or click Add Version at the bottom of the list to upload a new OceanBase version. | |
| Associate OBProxy Cluster | If you have created an OceanBase cluster with multiple replicas, it is recommended that you enable the Associate OBProxy Cluster switch and associate this OceanBase cluster with an OBProxy cluster. After association, SQL requests related to your business will be accurately forwarded to the corresponding replicas, providing access to OceanBase Database with performance comparable to accessing a standalone database. 1. By default, the proxyro user is used for association; you do not need to enter a username and password. 2. Select the OBProxy cluster to associate from the drop-down list. If no OBProxy cluster is available in the list, refer to the description in the Prerequisites section of this topic to add an OBProxy cluster. The following limitations apply to the OBProxy cluster to be associated:
|
|
| Load Type | You can select a load type for a cluster. The load type primarily affects the judgment time for SQL queries (parameter: large_query_threshold) and may significantly impact the response time (RT) for OLTP workloads. Therefore, you must choose carefully. OCP supports five cluster load types, described as follows.
|
Step 3: Configure the cluster's deployment mode
By default, information for 3 zones is added. If you want to deploy a cluster with more than 3 zones, you can click the Add button below to add zone information. If the number of zones for the cluster is less than 3, you can click the delete icon next to a zone.
The information that needs to be set for each zone and its description are shown in the following table.
Configuration |
Description |
|---|---|
| Zone Name | You can keep the default or customize it. The zone name must start with a letter, support uppercase and lowercase letters, numbers, and underscores, and be 2 to 32 characters long. For an OceanBase cluster deployed across multiple zones, one zone must have the same region as the primary zone. |
| Data Center | The IDC where the zone is located. A zone can exist only in one IDC. |
| Instance Type | Optional. If you select a host type, the host list will be filtered accordingly. |
| CPU Architecture | When multiple installation packages of different architectures are available for the selected OceanBase version, you must select a host hardware architecture that matches this package.
Notice |
| Host | You can select multiple hosts or add a host. |
| Root Service Location | You need to select an IP address for the server hosting the RootService. In a multi-replica OceanBase cluster, you must specify a RootService for each zone. |
| Zone Priority Sorting | Specify whether to prioritize the distribution of the primary replicas for the cluster's sys tenant.
|
| Add Arbitration Service | Choose whether to add an arbitration service for the cluster. You can select a service from the drop-down list, or click Create Service to create a new arbitration service for the cluster. For more information, see Add an arbitration service.
Note |
Step 4: Configure Cgroup
Cgroup is primarily used for CPU resource isolation between tenants and within tenants in an OceanBase cluster. You can choose whether to enable Cgroup for the cluster based on your actual business type to achieve stronger CPU/IOPS isolation. When you create an OceanBase cluster of version V4.0 or later, Cgroup is enabled by default.
- Enabling Cgroup will result in a performance drop of about 7%. If your business scenario involves single tenants, small specifications (<14C), and requires higher database performance, it is recommended to disable Cgroup.
- If the host's operating system kernel version is lower than 5.1.0, it is recommended to disable Cgroup for the cluster, as this may cause system performance degradation or instability.
- If the host's operating system kernel version is lower than 4.1.9, the cluster will not be able to create tenants. In this case, Cgroup is disabled by default and the Cgroup switch is not displayed.
Step 5: Configure CPU overprovisioning
When workloads from different business scenarios overlap, the OceanBase cluster may experience overload during operation, leading to thread competition for CPU resources among different tenants and slowing down the actual business scenarios. To ensure that the workloads of different tenants in the system can run in a controlled manner while overlapping, you can configure CPU overprovisioning when allocating resources to improve resource utilization.
Note
- Only OceanBase V4.0 and later support CPU overprovisioning. With proper configuration, you can fully utilize hardware resources.
- The CPU overprovisioning feature depends on Cgroup. Before configuring the CPU overprovisioning ratio, please enable Cgroup for the cluster.
In the CPU Oversubscription Settings section, you can configure the overprovisioning ratio using the slider or the input field. The default value is 120%, with a range of 101% to 200%.
Step 6: Configure JVM environment dependency services
Enable JVM Environment Dependency Service so that OBServer can interface with external tables, Java UDFs, ODPS remote access, and other features through the JNI (Java Native Interface) framework.
Notice
- Only OceanBase Database V4.3.5.1 and later support configuring the JVM environment dependency service.
- Refer to Deploy the OceanBase Database Java SDK environment. In advance, use the Upload a software package feature to upload the JAR package library required by the service dependency, ensuring that OBServer can load and use it properly.
- This service depends on a Java environment. If any machines in the cluster have not yet been configured with a Java environment, please configure it yourself:
- If the host is an x86_64 architecture, ensure OpenJDK is version 15 or later;
- If the host is of another architecture, ensure OpenJDK is version 11 or later.
Configure the service type.
OCP supports five service types: ODPS external table, HDFS external table, Java UDF, ODPS Catalog, and MySQL external table plugin. Different services have different requirements for the OceanBase cluster version. For details, see the following table.
Service typeOceanBase version requirementODPS external table [V4.3.5.1, +∞) HDFS external table [V4.3.5.1, +∞) Java UDF [V4.3.5.1, +∞) ODPS Catalog [V4.4.0, +∞) MySQL external table plugin [V4.4.1, +∞) Note
When configuring the service type, the first four service types—ODPS external table, HDFS external table, Java UDF, and ODPS Catalog—are enabled by default and cannot be disabled.
Configure JVM memory.
Proper JVM memory configuration directly affects the stability and performance of Java applications. By setting the JVM memory, you can ensure the basic operational needs of Java applications in the OceanBase cluster. The following table provides predefined JVM memory configuration options based on the different memory specifications of OBServer nodes:
OBServer memory node-Xmx/-Xms-Dio.netty.maxDirectMemoryTotal JVM memory16 GiB 512 MiB 512 MiB 1 GiB 32 GiB 1 GiB 1 GiB 2 GiB 70 GiB 3 GiB 3 GiB 6 GiB Configure the JAVA_HOME path.
After enabling the JVM environment dependency service, you need to manually specify the JAVA_HOME path. Ensure that the JAVA_HOME paths for all OBServer nodes in the cluster are exactly the same.
Step 7: Configure cluster parameters
Open the Parameter Settings module to customize cluster parameters.
If you have configured a workload type in Basic Settings, the system will automatically select the corresponding parameter template by default.
You can add startup parameters and configure their values one by one as shown in position ① in the figure.
Alternatively, as shown in position ② in the figure, click Select Parameter Template and then select a parameter template. The system will automatically fill in the parameters and configurations from the template here. If no cluster parameter template has been created, you can click Create Cluster Template to create one for the cluster. For details, see Manage cluster parameter templates.
The system provides the following six built-in templates, which contain common parameter settings. You can directly apply these templates for initial cluster configuration. The specific descriptions of the built-in templates are as follows.
TemplateDescriptionCOMPLEX_OLTP Default Parameter Template Corresponds to the Complex OLTP workload type. This template is only applicable to OceanBase Database V4.2.5 and later. HTAP Default Parameter Template Corresponds to the HTAP workload type. This template is only applicable to OceanBase Database V4.2.5 and later. KV Default Parameter Template Corresponds to the OBKV workload type. This template is only applicable to OceanBase Database V4.2.5 and later. EXPRESS_OLAP Default Parameter Template Corresponds to the Express OLAP workload type. This template is only applicable to OceanBase Database V4.2.5 and later. OLAP Default Parameter Template Corresponds to the OLAP workload type. This template is only applicable to OceanBase Database V4.3.0 and later. 2.2.77 Default Parameter Template Recommended parameter settings for OceanBase clusters of version V2.2.77, intended for production environments.
Note
If you have customized requirements for CPU, memory, data disk, and log disk usage at the cluster level, please set the parameters:
cpu_count,memory_limit_percentage,system_memory,data_disk_usage_limit_percentage,datafile_size,clog_disk_usage_limit_percentage, andlog_disk_size. For specific parameter descriptions, refer to the OceanBase official website Cluster Parameter Overview.Step 8: Configure users, paths, and ports
In the Custom Settings section, you can configure cluster-level user settings (such as the OS owner user), path settings (such as software installation paths, data disk paths, and log disk paths), and port settings (such as SQL ports and RPC ports).
Configure the OS owner user:
This user is used to install and run OBServer and cannot be edited. You can modify this user by adjusting the default configuration of the
ocp.operation.default.os.userparameter. This parameter takes effect only when creating distributed clusters, standalones, OBProxy clusters, and arbitration services, and does not affect other configurations of existing clusters.Configure related paths:
ConfigurationDescriptionSoftware Path - When the OS Owner User is admin, the Software Path defaults to
/home/admin/oceanbaseand can be customized. - When the OS Owner User is not admin, the Software Path defaults to
/opt/oceanbase/oceanbaseand can be customized.
Data Disk Path Defaults to /data/1and can be customized.Log Disk Path Defaults to /data/log1and supports custom paths. In a production environment, it is recommended that the log disk space be at least three times the host's memory size. Additionally, to avoid disk usage collection issues, it is recommended to mount the data directory, installation directory, and log directory on different disks.Note
Starting from OCP 4.3.0 BP1, when creating an OceanBase cluster of the following versions, the slog directory will be placed on the log disk and will no longer be bound to the data disk. Iflog_disk_size=0is configured at this time, it will be interpreted as exclusive for clogs, meaning the defaultlog_disk_percentageis 90%. If the disk size where slog and clog reside is less than 40 GiB, the reserved space for slog will be less than 4 GiB, which may affect slog writing.- V4.2.4.0 ≤ OceanBase < V4.3.0.0
- OceanBase ≥ V4.3.1.0
- When the OS Owner User is admin, the Software Path defaults to
Configure ports:
ConfigurationDescriptionSQL Port Defaults to 2881 and can be customized. RPC Port Defaults to 2882 and can be customized. After the configuration is complete, click Test to verify whether the specified path and port are available.
- If the test passes, click Create.
- If the test fails, troubleshoot the issue as prompted.
Step 9: Confirm the configuration information
In the right-side panel, confirm that the configured cluster information is correct, and click Next.
Perform a pre-check before creation. The system verifies whether your environment meets the minimum requirements for creating a distributed primary cluster. If a check item fails, you can perform the following operations as prompted:
- Upload: Displayed only when a specific check item fails. Follow the prompts to click Upload to manually upload the required software package.
- Skip: This operation skips the current check item (designed for special scenarios). Ensure the related check item meets product specification requirements; otherwise, it may cause subsequent process failures. After skipping, the status of that check item changes to Warning.
- Retry: Troubleshoot and fix the issue based on the failure reason and optimization suggestions. After fixing, click Retry to rerun the failed check item.
- Retry All: After all issues are troubleshooted and fixed, click Retry All to rerun all failed check items.
When no check items fail, click Create.
After submitting the new cluster task, you can view its execution progress in Task Center.
