This topic describes how to deploy an OceanBase cluster by using OceanBase Cloud Platform (OCP) on CentOS Linux 7.9 for the x86 architecture.
Prerequisites
You have deployed OCP. For more information, see Deployment Guide of the OCP documentation.
You have permissions to manage hosts and create clusters.
You have uploaded the oceanbase-ce, oceanbase-ce-libs, and oceanbase-ce-utils software packages to OCP.
You have installed a MySQL client on the host of OceanBase Database.
You have installed Python 2.7 on the host of OceanBase Database.
(Optional) An OceanBase Database Proxy (ODP, also known as OBProxy) cluster exists in the current OCP, if you want to create a multi-replica OceanBase cluster. For more information about how to create an ODP cluster, see Create an OBProxy cluster in the OCP documentation.
Procedure
Note
This topic takes OCP V4.0.3 as an example. The GUI varies based on the OCP version.
Step 1: Add a host to the OCP resource pool
Before you deploy an OceanBase cluster, you must perform the following steps to add a host to the OCP resource pool.
Log on to OCP as the admin user.
In the left-side navigation pane, click Host to go to the Host page.
In the upper-right corner of the Host page, click Add Host.
In the dialog box that appears, specify the host information.
The following table describes the fields in this dialog box.
Field Description IP Address The IPv4 address of the host to add. SSH Port Default value: 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, you can click Create Host Type in the drop-down list to add the host type. IDC Select the IDC where the host is deployed. If the corresponding IDC is unavailable, click Create IDC to create the IDC in 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.
- A 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 versions support the multi-zone deployment mode. When you add an IDC, the new IDC is created in the zone where the current OCP is located.Host Type You can select Physical Machine or Container. Credentials Select the credentials used to remotely log on to the physical server. You can select Add Credential from the drop-down list to create credentials.
Specify the following fields when you add the credentials:- Credential Name: the name of the credentials. The name starts with a letter and ends with a letter or digit. It can contain letters, digits, and underscores (_), and it must be 2 to 32 characters in length.
- Authorization Type: the authorization type of the credentials. Valid values: Username, Password and SSH Private Key.
- User Type: the user type of the credentials. 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 allows you to grant the permission to run all sudo commands without a password by adding
username ALL=(ALL) NOPASSWD:ALLto thesudoersfile in the/etcdirectory.
Host Alias (Optional) A host alias is a label that you specify for hosts with the same configurations. We recommend that you specify a meaningful alias to facilitate host management. This parameter is optional. Description (Optional) The host description that can be used to facilitate host management. After you specify the information, click OK.
Step 2: Create an OceanBase cluster
Perform the following steps to create an OceanBase cluster by using OCP.
On the GUI of OCP, find the button to create a cluster based on the actual business scenario.
If you have no cluster available, the system will prompt you to create a cluster on the Clusters page. You can click Create Cluster in the prompt.
If you have a cluster available and you want to create a new one, you can click Clusters in the left-side navigation pane and then click Create Cluster in the upper-right corner of the Clusters page.
On the Create Cluster page, configure the basic information of the cluster.
The following table describes the basic information fields.
Field Description Cluster Name The name of the cluster to be created. The cluster name must start with a letter. It can contain letters, digits, and underscores (_), and it must be 2 to 48 characters in length. 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 contains at least two uppercase letters, two lowercase letters, two digits, and two special characters.
- Supported special characters are
~ ! @ # % ^ & * _ - + = | ( ) { } [ ] : ; , . ? /
After you enter a password, you can click Copy Password to copy the custom or randomly generated password to the clipboard.OceanBase Version You can select an existing OceanBase Database version from the drop-down list or select Add Version in the drop-down list to upload an RPM package of OceanBase Database. Associate OBProxy Cluster This option is used to associate an existing ODP cluster. If you want to create a multi-replica OceanBase cluster, we recommend that you select this option and associate an ODP cluster to this 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. - By default, the proxyro user is used for association. You do not need to enter a username or password.
- Select an ODP cluster to associate from the drop-down list. If no ODP cluster is available, add an ODP cluster based on the description in Prerequisites of this topic.
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. To deploy less than three zones for the cluster, click the
Deleteicon after the zone to be deleted.The following table describes the settings for each zone.
Field Description Zone Name Generally, a default name is provided. You can set a custom name as needed. The zone name must start with a letter. It can contain letters, digits, and underscores (_), and it must be 2 to 48 characters in length. IDC The IDC of the zone. Hosts in a zone can be deployed in only the same IDC. Host Type (Optional) If you select a host type, the host list displays only the hosts of the specified host type. CPU Architecture When there are multiple installation packages with different architectures in the selected OceanBase Version, you need to select the hardware architecture of the host that matches this software package. Notice
The default architecture type is the architecture type of the first installation package, and it can be switched. After switching to the specified architecture, the hosts list will display the hosts with that architecture.
If you set different architectures for different zones, there may be stability and performance issues with mixed architecture deployment. Please proceed with caution.
Host You can select or add multiple IP addresses. RootServer 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 this parameter for each zone. Zone Priority Rankings The priorities of the zones. This priority order affects the priority order of the primary zone of the sys tenant. The left-side list shows all zones in the cluster. - You can select one or more zones from the box on the left side to add them to the box on the right side. By default, the priority of a zone selected first is higher than that of the zone selected later. Zones selected at the same time have the same priority.
- After you add the zones to the box on the right side, you can also drag them upward or downward to adjust their priorities. The zones in the box on the right are sorted in descending order of priorities.
Zone Priority Rankings The priorities of the zones. The zone with the highest priority will be considered as the primary zone, and only one primary zone is allowed. The sorting method is as follows: - Choose one or more zones from the box on the left side. The left-side list shows all available zones in the cluster.
- Click the > button in the middle. This action moves the selected zones to the priority sorting list. If multiple zones are selected, they will have the same priority.
- Repeat steps 1 and 2 to add zones with lower priority.
- To adjust the priority, drag and drop the zones within the priority sorting list to change their order.
Enable Parameter Settings to modify parameters.
You can manually add startup parameters and configure their values one by one.
Alternatively, you can select a parameter template. The system will automatically fill in the parameters and configurations from the selected template.
Note
If you have not yet created a cluster parameter template, you can click on Create Cluster Template to create one. For more information, see Manage cluster parameter templates.
Open Custom Configuration to configure the path and ports.
Path configuration:
In the Path Configuration module, customize the Software Installation Path, Data Disk Path, and Log Disk Path as needed.
After configuration, click on Test to verify whether the path is available. If it is unavailable, you can troubleshoot based on the test results or modify the path to another available path.
Port configuration:
In the Port Configuration module, customize the SQL port and RPC port.
After configuration, click on Test to verify whether the port is available. If it is already in use, you will need to configure a different port.
Click Submit.
In the pop-up Confirm dialog box, verify the information is correct, and then click OK.
Note
You can check the progress of this task in System Management > Tasks.
More information
After the OceanBase cluster is deployed, you must create a business tenant. For more information, see Create a tenant.