Set up an OceanBase Community Edition test environment with obd

右侧logo

This article walks you through deploying OceanBase Community Edition on a cloud server with OceanBase Deployer (obd), creating and managing tenants, and running benchmarks such as Sysbench and TPC-H. By the end, you’ll have a working test environment and a repeatable way to evaluate OceanBase performance across different workloads and scenarios.

Warning
Test environment only
—don't use this in production. For production, follow the high-availability cluster configuration.

Key concepts

TermDescription
obdOceanBase Deployer—the OceanBase installation and deployment tool.
OBServer nodeThe host where the OceanBase database server process runs.
OBClientThe OceanBase command-line client.
TenantOceanBase's unit of resource and access isolation. Use a dedicated user tenant for load testing. All workloads must run under a user tenant. The sys tenant must not be used for workload—it is for system management only.


Environment requirements

To run OceanBase stably and obtain effective performance data, use cloud instances that meet the following specifications:

  • Instance type: General-purpose or compute-optimized
  • CPU: At least 16 cores
  • Memory: 32 GiB or more
  • EBS volume: General-purpose SSD (gp2/gp3) or provisioned IOPS SSD (io1/io2)
  • Volume size: At least 200 GiB per volume
  • Performance: Baseline or higher (gp2/gp3), or use provisioned IOPS (io1/io2) for consistent high performance
  • Operating system: CentOS 8
Note:
Use separate disks for the installation directory, log directory, and data directory when possible.

Test setup

To get reliable benchmark results, deploy OceanBase on a dedicated node. This guide uses two machines: 10.10.10.1 (benchmark client—obd and benchmark tools) and 10.10.10.2 (single-node OceanBase).

Benchmark client requirements depend on total OceanBase CPU cores:

OceanBase total coresBenchmark client
≤ 47 cores8 cores, 64 GB RAM
48–72 cores16 cores, 128 GB RAM
≥ 73 cores32 cores, 128 GB RAM
Note:
- All commands in this guide are run on the benchmark client (10.10.10.1).
- For TPC-C or sysbench, the client needs more resources to drive enough concurrent requests. For TPC-H only, 8 cores and 64 GB on the client are sufficient.


Deploy the test environment

Step 1: Install the software

Install the OceanBase All-in-One package. It includes all components required for deployment (except obbinlog), is tested for compatibility, and is the recommended distribution.

Online installation

If the machine has network access, run:

bash -c "$(curl -s https://obportal.s3.ap-southeast-1.amazonaws.com/download-center/opensource/sh/installer.sh)"
source ~/.oceanbase-all-in-one/bin/env.sh

After installation, a new directory such as tmp.jvzpVREAs9 is created under /tmp.

Offline installation

If the machine has no network access:

1. Download the latest OceanBase All-in-One package from the OceanBase Software Center and copy it to the benchmark client. Use the latest version when possible.

Note
The procedures below use obd V4.2.0. Install an OceanBase All-in-One package that includes obd V4.2.0 (for example, V4.5.0).

2. In the directory containing the package, extract and install:

tar -xzf oceanbase-all-in-one-*.tar.gz
cd oceanbase-all-in-one/bin/
./install.sh
source ~/.oceanbase-all-in-one/bin/env.sh

Step 2: Initialize the OBServer node

Run the following to replace the user, host, and password with your values. The user must be able to connect to the target host and have sudo privileges.

obd host init root 10.10.10.2 -p ***** -u admin
  • -p — Password for the login user on the target host (10.10.10.2). Optional if SSH key-based login is already configured.
  • -u — User that the init command will modify; defaults to the login user if omitted.

Expected output:

