This topic describes how to deploy OceanBase Database by using the GUI of OceanBase Cloud Platform (OCP) in an x86-based CentOS Linux 7.9 system.
Prerequisites
You have deployed OCP. For more information, see OceanBase Cloud Platform Deployment Guide.
The current user who logs on to OCP has the ADMIN role or the ORG_ADMIN role.
The oceanbase-ce, oceanbase-ce-libs, and oceanbase-ce-utils software packages required for deployment have been uploaded to OCP. For more information, see Upload a software package in the OceanBase Cloud Platform documentation.
(Optional) An available OceanBase Database Proxy (ODP) cluster exists in the current OCP if you want to create a multi-replica OceanBase cluster. For more information about how to add an ODP cluster, see Create an OBProxy cluster in the OceanBase Cloud Platform documentation.
Procedure
Note
This topic uses OCP Community Edition V4.3.4 as an example. The GUI may vary with the OCP version. The actual GUI shall prevail.
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 by referring to the content of this section.
Log on to OCP.
In the left-side navigation pane, click Hosts to go to the Hosts page.
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.
ParameterDescriptionIP Address The IP address of the host to be added. Enter the IPv4 address of the new host. You can add multiple IP addresses at the same time, separated by commas. SSH Port The SSH port number. The default value is 22.Host Type The label that you specify for hosts with the same configurations to facilitate host management. If the required host type is unavailable, click Create Host Type in the drop-down list to add a new type. IDC Select the IDC where the host is deployed. If the target IDC is unavailable, click Create IDC in the drop-down list to add IDC information to OCP. IDC information includes IDC and Region. - An IDC is one of the host attributes that you must record for an OceanBase cluster. The IDC is referenced in OceanBase load balancing and SQL statement routing strategies. Specify the actual IDC.
- Region specifies the geographical area where the host is located. It is one of the host attributes that you must record for an OceanBase cluster. The region affects the OceanBase load balancing and SQL statement routing strategies. Specify the actual region.
Note
OCP V3.1.1 and later support multi-zone mode. When you add an IDC, it is created in the zone where the current OCP is deployed.
Type Valid values: Physical Machine, Container, and ECS. If you select Container, you must specify Port Mapping, which specifies two mapping relationships between ocp-agent and the host, and between ocp-exporter and the host. The format is <host port>:<ocp-agent port in Docker>,<host port>:<ocp-exporter port 1 in Docker>.Credentials Select the credentials used to remotely log in to the physical server. You can click Create Credential in the drop-down list to create credentials.
When you add a credential, take note of the following:- Credential Name: The credential name must start with a letter and end with a letter or a digit. It can contain letters, digits, and underscores (_). It must be 2 to 64 characters in length.
- Authorization Type: Valid values: Password authentication, Public key authentication, and Configured password-free login.
- User Type: SSH users with root permissions are supported. A regular user with root permissions must first be granted the permission to run sudo commands without a password. OCP currently supports only granting the permission to run all sudo commands without a password by adding
username ALL=(ALL) NOPASSWD:ALLto the/etc/sudoersfile.
Host Alias (optional) Optional. Specifies another name for the host. Description (optional) The comments of the host to facilitate host management. After you complete the configuration, click OK.
Step 2: Create an OceanBase cluster
You can create an OceanBase cluster in OCP by referring to this section.
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, and then click Create Cluster in the upper-right corner of the Clusters page.
Note
OCP creates distributed clusters by default. You can select the cluster mode (Distributed Cluster or Standalone Centralized) in the upper-right corner of the Create Cluster page. This topic takes the creation of a 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.
ParameterDescriptionCluster Type Select Primary Cluster. Applicability
OCP Community Edition supports the creation of primary clusters only.
Cluster Name The name of the cluster to be managed. The cluster name must start with a letter and end with a letter or a digit. It can contain letters, digits, and underscores (_). It must be 2 to 32 characters in length. root@sys Password You can customize the password or have it randomly generated. The password must meet the following complexity requirements:
- Be 8 to 32 characters in length.
- Contain at least three of the following four types of characters: digits (0~9), uppercase letters (A~Z), lowercase letters (a~z), and special characters (
~!@#%^&*_-+=|(){}[]:;,.?/).
OceanBase Version You can select an existing OceanBase Database version from the list or click Upload Software Package in the drop-down list to upload the RPM package of OceanBase Database. Associate OBProxy Cluster This option associates the cluster with an existing ODP cluster. If you are creating a multi-replica OceanBase cluster, we recommend that you enable Associate OBProxy Cluster to associate an ODP cluster with the OceanBase cluster. After the association, the SQL requests of your business will be accurately forwarded to the corresponding replica. This ensures good experience that can rival access to a standalone database when you access an OceanBase database. - By default, the
proxyro@sysuser is used for association. You do not need to enter a username or password. - Select the ODP cluster to be associated from the drop-down list. If no ODP cluster is available in the drop-down list, add an ODP cluster by referring to the link in Prerequisites of this topic.
Notice
- You can select only a non-empty OBProxy cluster in the same network as the OceanBase cluster.
If you select V4.0 or later for OceanBase Version, you can associate only an OBProxy cluster of V4.0.0 or later.
Load Type You can select a load type from the drop-down list. OCP applies different configurations to the OceanBase cluster based on the load type. The following describes the load types: - Express OLTP: suitable for workloads like transaction, payment core systems, and high-throughput internet applications. It has no foreign key constraints, stored procedures, long transactions, large transactions, complex joins, or complex subqueries.
Version limit: applies to OceanBase Database V4.2.5 and later. - HTAP: suitable for mixed OLAP and OLTP workloads. It is usually used to obtain instant insights from active operational data, fraud detection, and personalized recommendations.
Version limit: applies to OceanBase Database V4.2.5 and later. - OLAP: used for real-time data warehouse analysis scenarios.
Version limit: applies to OceanBase Database V4.3.0 and later. - Complex OLTP: suitable for workloads like banking and insurance systems. They usually involve complex joins, complex correlated subqueries, batch jobs written in PL, and long and large transactions. Parallel execution may be used for short-term queries.
Version limit: applies to OceanBase Database V4.2.5 and later. - OBKV: used for key-value workloads and HBase-like wide-column workloads, which usually have very high throughput demands and are latency-sensitive.
Version limit: 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 + Add Zone at the bottom to add a zone. To deploy less than three zones for the cluster, click the Delete icon after the zone.
The following table describes the settings for each zone.
ParameterDescriptionZone Name Generally, a default name is provided. You can set a custom name as needed. A zone name must start with a letter and end with a letter or a digit. It can contain letters, digits, and underscores (_). It must be 2 to 32 characters in length. In an OceanBase cluster with multiple zones, there must be a zone in the same region as 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 host type, the host list displays only the hosts of the specified host type. CPU Architecture If multiple installation packages with different architectures are available for the selected OceanBase Database version, you must select the hardware architecture of the host that matches the software package. Notice
The default architecture type is that of the first installation package. You can change the architecture. After you change the architecture, the Host list displays the hosts of the selected architecture.
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 multiple hosts or add hosts. RootService You must select an IP address as the host for the RootService. If you want to create a multi-replica OceanBase cluster, you must specify a RootService for each zone. Zone Priority Rankings The priorities of the zones for the distribution of the primary replicas of the sys tenant. The zone with the highest priority is taken as the primary zone. Only one primary zone is allowed. If you do not specify the priorities, the first zone has the highest priority by default. The ranking method is as follows: - Select one or more zones from the left-side list. The left-side list shows all zones available in the cluster.
- Click the closing angle bracket (>) in the middle. The selected zones are moved to the Priority Rankings list. The zones that are selected at the same time have the same priority.
- Repeat steps 1 and 2 to add zones of a lower priority.
- To adjust the priority, drag the target zone in the Priority Rankings list to reorder it. The priorities in the list are sorted in descending order.
Choose whether to enable Cgroup for the cluster.
Cgroup is mainly used to isolate CPU resources between tenants and within a tenant in an OceanBase cluster. When the OceanBase cluster you create is of V4.0 or later, the system enables Cgroup by default to achieve stronger CPU/IOPS isolation. Enabling Cgroup causes a performance decrease of about 7%. If your business scenario involves a single tenant, a small specification (<14C), or requires higher database performance, we recommend that you disable Cgroup. In addition, if the kernel version of the operating system on the host is earlier than 4.1.9, tenants cannot be created in the cluster. In this case, the system disables Cgroup by default and does not display the Cgroup switch.
Configure CPU overselling.
You can enable CPU Overselling Settings to configure the CPU overselling quota. The default value is 120%. You can configure the overselling ratio by using the slider or the input box. The value ranges from 101% to 200%.
The loads of different tenants in the system can run in a controlled and interleaved manner. When you configure CPU resources, you can enable overselling to improve resource utilization. If the loads of different business scenarios overlap, the OceanBase cluster may be overloaded during running, and threads of different tenants may compete for CPU resources, which slows down the actual business.
Enable the Parameter Settings module and configure the cluster parameters.
If you configure a load type in Basic Settings, the system selects the parameter template corresponding to the load type by default.
You can add startup parameters one by one and configure values for them at position ① in the figure. For more information about OceanBase Database parameters, see Configuration items.
You can also click Select Parameter Template at position ② in the figure to select a parameter template. The system automatically populates the parameters in the template together with their configurations. You can also click Create Cluster Parameter Template to create a parameter template for the cluster. For more information, see Manage cluster parameter templates in the OceanBase Cloud Platform documentation.
OCP provides the following six built-in templates, which contain common parameter settings. You can directly apply a template to initialize the cluster. The following table describes the templates:
TemplateDescriptionCOMPLEX_OLTP default parameter template Corresponds to the Complex OLTP load type. This template applies only to OceanBase Database V4.2.5 and later. HTAP default parameter template Corresponds to the HTAP load type. This template applies only to OceanBase Database V4.2.5 and later. KV default parameter template Corresponds to the OBKV load type. This template applies only to OceanBase Database V4.2.5 and later. EXPRESS_OLAP default parameter template Corresponds to the Express OLAP load type. This template applies only to OceanBase Database V4.2.5 and later. OLAP default parameter template Corresponds to the OLAP load type. This template applies only to OceanBase Database V4.3.0 and later. 2.2.77 default parameter template The recommended parameter settings for OceanBase clusters of V2.2.77, for use in production environments. Enable Custom Settings to configure cluster-level user settings (such as the OS user), path settings (such as the software installation path, data disk path, and log disk path), and port settings (such as the SQL port and RPC port).
Configure the OS user:
This user is the OS user for installing and running OBServer, and cannot be edited. You can modify this user by adjusting the default value of the
ocp.operation.default.os.userparameter. The modification of this parameter takes effect only when you create a distributed cluster, create an OBProxy cluster, or create an arbitration service, and does not affect other configurations of existing clusters.Configure the paths:
ParameterDescriptionSoftware Installation Path - If the OS user is admin, the default software installation path is
/home/admin/oceanbase. You can specify a custom path. - If the OS user is not admin, the default software installation path is
/opt/oceanbase/oceanbase. You can specify a custom path.
Data Disk Path The default value is /data/1. You can specify a custom path. Log Disk Path The default value is /data/log1. You can specify a custom path. In a production environment, we recommend that the log disk space of OceanBase Database be at least three times the host memory size. In addition, to avoid performance issues, we recommend that you do not mount the data directory and the log directory on the same disk. Note
Since OCP V4.3.0 BP1, when you create an OceanBase cluster of the following versions, the slog directory is placed on the log disk and is no longer bound to the data disk. In this case, if you set
log_disk_size=0, the log disk is considered to be exclusively used by clog, that is, the defaultlog_disk_percentageis 90%. If the disk where slog and clog reside is smaller than 40 GiB, the space reserved for slog is less than 4 GiB, which may affect slog writes.- V4.2.4.0 ≤ OceanBase Database version < V4.3.0.0
- OceanBase Database version ≥ V4.3.1.0
After the configuration is complete, click Test to check whether the paths are available. If a path is unavailable, you can perform troubleshooting based on the test results, or modify the path to another available path.
- If the OS user is admin, the default software installation path is
Configure the ports:
ParameterDescriptionSQL Port The default value is 2881. You can specify a custom port. RPC Port The default value is 2882. You can specify a custom port. After the configuration is complete, click Test to check whether the ports are occupied. If a port is occupied, you must configure an available port.
After the test is complete, click Submit.
In the Confirm Information dialog box that appears, confirm that the information is correct, and then click OK.
Note
You can click Tasks in the upper-right corner of the page to view the progress of the task.
References
After the cluster is deployed, you need to create a business tenant. For more information, see Create a primary tenant in the OceanBase Cloud Platform documentation.
