This topic describes how to deploy an OceanBase cluster in an x86-based CentOS Linux 7.9 system through the GUI of OceanBase Cloud Platform (OCP).
Prerequisites
OCP has been deployed. For more information, see Deploy OceanBase Cloud Platform Community Edition.
The current OCP user has the ADMIN or ORG_ADMIN role.
The oceanbase-ce, oceanbase-ce-libs, and oceanbase-ce-utils software packages have been uploaded to OCP. For more information, see Upload software packages.
(Optional) If you are creating a multi-replica OceanBase cluster, an available ODP cluster must exist in the current OCP. For more information about how to add an ODP cluster, see Create OBProxy cluster.
Procedure
Note
This topic uses OCP Community Edition V4.3.4 as an example. The GUI may vary with the OCP version.
Step 1: Add hosts to the resource pool of OCP
Before you deploy an OceanBase cluster, you must add the required hosts to the resource pool of OCP.
Log in to the OCP console with the admin account.
In the left-side navigation pane, click Hosts.
In the upper-right corner of the Hosts page, click Add Host.
In the dialog box that appears, enter the host information.
The following table describes the parameters that you need to configure.
Parameter Description IP Address The IP address of the host to be added. Enter the IPv4 address of the new host. Multiple IP addresses are supported (separate them with commas). SSH Port Default: 22. Machine model A label for hosts with the same configuration to facilitate OCP host management. If no matching model exists, click Add machine model in the drop-down list to add a new one. IDC Select the IDC where the host is located. If no matching IDC exists, click Add IDC in the drop-down list to add a new one. IDC information includes IDC and Region. - IDC is a host attribute recorded for OceanBase clusters and is referenced in load balancing and SQL routing. Specify according to the actual environment.
- Region indicates the geographical area where the host is located and affects OceanBase load balancing and SQL routing. Specify according to the actual environment.
Note
OCP V3.1.1 and later support multi-zone mode. When you add an IDC, it is created in the availability zone where the current OCP resides.
Host type Options: Physical machine, Container, and ECS. When you select Container, you must specify Port mapping, that is, the mapping for ocp-agent and ocp-exporter (format: <host_port>:<ocp-agent_port>,<host_port>:<ocp-exporter_port>).Credentials Select the credentials used for remote login to the physical server. You can click Add credential in the drop-down list to create credentials. When adding a credential: - Credential name: Must start with a letter and end with a letter or digit. Can contain letters, digits, and underscores. Length: 2 to 64 characters.
- Authorization type: Password, Public key, or Configured password-free.
- User type: SSH users with root privilege are supported. A regular user with root privilege must have password-free sudo configured. OCP only supports password-free execution of all sudo commands, that is, adding
username ALL=(ALL) NOPASSWD:ALLto/etc/sudoers.
Host alias (optional) An alternative name for the host. Description (optional) Comments for the host to facilitate management. Click OK.
Step 2: Create an OceanBase cluster
This section describes how to create an OceanBase cluster in OCP.
On the GUI of OCP, find the entry to cluster creation based on the actual business scenario.
If you do not have clusters to be managed, the system displays a message on the Clusters page, prompting you to create one. Click Create Cluster in the message.
If you have clusters to be managed, click Clusters in the left-side navigation pane, then click Create Cluster in the upper-right corner of the Clusters page.
Note
By default, OCP creates a distributed cluster. On the Create Cluster page, you can select the cluster deployment mode in the upper right corner (Distributed Cluster or Single-node Centralized). The following instructions use Distributed Cluster as an example.
On the Create Cluster page, configure the basic information of the cluster.
The following table describes the basic information parameters.
Parameter Description Cluster Type Select Primary Cluster. Feature applicability
OCP Community Edition only supports creating primary clusters.
Cluster Name The name of the cluster to be managed. Must start with a letter and end with a letter or digit. Can contain letters, digits, and underscores. Length: 2 to 32 characters. root@sys Password Custom or randomly generated. The password must meet the following requirements:
- Length: 8 to 32 characters
- At least three of: digits (0–9), uppercase (A–Z), lowercase (a–z), and special characters
~!@#%^&*_-+=
(){}[]:;,.?/
You can click Copy password to copy the password to the clipboard.OceanBase Version Select an OceanBase Database version from the list or click Upload software package in the drop-down to upload OceanBase Database RPM packages. Load type Select a load type from the drop-down. OCP sets different configurations based on the load type. Options: - Express OLTP: For trade, payment core systems, high-throughput internet apps, etc. No foreign keys, stored procedures, long/large transactions, complex joins, or complex subqueries. Requires OceanBase Database V4.2.5+.
- HTAP: For mixed OLAP and OLTP. Requires OceanBase Database V4.2.5+.
- OLAP: For real-time data warehouse and analytics. Requires OceanBase Database V4.3.0+.
- Complex OLTP: For banking, insurance systems with complex joins, subqueries, PL/SQL batch jobs, long/large transactions. Requires OceanBase Database V4.2.5+.
- OBKV: For key-value and HBase-like wide-column workloads. Requires OceanBase Database V4.2.5+.
Associate OBProxy Cluster Associates the cluster with an existing ODP cluster. For multi-replica OceanBase clusters, we recommend enabling this so that SQL requests are accurately forwarded to the correct replicas for near-single-node database access. - By default, proxyro@sys is used. You do not need to enter a username or password.
- Select the ODP cluster from the drop-down. If none is available, see the link in Prerequisites to add an ODP cluster.
Notice
- Only ODP clusters that are on the same network and non-empty can be selected.
When OceanBase Version is V4.0 or later, only OBProxy clusters of V4.0.0 or later are supported.
Set the deployment mode of the cluster.
By default, three zones are added. To add more zones, click + Add Zone. To remove a zone, click the Delete icon next to that zone.
The following table describes the settings for each zone.
Parameter Description Zone Name Generally, a default name is provided. You can set a custom name as needed. A zone name must start with a letter, end with a letter or digit, and can contain letters, digits, and underscores. Length: 2 to 32 characters. In a multi-Zone OceanBase cluster, one Zone must be in the same Region as the primary Zone. IDC The IDC of the zone. Each zone can exist in only one IDC. Machine model (Optional) If you select a machine model, the host list filters by that model. CPU Architecture If multiple installation packages with different architectures are available for the selected OceanBase Database version, the selected hardware architecture of the host must match the software package. 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, hybrid architecture deployment may have stability and performance issues. Proceed with caution.
Host You can select or add hosts. Root Service location Select an IP as the host for Root Service. For a multi-replica OceanBase cluster, you must specify this for each Zone. Zone priority ranking Specifies the priority of Zone distribution for the sys tenant primary replica. The Zone with the highest priority is the Primary Zone; only one is allowed. If not set, the first Zone is the highest priority. To rank: - Select one or more Zones in the left list (all available Zones are shown).
- Click the middle > button to move the selected Zones to the Priority ranking list. Multiple Zones selected together have the same priority.
- Repeat steps 1–2 to add lower-priority Zones.
- To change order, drag Zones in the Priority ranking list. Top to bottom means higher to lower priority.
Choose whether to enable Cgroup for the cluster.
Cgroup is used for CPU resource isolation between tenants and within a tenant. For OceanBase clusters V4.0 and later, Cgroup is enabled by default for stronger CPU/IOPS isolation. Enabling it may reduce performance by about 7%. For single-tenant, small-scale (<14C) workloads that need higher performance, you can disable Cgroup. If the host kernel is below 4.1.9, tenant creation will fail; in that case Cgroup is disabled by default and the Cgroup switch is hidden.
Configure CPU overcommit.
Enable CPU overcommit and set the overcommit ratio. Default is 120%. Use the slider or input to set a value from 101% to 200%.
CPU overcommit improves resource utilization when tenant loads overlap. If different workloads overlap, the cluster may become overloaded and tenants may compete for CPU threads, which can slow down the application.
Open Parameter Settings and configure cluster parameters.
If you set a load type in Basic Settings, the system selects the matching parameter template by default.
As shown in ①, add startup parameters one by one and set their values. For parameter details, see System configuration parameters overview.
As shown in ②, click Select parameter template to pick a template. The system fills in the parameters from the template. You can also click Create cluster parameter template to create a template. For more information, see Manage cluster parameter templates.
OCP provides six built-in templates:
Template Description COMPLEX_OLTP default parameter template For Complex OLTP load type. OceanBase Database V4.2.5+ only. HTAP default parameter template For HTAP load type. OceanBase Database V4.2.5+ only. KV default parameter template For OBKV load type. OceanBase Database V4.2.5+ only. EXPRESS_OLAP default parameter template For Express OLAP load type. OceanBase Database V4.2.5+ only. OLAP default parameter template For OLAP load type. OceanBase Database V4.3.0+ only. 2.2.77 default parameter template For OceanBase cluster V2.2.77. For production use. Open Custom Settings to configure the OS owner user, paths (software, data disk, log disk), and ports (SQL, RPC).
Configure the OS owner user:
This user runs OBServer installation and operation and cannot be edited. You can change the default by adjusting the
ocp.operation.default.os.userparameter. This only affects new distributed clusters, OBProxy clusters, and arbitration services; it does not change existing clusters.Configure paths:
Setting Description Software installation path When OS owner user is admin: default /home/admin/oceanbase. When not admin: default/opt/oceanbase/oceanbase. Custom path supported.Data disk path Default /data/1. Custom path supported.Log disk path Default /data/log1. Custom path supported. For production, we recommend the log disk be at least 3× host memory. Do not mount data and log on the same disk.Note
From OCP V4.3.0 BP1, when creating OceanBase clusters in certain version ranges, the slog directory is on the log disk instead of the data disk. If
log_disk_size=0is set, clog is treated as exclusive withlog_disk_percentagedefault 90%. If the slog+clog disk is smaller than 40 GiB, the space reserved for slog may be less than 4 GiB, which can affect slog writes.- V4.2.4.0 ≤ OceanBase Database version < V4.3.0.0
- OceanBase Database version ≥ V4.3.1.0
After configuring paths, click Test to verify they are usable. If not, fix the issues or choose other paths.
Configure ports:
Setting Description SQL Port Default 2881. Custom port supported. RPC Port Default 2882. Custom port supported. After configuring ports, click Test to verify they are not in use. If a port is in use, choose another.
After the test succeeds, click Submit.
In the Confirm submission information dialog box, confirm the information and click OK.
Note
You can view the task progress by clicking Tasks in the upper-right corner of the page.
References
After the cluster is deployed, you need to create a business tenant. For more information, see Create a tenant.