OceanBase Database supports the arbitration service since V4.1. The arbitration service can resolve the issue that the response time increases when a replica in the same region fails in the deployment scenario of three IDCs across two regions. The arbitration service can also reduce the cross-region bandwidth overhead and minimize the costs of the third IDC.
This topic describes how to deploy a two-replica OceanBase cluster with one arbitration member by using OceanBase Cloud Platform (OCP).
Note
- This topic uses OCP V4.1.0 as an example. The GUI varies with the OCP version.
- You can add only one arbitration service for an OceanBase cluster.
Prerequisites
- You have deployed OCP. For more information, see Deploy OCP.
- You have added the servers where the OceanBase cluster is to be deployed to the resource pool. For more information, see Add a server.
- You have logged on to the OCP console and have the
CREATE CLUSTERprivilege. For more information, see Role overview and Default OCP roles. - You have obtained the RPM package of OceanBase Database V4.1.0 or later. For more information, see Prepare installation packages.
Procedure
Step 1: Create a two-replica cluster
Log on to the OCP console.
In the left-side navigation pane, click Clusters.
On the Clusters page, click Create Cluster in the upper-right corner.
On the Create Cluster page, use the default value Distributed Cluster.
On the Create Cluster page, configure the basic information of the cluster.
The following table describes parameters in the Basic Settings section.
Parameter Description Cluster Type You can select Primary Cluster or Standby Cluster. In this example, Primary Cluster is selected. 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:
- Be 8 to 32 characters in length.
- Contain at least two digits, two uppercase letters, two lowercase letters, and two special characters.
Supported special characters are~ ! @ # % ^ & * _ - + = ` | ( ) { } [ ] : ; ' , . ? /
In addition, you can click Copy Password to copy a custom or randomly generated password to the clipboard.OceanBase Database Version You can select an existing OceanBase Database version from the list or click Add Version to upload the RPM package of a required OceanBase Database version. Associate OBProxy Cluster This option is used to associate existing ODP clusters. In this example, this option is disabled. On the Create Cluster page, configure the deployment mode of the cluster.
By default, three zones are added. You only need to retain two zones. Delete one zone by clicking the Delete icon next to it.
Parameter Description Zone Name Generally, a default name is provided. You can set a custom name as needed. The zone name must be 2 to 48 characters in length and can contain letters, digits, and underscores (_). It must start with a letter. 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 Choose Automatic or Manual. Host The IP address of the server. You can select multiple IP addresses. Root Server You must select an IP address as the host for the RootService. For a multi-replica OceanBase cluster, you must specify a RootService for each zone. Zone Priority Rankings (Optional) The zone priorities for leader distribution of the sys tenant in the cluster. If this parameter is not specified, leaders of the sys tenant are preferentially distributed in the first zone. The zone with the highest priority is taken as the primary zone. Only one primary zone is allowed.
You can also select this option and customize the zone priorities. To customize the zone priorities, perform the following steps:- Select one or more zones from the left-side list. The 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 the first two steps to add zones of a lower priority.
- To adjust the priority of a zone, drag the zone in the Priority Rankings list to adjust its sequence in the list. The zones in the list are sorted by priority in descending order.
(Optional) On the Create Cluster page, specify the cluster parameters.
You can use the default parameter settings, or turn on Parameter Settings to modify cluster parameters.
- You can add startup parameters one by one and set their values.
- You can also click Select Parameter Template and select a parameter template. The system automatically populates the parameters in this section by using the template. If no cluster parameter template is available, you can click Create Cluster Template to create one.
(Optional) On the Create Cluster page, configure the paths and ports.
You can use the default path and port settings, or turn on Custom Settings to modify parameters in the Path Settings and Port Settings sections.
Configure the paths:
- In the Path Settings section, specify the 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.
Click Submit in the lower-right corner.
Step 2: Create an arbitration service
In the left-side navigation pane, click Clusters. Then, the Clusters page appears.
In the upper-right corner of the Clusters page, click the More icon, and choose Arbitration Service Management.
On the Arbitration Service Management page, click Create Arbitration Service.
In the Create Arbitration Service panel, configure the basic information of the arbitration service.
Parameter Description Host The host for deploying the arbitration service. You can deploy multiple arbitration service processes on the same host. You can search for hosts by IP address or click Add Host in the drop-down list to add an available host. Notice
You cannot select a host on which an OceanBase cluster is deployed.
Service Version The OceanBase Database version of the cluster. The hardware architecture of the selected version must be the same as that of the host. Only software packages of OceanBase Database V4.1.0 or later are supported. You can also click Add Version at the bottom of the drop-down list to upload a software package of the required version. Software Path The path where the arbitration service software is installed. Default path: /home/admin/oceanbase. You must have the write permission on the path on the host.Service Port The port of the arbitration service. By default, port 2882is used. You can use a custom port based on your business requirements. Make sure that the port is not occupied.Description The supplementary description of the arbitration service. This parameter is optional. Parameter settings Set the startup parameters of the arbitration service. Notice
To prevent the disk from being fully occupied by the log directory of the arbitration service node, you need to set
enable_syslog_recycletoTrueto enable automatic cleanup and setmax_syslog_file_countto a valid value. Otherwise, the log file will continue to expand and may use up the disk space.Click OK in the lower-right corner.
In the pop-up window that appears, click the task ID to view the task execution status.
The system verifies the parameter settings. If the settings fail the verification, you can perform troubleshooting or modify the parameters as prompted.
Step 3: Add the arbitration service to the cluster
In the left-side navigation pane, click Clusters. Then, the Clusters page appears.
In the Clusters list on the Clusters page, find the target cluster and click its name.
In the upper-right corner of the Overview page of the cluster, click the More icon, and choose Add Arbitration Service.
In the Add Arbitration Service panel, select an arbitration service endpoint for the cluster. You can also click Create Service at the bottom the drop-down list to create an arbitration service for the cluster.
Click Submit in the lower-right corner.
What to do next
After the cluster is created, you can create user tenants based on your business needs.
For more information about how to create a user tenant in OCP, see Create a tenant.
For more information about how to create a user tenant by using the CLI, see Create a tenant.