This topic describes how to deploy OceanBase Database Proxy (ODP) by using OceanBase Cloud Platform (OCP). You can also deploy ODP in the following ways:
Deploy ODP by using OceanBase Deployer (obd). For more information, see Deploy ODP by using obd.
Deploy ODP by using a CLI. For more information, see Deploy ODP by using a CLI.
Prerequisites
You have deployed OCP. For detailed instructions, see OCP Deployment Guide.
The user who has logged in to OCP has the permission to manage hosts and ODP.
The ODP software package has been uploaded to OCP.
Netcat has been installed on the server where ODP will be deployed.
Procedure
Note
The interface may vary according to the OCP version. The following uses OCP V4.0.3 Community Edition as an example.
Step 1: Add a host to the OCP resource pool
Log in to OCP as the admin user.
In the left-side navigation pane, click Hosts 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 that you need to configure.
Field Description IP Address The IPv4 address of the host to be added. SSH Port Default value: 22.Host Type The label assigned to hosts with the same configuration to facilitate host management. If the host type you need is not available, you can click Create Host Type in the drop-down list to create a new host type. IDC The IDC where the server is deployed. If the IDC you need is not available, you can click Create IDC to create a new IDC. The IDC information includes IDC and Region. - IDC is a host attribute required for an OceanBase cluster, and this attribute will be used as a reference for OceanBase load balancing and SQL statement routing strategies. Please fill in according to the actual situation.
- Region specifies the geographical location where the host is located. It is also a host attribute required for an OceanBase cluster. This attribute will also be used as a reference for OceanBase load balancing and SQL statement routing strategies. Please fill in according to the actual situation.
Note:
OCP V3.1.1 and later versions support the multi-zone deployment mode. In this deployment mode, when you add an IDC, it will be created in the zone where the current OCP is located.Host Type Valid values: Physical Machine and Container. Credentials The credentials used for remotely login to the physical machine. If the credential you need is not available, you can click Add Credential from the drop-down list to create a new credential.
Note the following when creating a new credential:- Credential Name: Starts with a letter, ends with a letter or a number, contains letters, numbers, and underscores, and is 2 to 32 characters long.
- Authorization Type: Valid values: Username/Password and SSH Private Key.
- User Type: Supports two types of users: one is an SSH user with root permissions, and the other is an ordinary user with root permissions. For ordinary users with root permissions, they must first be granted the permission for the password-free execution of the sudo command, which means they do not need to enter a password when running the sudo command. Currently, OCP only supports configuring all commands for the password-free execution of sudo, which is achieved by adding
username ALL=(ALL) NOPASSWD:ALLto thesudoersfile in the/etcdirectory.
Host Alias (Optional) The label assigned to hosts with the same configuration. It is recommended that you specify a meaningful alias to facilitate host management. Description (Optional) The host comments, which can be used to facilitate host management. Click OK.
Step 2: Create an ODP cluster
Note
You can deploy ODP when creating an ODP cluster, or deploy it by adding an ODP to a newly created ODP cluster (see "Step 3: Add an ODP" below).
Log in to OCP.
In the left-side navigation pane, click OBProxy to go to the OBProxy page.
Click Create OBProxy Cluster in the upper-right corner to go to the Create OBProxy Cluster page.
On the Create OBProxy Cluster page, specify parameters on the following tabs.
Basic Settings
The following figure shows parameters on the Basic Settings tab.