get system config ok
+-------------------------------------------------------------------------------------------------+
|                                   System Parameter Change List                                  |
+---------------+-------------------------------------------+---------------+---------------------+
| ip            | name                                      | current_value | expected_value      |
+---------------+-------------------------------------------+---------------+---------------------+
| 10.10.10.2    | fs.aio-max-nr                             | 65536         | 1048576             |
| 10.10.10.2    | net.core.somaxconn                        | 128           | 2048                |
| 10.10.10.2    | net.core.netdev_max_backlog               | 1000          | 10000               |
| 10.10.10.2    | net.core.rmem_default                     | 212992        | 16777216            |
| 10.10.10.2    | net.core.wmem_default                     | 212992        | 16777216            |
| 10.10.10.2    | net.core.rmem_max                         | 212992        | 16777216            |
| 10.10.10.2    | net.core.wmem_max                         | 212992        | 16777216            |
| 10.10.10.2    | net.ipv4.conf.default.rp_filter           | 0             | 1                   |
| 10.10.10.2    | net.ipv4.tcp_rmem                         | 6291456       | 4096 87380 16777216 |
| 10.10.10.2    | net.ipv4.tcp_wmem                         | 16384         | 4096 65536 16777216 |
| 10.10.10.2    | net.ipv4.tcp_max_syn_backlog              | 1024          | 16384               |
| 10.10.10.2    | net.ipv4.tcp_fin_timeout                  | 60            | 15                  |
| 10.10.10.2    | vm.min_free_kbytes                        | 67584         | 2097152             |
| 10.10.10.2    | fs.file-max                               | 3205772       | 6573688             |
| 10.10.10.2    | fs.pipe-user-pages-soft                   | 16384         | 0                   |
| 10.10.10.2    | vm.max_map_count                          | 65530         | 655360              |
| 10.10.10.2    | nofile                                    | 65535         | 655350              |
+---------------+-------------------------------------------+---------------+---------------------+
disable transparent_hugepage ok
modify system parameters
10.10.10.2: ( fs.aio-max-nr,net.core.somaxconn,net.core.netdev_max_backlog,net.core.rmem_default,net.core.wmem_default... ) have been successfully modified!
You must reboot the following servers to ensure the ulimit parameters take effect: (10.10.10.2).
Trace ID: f9491158-71db-11f0-81f0-00163e513302
If you want to view detailed obd logs, please run: obd display-trace f9491158-71db-11f0-81f0-00163e513302

Step 3: Deploy an OceanBase cluster

obd perf -c oceanbase-ce --server=10.10.10.2 --username=admin --password=****** \
         --oceanbase-ce.home_path=/home/admin/perf \
         --oceanbase-ce.data_dir=/data \
         --oceanbase-ce.redo_dir=/redo

This deploys an OceanBase cluster named perf on 10.10.10.2 under user admin, with installation directory /home/admin/perf, data directory /data, and redo log directory /redo. Adjust these to match your environment. The user must be able to connect to the target host and have read/write access to the specified directories.

Parameters:

ParameterDescription
-cComponent(s) to deploy; use a comma to list multiple.
--serverIP of the host where the cluster will run. Defaults to the current host if omitted.
--usernameSSH user name. Defaults to the current user if omitted.
--passwordLogin password for the SSH user. If using key-based SSH, you can omit this and use --key-file instead.
--key-fileAbsolute path to the SSH private key for passwordless authentication.
--oceanbase-ce.<parameter>Custom OceanBase database configuration.
Note
- The parameters --server, --username, --password, and --key-file are available in obd V4.2.0 and later. Confirm your obd version before running the command.
- Use either --password or --key-file for authentication, not both.

When prompted Scenario not specified, please specify the scenario you want, choose the workload type that matches your test:

  • For sysbench: choose express_oltp.
  • For TPC-H: choose olap.

Expected output:

cluster scenario: express_oltp
Start observer ok
observer program health check ok
Connect to observer 10.10.10.2:2881 ok
oceanbase bootstrap ok
obshell start ok
obshell program health check ok
obshell bootstrap ok
Connect to observer 10.10.10.2:2881 ok
Wait for observer init ok
+------------------------------------------------+
|                  oceanbase-ce                  |
+--------------+---------+------+-------+--------+
| ip           | version | port | zone  | status |
+--------------+---------+------+-------+--------+
| 10.10.10.2   | 4.5.0.0 | 2881 | zone1 | ACTIVE |
+--------------+---------+------+-------+--------+
obclient -h10.10.10.2 -P2881 -uroot@sys -p'********' -Doceanbase -A

