OceanBase Database Proxy (ODP), also known as OBProxy, is a database proxy middleware provided by OceanBase. ODP supports connection pool management, load balancing, and failovers. ODP is an optional component. You can determine whether to deploy it based on your application requirements and scenarios.
This topic describes how to create an ODP cluster in OceanBase Cloud Platform (OCP).
Note
- This topic uses OCP V4.1.0 as an example. The GUI varies with the OCP version.
- After you deploy ODP on a server, ODP provides the proxy service of OceanBase Database by exposing a socket in the format of
IP address:port. You can access OceanBase Database through the socket in the same way you access MySQL Database. We recommend that you deploy ODP on an OBServer node. - We recommend that you deploy only one ODP on a server and use port
2883. If you deploy two or more ODPs on the same server, you must specify different ports.
Prerequisites
- You have deployed OCP. For more information, see Deploy OCP.
- You have the
OBPROXY_MANAGERrole or the permissions to manage ODP. For more information, see Role overview and Default OCP roles. - You have obtained the RPM package of ODP. For more information, see Prepare installation packages.
Procedure
Log on to the OCP console.
In the left-side navigation pane, click OBProxy to go to the OBProxy page.
On the OBProxy page, click Create OBProxy Cluster in the upper-right corner.
On the Create OBProxy Cluster page, specify parameters in the Basic Settings section.
Parameter Description Cluster Name You can customize the cluster name. The value must start with a letter and can contain letters, digits, and underscores (_). Enter the password of the proxyro user The proxyro user is used to access an OceanBase cluster from an ODP. If no password is specified, the default password of the proxyro user is used. The password must meet the following requirements: - Be 8 to 32 characters in length.
- Contain only letters, digits, and special characters. Supported special characters are
~ ! @ # % ^ & * _ - + = ` | ( ) { } [ ] : ; ’ , . ? / - Contain at least two uppercase letters, two lowercase letters, two digits, and two special characters.
Software Version Select the version of ODP RPM to install. Note
- You can select only an ODP software package of V1.8.0 or later.
- If an OceanBase cluster of V4.0.0 or later is available in the Select Accessible OceanBase Clusters section, you can select only an ODP software package of V4.0.0 or later.
Manage Load Balancer By default, this parameter is disabled.
- If this parameter is disabled, you must specify the following information:
- Access URL: the access URL of the ODP cluster. It is only used to generate a connection string of the tenant and does not affect actual use. For a virtual IP (VIP) address, you must apply for the VIP and bind it to the ODP server.
- Access Port: the default access port is 2883. You can change the access port.
- If this parameter is enabled, you must specify the following information:
- Load Balancer: the default value is
OBLB. The Server Load Balancer (SLB) service of Alibaba Cloud applies only to the Apsara Stack environment. We recommend that you contact OceanBase Technical Support for assistance. - OBLB Service: You can select an OBLB service that is deployed when you deploy OCP, or click Add OBLB Service and create an OBLB service in the right-side panel.
- VIP: the virtual IP address of the OBLB service.
- Access Port: the default access port is 2883. You can change the access port.
- Domain Name Configuration (optional): the configuration that points to the VIP and port. The platform does not provide the mappings between VIPs and domain names. You must configure the domain name resolution service.
- Load Balancer: the default value is
Startup Method The startup method of the ODP cluster. Valid values: - ConfigUrl: specifies the multicluster startup method, where the ODP cluster can access multiple OceanBase clusters.
- RsList: specifies the single cluster startup method. The OBProxy cluster can only access the OceanBase cluster specified when the OBProxy cluster is created. After an OBProxy cluster is created, no more connectable OceanBase clusters can be added.
(Optional) On the Create OBProxy Cluster page, turn on Deploy OBProxy and specify the parameters.
If you want to deploy the ODP when you create an ODP cluster, you can skip this step. After the cluster is created, you can add an ODP to the cluster by taking the following actions: take over an ODP or add an ODP.
Toggle on the Deploy OBProxy section, and refer to the following table to specify the parameters.
Parameter Description IDC Select the IDC to which the ODP belongs. An ODP can belong to only one IDC. Host Type (Optional) If you select a host type, the host list is filtered based on the host type. Host Configure the host where the ODP instance is to be deployed.
By default, fields for two ODP instances are displayed. To deploy more ODP instances, click Add OBProxy to add an ODP instance. If you need to deploy only one ODP instance, click the Delete icon to the right of an ODP instance to delete it.(Optional) On the Create OBProxy Cluster page, specify the cluster parameters.
Enable Parameter Settings, and add or modify the startup parameters and other parameters.
Enable Custom Settings to specify the cluster port number, OS user, and installation path.
Parameter Description SQL Port Number The default port number is 2883. You can change the port number. Log Disk Path The default port number is 2884. You can change the port number. OS User The OS user that you use to install and run OceanBase Database. You cannot edit this parameter here. To change the user, you can modify the default value of the ocp.operation.default.os.userparameter. For more information, see Modify system parameters.Software Installation Path - If the value of OS User is
admin, the default value of Software Installation Path is/home/admin/obproxy. You can specify a custom path. - If the value of OS User is not
admin, the default value of Software Installation Path is/opt/oceanbase/obproxy. You can specify a custom path.
Note
If you modify the
ocp.operation.default.os.userparameter, the modification takes effect only when you create a distributed cluster, an ODP cluster, or an arbitration service, and does not affect other configurations of existing clusters.- If the value of OS User is
Click Submit in the lower-right corner.
References
For more information about how to use OCP to create an ODP cluster, see Create an ODP cluster.