OceanBase Database Proxy, abbreviated as ODP and also known as OBProxy, is a database proxy middleware provided by OceanBase. It can be used for connection pool management, load balancing, failover, and other features. OBProxy is an optional component, and whether to deploy it depends on your application requirements and scenarios.
This topic mainly describes how to create an OBProxy cluster using OCP.
Note
- This section uses OCP V4.5.0 as an example. The operation interface may vary by OCP version. Please refer to the actual interface.
- After OBProxy is deployed on any machine, it provides OceanBase proxy services by exposing an IP address and port. Users can access OceanBase AI Database through this IP address and port just like accessing a MySQL database. It is generally recommended to deploy it on OBServer nodes.
- It is recommended to deploy only one OBProxy service on a single machine and use the standard 2883 port. If multiple OBProxy services are deployed on the same machine, different ports must be specified to distinguish them.
Prerequisites
- You have deployed OCP. For more information, see Deploy OCP.
- The currently logged-in user has the
OBPROXY_MANAGERrole or has the permissions to manage OBProxy. For more information, see Role overview and Default OCP roles. - You have obtained the OBProxy RPM package. For more information, see Prepare installation packages.
Procedure
Log in to OCP.
In the left navigation bar, click OBProxy under Component.
On the OBProxy page, click Create OBProxy Cluster in the upper-right corner.
On the Create OBProxy Cluster page, configure the Basic Settings.
ParameterDescriptionCluster Name Customize the cluster name according to your business requirements. It must start with an English letter and can contain English letters, numbers, and underscores. Software Version Select the OBProxy version to install. You need to choose an OBProxy software package of V4.0.0 or later. root@proxysys Password The root@proxysys account is used to log in to OBProxy for managing parameters of the proxy itself. Set a password for this account here. A custom password or a randomly generated one is supported. The password must meet the following complexity requirements: - It must be 8 to 32 characters long.
- It must contain at least three of the four types: digits (0-9), uppercase letters (A-Z), lowercase letters (a-z), and special characters. Supported special characters are
~!@#%^&*_-+=|(){}[]:;,.?/.
Load Balancing Management Disabled by default.
- When Load Balancing Management is disabled, the following information must be configured:
- Access Address: The access address of the OBProxy cluster, used only to generate tenant connection strings and does not affect actual usage. If a VIP address is used, you must request and bind it to the OBProxy server yourself.
- Defaults to 2883 and can be customized.
- When load balancing management is enabled, the following information must be configured:
- Load Balancer: Defaults to OBLB. Alibaba Cloud SLB is only applicable to private cloud environments. It is recommended to contact technical support for assistance.
- OBLB Service: You can select an existing OBLB service configured when OCP was deployed, or click Add OBLB Service to create one in the right-side panel.
- VIP: Select the specific VIP address of the OBLB.
- Access Port: Defaults to 2883 and can be customized.
- Domain Configuration (Optional): Used to map the VIP and port. The platform does not provide a mapping between VIPs and domain names, so you must prepare DNS resolution yourself.
Startup Method The startup method for this OBProxy cluster. Possible values are: - ConfigUrl: Multi-cluster startup mode. The OBProxy cluster can access multiple OceanBase AI Database clusters.
- RsList: Single-cluster startup mode. The OBProxy cluster can access only the OceanBase AI Database cluster specified when the OBProxy cluster is created. After the OBProxy cluster is created, additional connectable OceanBase AI Database clusters cannot be added.
Select Connectable OceanBase Cluster Select the OceanBase AI Database cluster that this OBProxy cluster can access. Only OceanBase AI Database clusters on the same network as this OBProxy cluster can be selected. - This parameter is optional when Startup Method is configured as ConfigUrl.
- This parameter is required when Startup Method is configured as RsList. Select the corresponding cluster from the drop-down list.
- If the password vault already contains the connection credentials of the cluster’s proxyro user, that user is selected by default.
- If the password vault does not contain the connection credentials of the cluster’s proxyro user, click Create Connection to create connection credentials for that cluster’s proxyro user.
(Optional) On the Create OBProxy Cluster page, configure Deploy OBProxy.
If you want to deploy OBProxy while creating the OBProxy cluster, configure it in this step. Otherwise, you can skip this step and add OBProxy to the cluster later through Take Over OBProxy or Add OBProxy after the cluster is created.
Turn on Deploy OBProxy and fill in the deployment information according to the following table:
ParameterDescriptionData Center The data center where the OBProxy resides. An OBProxy can exist only in one data center. Host Type (Optional) Optional. If you select a host type, the subsequent host list will be filtered accordingly. Select OBProxy Host Select the host for deploying the OBProxy.
By default, two host slots are shown, which is sufficient to deploy two OBProxy instances. If you need to deploy more, click Add OBProxy to add more hosts. If you want to deploy only one OBProxy, click the delete icon next to a host as shown above to remove it.(Optional) On the Create OBProxy Cluster page, configure the Parameter Settings.
Open Parameter Settings to add or modify startup parameters and other parameters.
Open Custom Configuration to configure the cluster port, the primary user of the operating system, and paths.
ParameterDescriptionSQL Port Default is 2883, supports custom ports. RPC Port Default is 2885, supports custom ports. Exporter Port Default is 2884, supports custom ports. Primary User of Operating System The operating system user used to install and run OBServer. This field cannot be edited. You can adjust the default configuration using the system parameter ocp.operation.default.os.user. For details, see Modify system parameters.Software Installation Path - When Primary User of Operating System is admin, Software Installation Path defaults to
/home/admin/obproxy, supports custom paths. - When Primary User of Operating System is non-admin, Software Installation Path defaults to
/opt/oceanbase/obproxy, supports custom paths.
Note
After modifying the
ocp.operation.default.os.userparameter, the change takes effect only for creating distributed clusters, creating OBProxy clusters, and creating arbitration services. It does not affect other configurations of existing clusters.- When Primary User of Operating System is admin, Software Installation Path defaults to
After completing the configuration, click Submit in the lower-right corner.
References
For more information about creating an OBProxy cluster using OCP, see Create an OBProxy cluster.