Databases 11 min read

Step-by-Step Deployment of OceanBase OBproxy and Config Server

This guide walks through preparing the environment, building and launching the OceanBase Config Server, registering it with an OB server cluster, installing and configuring OBproxy, and includes troubleshooting tips for common connection issues.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
Step-by-Step Deployment of OceanBase OBproxy and Config Server

Introduction

The article assumes familiarity with OBproxy and explains that from version 3.1.3 OceanBase provides the Config Server source code, enabling community editions to use features previously exclusive to OCP, such as dynamic root service refresh without restarting the proxy.

Prerequisites

Golang 1.17+ for compiling the Config Server.

A deployed OceanBase database cluster (example version: oceanbase-ce 3.1.4).

Package oceanbase-obproxy-ce-3.2.3.5-2.el7.x86_64.rpm .

Deploy Config Server

3.1 Download OceanBase source

git clone https://github.com/oceanbase/oceanbase.git

Navigate to oceanbase/tools/ob-configserver where the required files reside.

3.2 Edit ./etc/config.yaml

Modify the following sections:

server.address : IP and port for the Config Server.

vip.address : VIP address (use OBproxy/OBserver reachable IP if single node).

storage.connection_url : MySQL connection string; the table is auto‑created, but the database must exist.

## server config
server:
address: "0.0.0.0:8080"
run_dir: run
## vip config
vip:
address: "127.0.0.1"
port: 8080
## storage config
storage:
database_type: mysql
connection_url: "user:password@tcp(127.0.0.1:3306)/oceanbase?parseTime=true"

3.3 Compile binary

# Default build creates a debug version; for release use make build-release
root@ubuntu: make build
GO111MODULE=on GOPROXY=https://mirrors.aliyun.com/goproxy/,direct go build -p 2 -race -ldflags '-X "github.com/oceanbase/configserver/config.Version=1.0" -X "github.com/oceanbase/configserver/config.BuildTimestamp=2022-12-21 06:07:53" -X "github.com/oceanbase/configserver/config.GitBranch=master" -X "github.com/oceanbase/configserver/config.GitHash=873c59f5fe834d87fc0252f4522281f3e4e6ceea" -X "github.com/oceanbase/configserver/config.Mode=debug" -X "github.com/oceanbase/configserver/config.CurProcess=ob-configserver"' -o bin/ob-configserver cmd/main.go

3.4 Start Config Server

root@ubuntu: nohup ./bin/ob-configserver -c ./etc/config.yaml &

Verify startup by checking logs or the ob_clusters table for initialization records.

Register Config Server with OB Server Cluster

4.1 Create proxyro user on OB server

$ obclient -h172.20.134.2 -uroot@sys -P2881 -p -c -A oceanbase
obclient> CREATE USER proxyro IDENTIFIED BY '123456';
obclient> GRANT SELECT ON *.* TO proxyro;

4.2 Set ConfigURL

obclient [oceanbase]> ALTER SYSTEM SET obconfig_url = 'http://192.168.2.42:8088/services?Action=ObRootServiceInfo&ObCluster=obcluster';

4.3 Refresh Config Server configuration

The OB server will automatically push updates when the root service list changes or every ten minutes.

obclient [oceanbase]> ALTER SYSTEM SWITCH ROOTSERVICE LEADER server '172.20.134.2:2882';

4.4 Verify registration

Query the ob_clusters table; presence of the new entry confirms successful registration.

Deploy OBproxy

5.1 Create admin user and group

# groupadd --force admin
# id admin (if missing)
# useradd -M -g admin admin

5.2 Install RPM package

sh-4.2# rpm -ivh --force oceanbase-obproxy-ce-3.2.3.5-2.el7.x86_64.rpm

5.3 Start OBproxy process

Required parameters:

obproxy_config_server_url – URL of the Config Server.

observer_sys_password – SHA1 of the proxyro password.

bash-4.2$ ./bin/obproxy -p 2883 -n mycluster -o "prometheus_sync_interval=1s,obproxy_config_server_url=http://172.20.134.1:8088/services?Action=GetObProxyConfig&ObproxyClusterName=mycluster,observer_sys_password=7c4a8d09ca3762af61e59520943dc26494f8941b"

5.4 Verify parameters

# Check config URL
strings ./etc/obproxy_config.bin | grep "obproxy_config_server_url"
# Check observer password
strings ./etc/obproxy_config.bin | grep "observer_sys_password"

Connection Test

bash-4.2$ obclient -h172.20.134.3 -P2883 -uroot@sys#obcluster -p -c -A oceanbase
obclient [oceanbase]> SELECT SYSDATE();

Troubleshooting

7.1 Password error

Confirm observer_sys_password value matches the SHA1 of the proxyro password.

Ensure the proxyro account exists on OBserver with correct password and SELECT privilege.

7.2 "curl easy perform failed" error

Do not wrap the obproxy_config_server_url value in single quotes for version 3.2.3.5.

SQLDevOpsOceanBaseDatabase DeploymentOBproxyConfig Server
Aikesheng Open Source Community
Written by

Aikesheng Open Source Community

The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.