cluster unique id: f9c65fef-c988-508f-8e8f-a6e23719a8ac-19bf9b6c2b4-00000504

obshell program health check ok
display obshell dashboard ok
+---------------------------------------------------------+
|                    obshell Dashboard                    |
+--------------------------+------+--------------+--------+
| url                      | user | password     | status |
+--------------------------+------+--------------+--------+
| http://10.10.10.2:2886   | root | '********'   | active |
+--------------------------+------+--------------+--------+

perf running
Trace ID: 7e194d14-fa9c-11f0-8937-00163e36e6b6
If you want to view detailed obd logs, please run: obd display-trace 7e194d14-fa9c-11f0-8937-00163e36e6b6

Run the sysbench test

Step 1: Create a test tenant

After the cluster is created, only the sys tenant exists. The sys tenant is for cluster administration only; do not use it for benchmarks. Create a dedicated tenant for load testing.

Create a sysbench tenant

obd cluster tenant create perf -n sysbench_tenant -o express_oltp
  • -n — Tenant name. Defaults to test if omitted.
  • -o — Workload type. Use express_oltp for sysbench.

Expected output:

Get local repositories ok
Open ssh connection ok
Connect to observer 10.10.10.2:2881 ok
Create tenant sysbench_tenant ok
obclient -h10.10.10.2 -P'2881' -p'' -uroot@sysbench_tenant -Doceanbase -A

optimize tenant with scenario: express_oltp ok
Set tenant whitelist ok
Trace ID: f5851a12-fa9d-11f0-8143-00163e36e6b6
If you want to view detailed obd logs, please run: obd display-trace f5851a12-fa9d-11f0-8143-00163e36e6b6

Step 2: Run sysbench

obd test sysbench perf \
  --tenant=sysbench_tenant \
  --script-name=oltp_point_select.lua,oltp_read_only.lua,oltp_write_only.lua,oltp_read_write.lua \
  --table-size=1000000 \
  --tables=30 \
  --threads=32,64,128,256,512,1024 \
  --rand-type=uniform \
  --time=60
  
Note
Running sysbench through obd requires OBClient and ob-sysbench. The command installs them automatically if they are not present.

Parameters:

ParameterDescription
--tenantTenant used for the test.
--script-nameSysbench script(s); comma-separated for multiple.
--table-sizeNumber of rows initialized per table.
--tablesNumber of tables initialized.
--threadsConcurrent thread counts; comma-separated list.
--rand-type=uniformUniform random distribution to avoid hot spots and balance load.
--timeDuration in seconds for each phase.


Step 3: Destroy the cluster

After sysbench is done, you can destroy the cluster before running other tests.

Warning
This action is irreversible. It stops the observer process and removes database files.
obd cluster destroy perf

Run the TPC-H test

Deploy an OceanBase cluster for TPC-H by following Step 3: Deploy an OceanBase cluster in the above section Deploy the test environment. When prompted for scenario, choose olap. Then use the steps below to create a tenant and run TPC-H.

Step 1: Create a test tenant

Create a TPC-H tenant

obd cluster tenant create perf -n tpch_tenant -o olap
  • -n — Tenant name. Defaults to test if omitted.
  • -o — Workload type. Use olap for TPC-H.

Expected output

Output is similar to the sysbench tenant creation; omitted here.

Step 2: Run TPC-H

obd test tpch perf \
  --tenant=tpch_tenant \
  --scale-factor=10 \
  --remote-tbl-dir=/tmp/tpch10
  
Note
Running TPC-H through obd requires OBClient and obtpch. The command installs them automatically if they are not present.

Parameters:

ParameterDescription
--tenantTenant used for the test.
--scale-factorTest data size in GiB (e.g. 10 for about 10 GiB).
--remote-tbl-dirDirectory to store .tbl files. It must be set to an absolute path, and the user who started the OBServer node must have read and write permissions to this directory.


ICON_SHARE
ICON_SHARE
linkedin
Contact Us