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 OceanBase Cloud Platform Deployment Guide.
You have logged on to the OCP console and have the permissions for host management and cluster creation.
The oceanbase-ce, oceanbase-ce-libs, and oceanbase-ce-utils software packages have been uploaded to OCP.
A MySQL client has been installed on the host of OceanBase Database.
Python 2.7 has been installed on the host of OceanBase Database.
(Optional) An OceanBase Database Proxy (ODP) cluster is available 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.
Procedure
Note
This topic uses OCP Community Edition V4.0.3 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 on 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. SSH Port The SSH port number of the host to be added. 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, select Create Host Type in the drop-down list to add the type. IDC Select the IDC where the host is deployed. If the target IDC is unavailable, select Create IDC in the drop-down list to add it. IDC information includes IDC and Region. - IDC is one of the host attributes that you must record for an OceanBase cluster. This attribute 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. This attribute 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 You can select Physical Machine or Container. Credentials Select the credentials used to remotely log on to the host. You can select Add Credential from 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 32 characters in length.
- Authorization Type: The authorization type of the credential. Valid values: Username/Password and SSH Private Key.
- 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 allows you to grant the permission to run all sudo commands without a password by adding
username ALL=(ALL) NOPASSWD:ALLto thesudoersfile in the/etc/directory.
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. Description (optional) The host comments that can be used to facilitate host 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, go to the Clusters page, and click Create Cluster in the upper-right corner.
On the Create Cluster page, set the basic information about the cluster.
The following table describes the basic information parameters.
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:
- Contains 8 to 32 characters.
- Contains at least two uppercase letters, two lowercase letters, two digits, and two special characters.
- Supports ~!@#%^&*_-+=|(){}[]:;,.?/
You can click Copy Password to copy the custom or randomly generated password to the clipboard.OceanBase Version You can select an OceanBase Database version from the list or click Add Version to upload the RPM package of an OceanBase Database version. Associate OBProxy Cluster This option associates the cluster with an ODP cluster. If you are creating a multi-replica OceanBase cluster, we recommend that you enable this option and associate an ODP cluster with your 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 the ODP cluster to be associated with from the drop-down list. If no ODP cluster is available in the drop-down list, create an ODP cluster. For more information, see Prerequisites in this topic.
Notice
If you select V4.0 or later for OceanBase Version, you can associate only an ODP cluster of V4.0.0 or 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. 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 Generally, a default name is provided. You can set a custom name as needed. A zone name must be 2 to 48 characters in length and can contain uppercase and lowercase letters, digits, and underscores (_). A zone name must start with letters. In an OceanBase cluster that consists of multiple zones, there must be a zone that shares the same region with 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 is filtered based on the host type. 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. RootServer You can select an IP address for the host that runs 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. The zone with the highest priority is taken as the primary zone. Only one primary zone is allowed. 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, and reorder it.
Turn on Parameter Settings to modify cluster parameters.
Note
If no cluster parameter template is available, you can click Create Cluster Template to create one. For more information, see Manage cluster parameter templates.
Turn on Custom Settings to configure paths and ports.
Configure the paths:
In the Path Settings section, specify Software Installation Path, Data Disk Path, and Log Disk Path as needed.
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.
Configure the ports:
In the Port Settings section, specify SQL Port and RPC Port as needed.
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 click OK.
Note
You can view the progress of this task on the System Management > Tasks page.
References
After the cluster is deployed, you need to create a business tenant. For more information, see Create a tenant.