The following table describes these parameters.
Parameter Description Cluster Name You can customize the cluster name based on your actual situation. The name starts with a letter, and contains letters, numbers, and underscores. Enter the password of the proxyro user The Proxyro user is used by ODP to access the OceanBase cluster. If no password is specified, the default password of the proxyro user will be used for the connection. The password must meet the following requirements: - The password length should be between 8 and 32 characters.
- The password can only contain letters, numbers, and special characters
~!@#%^&*_-+=\|(){}[]:;,.?/ - The password must contain at least two uppercase letters, two lowercase letters, two numbers, and two special characters.
Load balancing management After enabling load balancing management, you can configure OBLB to improve the load balancing capability of the ODP cluster. - OBLB Service: You can select the OBLB service already configured when deploying OCP, or click Add OBLB Service in the drop-down list to add an OBLB service. For more information, see Add a load balancer in Manage load balancing.
- OBLB Service Address: The OBLB service address.
- OBLB Service Port: The OBLB service port. The default service port is 9090, which can be changed according to the actual situation.
- Username & Password: The OBLB service username and password, which are used to authenticate the calling of the OBLB interface.
- VIP: The virtual IP address of the OBLB service.
- Access Port: The default access port is 2883, which can be changed according to the actual situation.
- Domain Name Configuration (optional): The configuration that points to the VIP and port. The platform does not provide a mapping between VIPs and domain names, so you must prepare the domain name resolution service by yourself.
Note
The Alibaba Cloud SLB service applies only to the Apsara Stack environment. It is recommended that you contact Technical Support for assistance.Access URL The access URL of the ODP cluster. It is only used to generate a connection string for the tenant. You must manually configure load balancing. This parameter is displayed only when Load balancing management is disabled. If the access URL is a virtual IP address (VIP), you must manually apply for a VIP and bind it to the ODP server. Access Port Number The access port of the ODP cluster. You must enter the actual port based on the VIP. The default value is 2883. This parameter is displayed only when Load balancing management is disabled. Startup Method The startup method of the ODP cluster. Valid values are as follows: - ConfigUrl: The multi-cluster startup method, where the ODP cluster can access multiple OceanBase clusters.
- RsList: The single-cluster startup method. The ODP cluster can only access the OceanBase cluster specified when the ODP cluster is created. After an ODP cluster is created, no more connectable OceanBase clusters can be added.
Select Accessible OceanBase Clusters The OceanBase cluster that the ODP cluster can access. - This field is optional when Startup Method is ConfigUrl. After the cluster is created, you can add more OceanBase clusters by referring to Add a connectable OceanBase cluster.
- This field is mandatory when Startup Method is RsList. Select an OceanBase cluster from the drop-down list.
- If the password box contains the credentials of the proxyro user of the cluster, the proxyro user is selected by default.
- If the password box does not contain the credentials of the proxyro user of the cluster, click Create Connection to create the connection credentials for the proxyro user of the cluster.
Deploy OBProxy (optional)
If you want to deploy ODP when you create an ODP cluster, proceed to this step. Otherwise, you can skip this step; after the cluster is created, you can add an ODP to the cluster by taking over an ODP or adding an ODP. For more information, see Take over an ODP or "Step 3: Add an ODP" below.
The following figure shows parameters on the Deploy OBProxy tab.

The following table describes the parameters.
Parameter Description SQL Port Number The default port is 2883. Exporter Port Number The default port is 2884. Software Version The ODP version to install. Note
If the Connectable OceanBase Cluster drop-down list contains OceanBase clusters whose versions are V4.0 or later, you can only select an ODP software package whose version is V4.0.0 or later.IDC The IDC of the host used to deploy ODP. If the IDC you need is not available, click Create IDC in the drop-down list. Host Type (Optional) The type of the host used to deploy ODP. If the host type you need is not available, click Create Host Type in the drop-down list. Host The host used to deploy ODP. If the host you need is not available, click Add Host in the drop-down list. Note
By default, the system displays two host options for deploying two ODPs. To deploy more ODPs, click Add OBProxy to add more hosts. If you want to deploy only one ODP, click the Delete icon to delete a host.
Parameter Settings
On the Parameter Settings tab, add or modify startup parameters and other parameters. For more information, see Configuration parameter.

Click Submit to start creating the ODP cluster.
Step 3: Add an ODP
After you create an ODP cluster, perform the following to add an ODP to the cluster:
Log in to OCP.
In the left-side navigation pane, click OBProxy.
In the cluster list, click the name of the target ODP cluster to go to the Overview page.
Click Add OBProxy in the upper-right corner.
In the dialog box that appears, specify the following parameters: Software Version, SQL Port Number, Exporter Port Number, IDC, Host Type (Optional), and Host. The following table describes the parameters.

Parameter Description Software Version The ODP version to install. Note
If the Connectable OceanBase Cluster drop-down list contains OceanBase clusters whose versions are V4.0 or later, you can only select an ODP software package whose version is V4.0.0 or later.SQL Port Number The default port is 2883. Exporter Port Number The default port is 2884. IDC The IDC of the host used to deploy ODP. If the IDC you need is not available, click Create IDC in the drop-down list. Host Type (optional) The type of the host used to deploy ODP. If the host type you need is not available, click Create Host Type in the drop-down list. Host The host used to deploy ODP. If the host you need is not available, click Add Host in the drop-down list. Note
If the version of the ODP cluster is V4.0 or later, you can only select an ODP software package whose version is V4.0.0 or later.
If the version of the ODP cluster is V3.x or earlier, you can only select an ODP software package whose version is later than V1.8.0 but earlier than V4.0.0.
If no ODP is added to or taken over by the ODP cluster, you can specify the SQL port and Exporter port when you add an ODP to the cluster. By default, if an ODP already exists in the ODP cluster, the SQL port and Exporter port are those configured during ODP deployment when you create the ODP cluster and cannot be modified.
Click OK.