Deploying OceanBase on Ubuntu Using OBD (Ob‑Deploy) – A Step‑by‑Step Guide
This article provides a detailed, step‑by‑step tutorial on installing and configuring an OceanBase 4.0 cluster on Ubuntu 22.04 using the OBD (ob‑deploy) tool, covering prerequisite hardware, required commands, configuration file creation, deployment, startup, and basic verification.
The author, a senior database expert, explains that OceanBase officially supports only CentOS in its remote repository, making deployment on Ubuntu or Debian inconvenient.
Available deployment methods for OceanBase
1. OCP platform
Requires high‑end hardware (e.g., 32 CPU cores, 128 GB RAM, 1.5 TB SSD) and is not suitable for casual testing.
2. OBD (ob‑deploy) tool
Works on any OS that meets OceanBase hardware requirements; can run on a minimal 2 CPU, 8 GB RAM machine, making it a “poor‑man” deployment option.
3. Docker
Lowest hardware demands and OS‑agnostic, also suitable for lightweight setups.
4. Manual RPM installation
Involves downloading the RPM package and manually handling scripts and initialization; on Ubuntu it requires the alien tool to convert RPMs, which can be error‑prone.
The author chooses method 2 (OBD) on Ubuntu 22.04.1 LTS with OceanBase 4.0, which bundles all installation files into oceanbase-all-in-one.tar.gz and includes an automated shell script for one‑click installation.
Step 1: Create data and redo directories
root@ytt-pc:/home# mkdir -p /data/1 /data/log1
root@ytt-pc:/home# chown -R admin.admin /data/1 /data/log1/Step 2: Extract the tarball and run the install script
root@ytt-pc-super:/home/ytt/下载/oceanbase-all-in-one/bin# ./install.sh
...
add /home/ytt/下载/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror
Disable remote ok
...
Setup Environment: source ~/.oceanbase-all-in-one/bin/env.sh
Quick Start: obd demo
More Details: obd -hAfter successful installation, the local package list can be inspected:
root@ytt-pc-super:~# obd mirror list local
+------------------------------------------+
| local Package List |
+-------------------+---------+------------+--------+------------------------------------------+
| name | version | release | arch | md5 |
+-------------------+---------+------------+--------+------------------------------------------+
| grafana | 7.5.17 | 1 | x86_64 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| obagent | 1.2.0 | 4.el7 | x86_64 | 0e8f5ee68c337ea28514c9f3f820ea546227fa7e |
| obproxy-ce | 4.0.0 | 5.el7 | x86_64 | de53232a951184fad75b15884458d85e31d2f6c3 |
| oceanbase-ce | 4.0.0 | 100000272022110114.el7 | x86_64 | 42611dc51ca9bb28f36e60e4406ceea4a74914c7 |
| ... (other packages omitted) |
+------------------------------------------+Step 3: Create a simple 1‑0‑0 configuration file (obytt100.yaml)
root@ytt-pc-super:/home/ytt/config# cat obytt100.yaml
oceanbase-ce:
servers:
- 127.0.0.1
global:
memory_limit: 9G
system_memory: 3G
datafile_size: 30G
log_disk_size: 30G
devname: lo
cpu_count: 32
production_mode: false
cluster_id: 100
cluster: obytt100
appname: obytt100
127.0.0.1:
mysql_port: 2881
rpc_port: 2882
home_path: /home/admin/oceanbase-ce
data_dir: /data/1
redo_dir: /data/log1
zone: zone1
obproxy-ce:
servers:
- 127.0.0.1
global:
home_path: /home/admin/obproxy-ce
skip_proxy_sys_private_check: true
enable_strict_kernel_release: false
proxy_mem_limited: 2G
prometheus_listen_port: 2884
listen_port: 2883
127.0.0.1:
enable_cluster_checkout: false
depends:
- oceanbase-ceStep 4: Deploy the cluster with OBD
root@ytt-pc-super:/home/ytt/config# obd cluster deploy obytt100 -c obytt100.yaml
[WARN] Use centos 7 remote mirror repository for ubuntu 22.04
...
obytt100 deployedStep 5: Start OceanBase and OBProxy
root@ytt-pc-super:/home/ytt/config# obd cluster start obytt100
...
Start obproxy ok
obproxy program health check ok
Connect to obproxy ok
Initialize cluster ok
Wait for observer init ok
+---------------------------------------------+
| observer |
+-----------+---------+------+-------+--------+
| ip | version | port | zone | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 4.0.0.0 | 2881 | zone1 | ACTIVE |
+---------------------------------------------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase
...
+---------------------------------------------+
| obproxy |
+-----------+------+-----------------+--------+
| ip | port | prometheus_port | status |
+-----------+------+-----------------+--------+
| 127.0.0.1 | 2883 | 2884 | active |
+---------------------------------------------+
obclient -h127.0.0.1 -P2883 -uroot -Doceanbase
obytt100 runningStep 6: Verify the deployment
root@ytt-pc-super:/home/ytt/config# obclient -h127.1 -P2883 -uroot@sys#obytt100 -e "show databases"
+--------------------+
| Database |
+--------------------+
| information_schema |
| LBACSYS |
| mysql |
| oceanbase |
| ORAAUDITOR |
| SYS |
| test |
+--------------------+Conclusion
Deploying an OceanBase cluster on non‑CentOS/RedHat Linux requires using the OBD tool to bypass the remote CentOS repository and install the software locally.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.