Databases 7 min read

Deploying OceanBase 4.X as a Minimal Single‑Node Distributed Database

This article demonstrates how to deploy OceanBase 4.X in a minimal single‑node configuration, explains the key resource parameters, provides the necessary YAML configuration and command‑line steps to start the server, create a MySQL‑compatible tenant, and verify resource usage and basic database operations.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
Deploying OceanBase 4.X as a Minimal Single‑Node Distributed Database

OceanBase 3.X required substantial hardware for a single‑zone deployment, while the 4.X release claims a lightweight single‑node distributed architecture that matches the performance of a traditional single‑machine database. The article walks through a hands‑on deployment of OceanBase 4.X on a single server.

Key configuration parameters

The OBD configuration file sets memory_limit to 4G (total memory for all tenants), system_memory to 1G (system tenant), leaving 3G for business tenants. __min_full_resource_pool_memory must be at least 1G to avoid the error "unit MEMORY_SIZE less than __min_full_resource_pool_memory not supported". cpu_count is set to 2, allocating one core to the system tenant and one to business tenants.

oceanbase-ce:
  servers:
    - name: ob1
      ip: 127.0.0.1
  global:
    syslog_level: WARN
    enable_syslog_recycle: true
    max_syslog_file_count: 1
    __min_full_resource_pool_memory: 1073741824
    memory_limit: 4G
    system_memory: 1G
    datafile_size: 20G
    log_disk_size: 24G
    devname: lo
    cpu_count: 2
    production_mode: false
    cluster_id: 1
    appname: obytt100
    mysql_port: 2881
    rpc_port: 2882
    data_dir: /ob_data/1
    redo_dir: /ob_log/1
    home_path: /home/admin/oceanbase/1
    zone: z1

Running obd cluster display obytt100 shows a single active observer (127.0.0.1:2881) that can be accessed with the standard MySQL client.

[root@ytt-pc scripts]# obclient -h127.0.0.1 -P2881 -uroot -Doceanbase

To create a MySQL‑compatible tenant, the article executes:

create resource unit ut1 max_cpu 1,memory_size '1G',max_iops 1024;
create resource pool p1 unit 'ut1',unit_num 1;
create tenant mysql resource_pool_list=('p1') set ob_tcp_invited_nodes='%';

Querying __all_unit_config confirms that the system tenant consumes 2 GB and the new tenant consumes 1 GB, reaching the configured memory_limit. Subsequent checks of gv$ob_servers show that both CPU and memory are fully allocated.

select name,max_cpu,round(memory_size/1024/1024/1024,2) 'memory_size_GB' from __all_unit_config;
select svr_ip,svr_port,zone,round((cpu_capacity_max-cpu_assigned_max),2) 'cpu_free_num',cpu_capacity_max 'cpu_total_num',round((mem_capacity-mem_assigned)/1024/1024/1024,2) 'mem_free_GB', round(memory_limit/1024/1024/1024,2) 'mem_total_GB' from gv$ob_servers;

Finally, a database and table are created using a single MySQL command, demonstrating that the single‑node OceanBase instance behaves like a regular MySQL server.

obclient -h127.0.0.1 -P2881 -uroot@mysql -Doceanbase -cA -e "create database ytt;use ytt;create table t1(id int primary key);"

If the system reports "No memory or reach tenant memory limit", the article suggests manually dumping data to free memory.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

SQLResource ManagementMySQL compatibilityOceanBaseDatabase ConfigurationSingle-Node Deployment
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

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.