暂无图片
暂无图片
5
暂无图片
暂无图片
暂无图片

OBD 部署 OceanBase 数据库单机版

原创 飞天 2026-02-24
597

前言

本文主要讲述使用OBD 部署 OceanBase 数据库单机版的过程,供有需要的朋友参考。仅部署 OceanBase 数据库,至少需要 2vCPU、6 GB 内存、20 GB 磁盘的可用资源。

软件下载

下载地址:https://www.oceanbase.com/softwarecenter

OceanBase社区版一键安装包 (OceanBase All in One)下载:
image.png
OceanBase 从 V4.0.0 开始提供统一的安装包 OceanBase All in One。目前包括 OceanBase 数据库软件和 OCP、obd、OBProxy(又称为 ODP)、OBClient、Prometheus、Grafana,以及诊断和测试工具。
OBD软件包单独下载:
image.png

组件介绍

  • obd
    OceanBase Deployer,OceanBase 安装部署工具,简称为 obd。详细信息请参考官网文档 OceanBase 安装部署工具。
  • ODP
    OceanBase Database Proxy,OceanBase 数据库代理,是 OceanBase 数据库专用的代理服务器,简称为 ODP(又称为 OBProxy)。OceanBase 数据库用户的数据会以多副本的形式存放在各个 OBServer 节点上,ODP 接收用户发出的 SQL 请求,并将 SQL 请求转发至最佳目标 OBServer,最后将执行结果返回给用户。ODP 的核心特性包括:连接管理、最佳路由、高性能转发、易运维、高可用,具有专有协议。详细信息请参考官网文档 OceanBase 数据库代理。
  • OBAgent
    OBAgent 是 OceanBase 数据库监控采集框架,支持推、拉两种数据采集模式,可以满足不同的应用场景。
  • Grafana
    Grafana 是一款开源的数据可视化工具,它可以将数据源中的各种指标数据进行可视化展示,以便更直观地了解系统运行状态和性能指标。详细信息可参见 Grafana 官网。
  • Prometheus
    Prometheus 是一个开源的服务监控系统和时序数据库,其提供了通用的数据模型以及快捷数据采集、存储和查询接口。详细信息可参见 Prometheus 官网。

安装要求

硬件环境要求

软件环境要求

服务器说明

主机名 ip地址 OS版本 内存、CPU、硬盘 数据库端口
ocean 192.*.*.60 Centos7.9 6G 、 1个双核、300G 2881

部署单机版

操作系统配置

关闭防火墙

systemctl disable firewalld.service systemctl stop firewalld.service systemctl status firewalld

关闭SELINUX

sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config ##临时生效 setenforce 0

配置/etc/security/limits.conf

cat >> /etc/security/limits.conf <<EOF * soft nofile 655350 * hard nofile 655350 * soft stack unlimited * hard stack unlimited * soft nproc 655360 * hard nproc 655360 * soft core unlimited * hard core unlimited EOF

配置/etc/sysctl.conf

cat >> /etc/sysctl.conf <<EOF # for oceanbase ## 修改内核异步 I/O 限制 fs.aio-max-nr = 1048576 ## 网络优化 net.core.somaxconn = 2048 net.core.netdev_max_backlog = 10000 net.core.rmem_default = 16777216 net.core.wmem_default = 16777216 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 net.ipv4.tcp_max_syn_backlog = 16384 net.ipv4.tcp_fin_timeout = 15 net.ipv4.tcp_slow_start_after_idle = 0 vm.swappiness = 0 vm.min_free_kbytes = 2097152 vm.overcommit_memory = 0 fs.file-max = 6573688 fs.pipe-user-pages-soft = 0 # 修改进程可以拥有的虚拟内存区域数量 vm.max_map_count = 655360 # 此处为 OceanBase 数据库的 data 目录 kernel.core_pattern = /data/core-%e-%p-%t EOF sysctl -p

配置/etc/hosts

cat >> /etc/hosts << EOF 192.*.*.60 ocean EOF

添加用户和组admin

useradd -U admin -d /home/admin -s /bin/bash chown -R admin:admin /home/admin #修改admin用户的密码 #passwd admin echo "******" | passwd --stdin admin

配置sudo权限

root用户执行visudo #找到文件中以下行所在位置: ## Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL #在下面新增一行: admin ALL=(ALL) NOPASSWD: ALL

安装包解压

admin用户操作:

[admin@ocean ~]$ cd /soft [admin@ocean soft]$ tar -xf oceanbase-all-in-one-4.3.5_bp5_hf1_20251215.el7.x86_64.tar.gz

通过 OceanBase All in One 安装 obd

[admin@ocean soft]$ cd oceanbase-all-in-one/bin [admin@ocean bin]$ ls env.sh install.sh uninstall.sh [admin@ocean bin]$ ./install.sh [admin@ocean bin]$ source ~/.oceanbase-all-in-one/bin/env.sh

说明:通过 OceanBase All in One 安装 obd 时,install.sh 脚本默认会尝试以管理员权限安装,若当前用户无 sudo 权限,可在输入密码处输入当前用户密码或单击三次键盘 Enter 键,之后输入 n 选择使用当前用户进行安装。根据使用用户和权限的不同,有如下两种情况:
若您使用 root 用户或者使用普通用户以管理员权限(sudo)进行安装,安装后 obd 可执行文件的目录为 /usr/bin/obd。
若您使用普通用户进行安装,安装后 obd 可执行文件目录为 ~/.oceanbase-all-in-one/obd/usr/bin/obd。

执行过程如下:

[admin@ocean bin]$ ./install.sh install obd as sudo No previous obd installed, try install..., wait a moment name: alertmanager version: 0.28.1 release:32025073111.el7 arch: x86_64 md5: c5fe05fcc8263b83f6d0602a871d7e1a7a79bdb8 size: 69543154 add /soft/oceanbase-all-in-one/rpms/alertmanager-0.28.1-32025073111.el7.x86_64.rpm to local mirror name: grafana version: 7.5.17 release:1 arch: x86_64 md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 size: 177766248 add /soft/oceanbase-all-in-one/rpms/grafana-7.5.17-1.el7.x86_64.rpm to local mirror name: obagent version: 4.2.4 release:200000022025090416.el7 arch: x86_64 md5: bae1154d745991c109af6cb5b151fb2831594df4 size: 72947757 add /soft/oceanbase-all-in-one/rpms/obagent-4.2.4-200000022025090416.el7.x86_64.rpm to local mirror name: ob-configserver version: 1.0.0 release:2.el7 arch: x86_64 md5: feca6b9c76e26ac49464f34bfa0780b5a8d3f4a0 size: 24259515 add /soft/oceanbase-all-in-one/rpms/ob-configserver-1.0.0-2.el7.x86_64.rpm to local mirror name: ob-deploy version: 4.0.0 release:10.el7 arch: x86_64 md5: 76960e2877e13b3c1c7889411ecdfb0bb674c986 size: 215204397 add /soft/oceanbase-all-in-one/rpms/ob-deploy-4.0.0-10.el7.x86_64.rpm to local mirror name: obproxy-ce version: 4.3.5.0 release:3.el7 arch: x86_64 md5: f17b277b681adb1c86bfc3cfda369ad88896da9d size: 123559862 add /soft/oceanbase-all-in-one/rpms/obproxy-ce-4.3.5.0-3.el7.x86_64.rpm to local mirror name: ob-sysbench version: 1.0.20 release:21.el7 arch: x86_64 md5: 34eb6ecba0ebc4c31c4cfa01162045cbbbec55f7 size: 1566511 add /soft/oceanbase-all-in-one/rpms/ob-sysbench-1.0.20-21.el7.x86_64.rpm to local mirror name: obtpcc version: 5.0.0 release:1.el7 arch: x86_64 md5: 8624590be4bfe16f28bdd9fc5e4849cda19577d6 size: 1890344 add /soft/oceanbase-all-in-one/rpms/obtpcc-5.0.0-1.el7.x86_64.rpm to local mirror name: obtpch version: 3.0.0 release:1.el7 arch: x86_64 md5: 3e3e88f87527677998fedf25087f5c87779dee62 size: 1856985 add /soft/oceanbase-all-in-one/rpms/obtpch-3.0.0-1.el7.x86_64.rpm to local mirror name: oceanbase-ce version: 4.2.1.8 release:108000022024072217.el7 arch: x86_64 md5: 499b676f2ede5a16e0c07b2b15991d1160d972e8 size: 457041540 add /soft/oceanbase-all-in-one/rpms/oceanbase-ce-4.2.1.8-108000022024072217.el7.x86_64.rpm to local mirror name: oceanbase-ce version: 4.3.5.5 release:105010032025121323.el7 arch: x86_64 md5: 7a9dd8938978178a63570564d825520dab9a2c8c size: 956587153 add /soft/oceanbase-all-in-one/rpms/oceanbase-ce-4.3.5.5-105010032025121323.el7.x86_64.rpm to local mirror name: oceanbase-ce-libs version: 4.2.1.8 release:108000022024072217.el7 arch: x86_64 md5: d02f4bfd321370a02550424293beb1be31204038 size: 468528 add /soft/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.2.1.8-108000022024072217.el7.x86_64.rpm to local mirror name: oceanbase-ce-libs version: 4.3.5.5 release:105010032025121323.el7 arch: x86_64 md5: 7443d284b3142f00618508f05e0ade8ac1520932 size: 7848 add /soft/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.3.5.5-105010032025121323.el7.x86_64.rpm to local mirror name: oceanbase-ce-utils version: 4.2.1.8 release:108000022024072217.el7 arch: x86_64 md5: 6f87392f95b399a21382323f256cfda5969375c4 size: 403350984 add /soft/oceanbase-all-in-one/rpms/oceanbase-ce-utils-4.2.1.8-108000022024072217.el7.x86_64.rpm to local mirror name: oceanbase-ce-utils version: 4.3.5.5 release:105010032025121323.el7 arch: x86_64 md5: 3b0dbffb3b26dfbd565588fa902a2b886a42227d size: 1700214512 add /soft/oceanbase-all-in-one/rpms/oceanbase-ce-utils-4.3.5.5-105010032025121323.el7.x86_64.rpm to local mirror name: oceanbase-diagnostic-tool version: 3.7.1 release:12025102215.el7 arch: x86_64 md5: d52e8fa03d97b755b6bc3bf6515d0b2f51c4a927 size: 71887826 add /soft/oceanbase-all-in-one/rpms/oceanbase-diagnostic-tool-3.7.1-12025102215.el7.x86_64.rpm to local mirror name: ocp-agent-ce version: 4.4.0 release:20251114143405.el7 arch: aarch64 md5: 6c619c8406abb57771d26e29ea7b0f58d5fed3de size: 134228546 add /soft/oceanbase-all-in-one/rpms/ocp-agent-ce-4.4.0-20251114143405.el7.aarch64.rpm to local mirror name: ocp-agent-ce version: 4.4.0 release:20251114143405.el7 arch: x86_64 md5: f8dd0ebfaa2c2f413fb3eafb922cfabde114d32f size: 190676800 add /soft/oceanbase-all-in-one/rpms/ocp-agent-ce-4.4.0-20251114143405.el7.x86_64.rpm to local mirror name: ocp-server-ce version: 4.4.0 release:20251114143405.el7 arch: noarch md5: f673d693677a2c640f925ad2127a604aaebf00bf size: 491684490 add /soft/oceanbase-all-in-one/rpms/ocp-server-ce-4.4.0-20251114143405.el7.noarch.rpm to local mirror name: openjdk-jre version: 17.0.16_8 release:92025080421.el7 arch: x86_64 md5: ceb2cc6abb2016acb9d13681e5d8c76bab7ddd56 size: 140342516 add /soft/oceanbase-all-in-one/rpms/openjdk-jre-17.0.16_8-92025080421.el7.x86_64.rpm to local mirror name: prometheus version: 2.37.1 release:10000102022110211.el7 arch: x86_64 md5: 58913c7606f05feb01bc1c6410346e5fc31cf263 size: 211224073 add /soft/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror Trace ID: 1e076818-efd7-11f0-be4b-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace 1e076818-efd7-11f0-be4b-00505621a1ea Disable remote ok Trace ID: 2190dd16-efd7-11f0-8be9-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace 2190dd16-efd7-11f0-8be9-00505621a1ea add auto set env logic to profile: /home/admin/.bash_profile ######################################################################################### Install Finished ========================================================================================= Setup Environment: source ~/.oceanbase-all-in-one/bin/env.sh Quick Start: obd demo Use Web Service to install: obd web Use Web Service to upgrade: obd web upgrade More Details: obd -h ========================================================================================= [admin@ocean bin]$ source ~/.oceanbase-all-in-one/bin/env.sh [admin@ocean bin]$

配置obd

1、禁用远程仓库

[admin@ocean bin]$ obd mirror disable remote

2、将安装包添加至本地镜像
oceanbase-all-in-one-4.3.5_bp5_hf1_20251215.el7.x86_64.tar.gz这个版本默认已经将安装包添加至本地镜像库,无需执行。

[admin@ocean bin]$ obd mirror clone *.rpm

3、查看本地镜像中安装包列表

[admin@ocean bin]$ obd mirror list local +---------------------------------------------------------------------------------------------------------------------+ | local Package List | +---------------------------+-----------+------------------------+---------+------------------------------------------+ | name | version | release | arch | md5 | +---------------------------+-----------+------------------------+---------+------------------------------------------+ | alertmanager | 0.28.1 | 32025073111.el7 | x86_64 | c5fe05fcc8263b83f6d0602a871d7e1a7a79bdb8 | | grafana | 7.5.17 | 1 | x86_64 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 | | obagent | 4.2.4 | 200000022025090416.el7 | x86_64 | bae1154d745991c109af6cb5b151fb2831594df4 | | ob-configserver | 1.0.0 | 2.el7 | x86_64 | feca6b9c76e26ac49464f34bfa0780b5a8d3f4a0 | | ob-deploy | 4.0.0 | 10.el7 | x86_64 | 76960e2877e13b3c1c7889411ecdfb0bb674c986 | | obproxy-ce | 4.3.5.0 | 3.el7 | x86_64 | f17b277b681adb1c86bfc3cfda369ad88896da9d | | ob-sysbench | 1.0.20 | 21.el7 | x86_64 | 34eb6ecba0ebc4c31c4cfa01162045cbbbec55f7 | | obtpcc | 5.0.0 | 1.el7 | x86_64 | 8624590be4bfe16f28bdd9fc5e4849cda19577d6 | | obtpch | 3.0.0 | 1.el7 | x86_64 | 3e3e88f87527677998fedf25087f5c87779dee62 | | oceanbase-ce | 4.2.1.8 | 108000022024072217.el7 | x86_64 | 499b676f2ede5a16e0c07b2b15991d1160d972e8 | | oceanbase-ce | 4.3.5.5 | 105010032025121323.el7 | x86_64 | 7a9dd8938978178a63570564d825520dab9a2c8c | | oceanbase-ce-libs | 4.2.1.8 | 108000022024072217.el7 | x86_64 | d02f4bfd321370a02550424293beb1be31204038 | | oceanbase-ce-libs | 4.3.5.5 | 105010032025121323.el7 | x86_64 | 7443d284b3142f00618508f05e0ade8ac1520932 | | oceanbase-ce-utils | 4.2.1.8 | 108000022024072217.el7 | x86_64 | 6f87392f95b399a21382323f256cfda5969375c4 | | oceanbase-ce-utils | 4.3.5.5 | 105010032025121323.el7 | x86_64 | 3b0dbffb3b26dfbd565588fa902a2b886a42227d | | oceanbase-diagnostic-tool | 3.7.1 | 12025102215.el7 | x86_64 | d52e8fa03d97b755b6bc3bf6515d0b2f51c4a927 | | ocp-agent-ce | 4.4.0 | 20251114143405.el7 | aarch64 | 6c619c8406abb57771d26e29ea7b0f58d5fed3de | | ocp-agent-ce | 4.4.0 | 20251114143405.el7 | x86_64 | f8dd0ebfaa2c2f413fb3eafb922cfabde114d32f | | ocp-server-ce | 4.4.0 | 20251114143405.el7 | noarch | f673d693677a2c640f925ad2127a604aaebf00bf | | openjdk-jre | 17.0.16_8 | 92025080421.el7 | x86_64 | ceb2cc6abb2016acb9d13681e5d8c76bab7ddd56 | | prometheus | 2.37.1 | 10000102022110211.el7 | x86_64 | 58913c7606f05feb01bc1c6410346e5fc31cf263 | +---------------------------+-----------+------------------------+---------+------------------------------------------+ Trace ID: ba093d22-efdc-11f0-bea2-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace ba093d22-efdc-11f0-bea2-00505621a1ea [admin@ocean bin]$

4、选择配置文件
obd 是通过解压 all-in-one 安装包的方式安装,则可在 ~/.oceanbase-all-in-one/obd/usr/obd/example 目录下查看 obd 提供的配置文件示例。请根据您的资源条件选择相应的配置文件。

小规格开发模式,适用于个人设备(内存不低于 8 GB):

  • 本地单机部署配置样例:mini-local-example.yaml
  • 单机部署配置样例:mini-single-example.yaml
  • 单机部署 + ODP 配置样例:mini-single-with-obproxy-example.yaml
  • 分布式部署 + ODP 配置样例:mini-distributed-with-obproxy-example.yaml
  • 分布式部署 + ODP + OCP Express 配置样例:default-components-min.yaml
  • 分布式部署全部组件:all-components-min.yaml

配置mini-single-example.yaml:

[admin@ocean ~]$ cp /soft/oceanbase-all-in-one/obd/usr/obd/example/mini-single-example.yaml ~ [admin@ocean ~]$ cat mini-single-example.yaml --- user: username: admin password: admin oceanbase-ce: servers: - name: server1 # Please don't use hostname, only IP can be supported ip: 192.*.*.60 global: home_path: /data/observer data_dir: /data redo_dir: /data/redo # The directory for clog, ilog, and slog. The default value is the same as the data_dir value. # Starting from observer version 4.2, the network selection for the observer is based on the 'local_ip' parameter, and the 'devname' parameter is no longer mandatory. # If the 'local_ip' parameter is set, the observer will first use this parameter for the configuration, regardless of the 'devname' parameter. # If only the 'devname' parameter is set, the observer will use the 'devname' parameter for the configuration. # If neither the 'devname' nor the 'local_ip' parameters are set, the 'local_ip' parameter will be automatically assigned the IP address configured above. # devname: eth0 mysql_port: 2881 rpc_port: 2882 obshell_port: 2886 zone: zone1 cluster_id: 1 # please set memory limit to a suitable value which is matching resource. memory_limit: 6G # The maximum running memory for an observer system_memory: 1G # The reserved system memory. system_memory is reserved for general tenants. The default value is 30G. datafile_size: 2G # Size of the data file. datafile_next: 2G # the auto extend step. Please enter an capacity, such as 2G datafile_maxsize: 20G # the auto extend max size. Please enter an capacity, such as 20G log_disk_size: 14G # The size of disk space used by the clog files. cpu_count: 16 production_mode: false enable_syslog_wf: false # Print system logs whose levels are higher than WARNING to a separate log file. The default value is true. max_syslog_file_count: 4 # The maximum number of reserved log files before enabling auto recycling. The default value is 0. # root_password: # root user password, can be empty [admin@ocean example]$

部署本地单节点 OceanBase 数据库

单机部署仅包含一个 Zone 并且 Zone 中只有一个 OBServer 节点。

[admin@ocean ~]$ obd cluster deploy -f obcluster -c mini-single-example.yaml +------------------------------------------------------------------------------------------------+ | Packages | +--------------+-------------+------------------------+------------------------------------------+ | Repository | Version/Tag | Release | Hash | +--------------+-------------+------------------------+------------------------------------------+ | oceanbase-ce | 4.3.5.5 | 105010032025121323.el7 | 7a9dd8938978178a63570564d825520dab9a2c8c | +--------------+-------------+------------------------+------------------------------------------+ Repository integrity check ok Load param plugin ok Open ssh connection ok Initializes observer work home ok Parameter check ok Remote oceanbase-ce-4.3.5.5-105010032025121323.el7-7a9dd8938978178a63570564d825520dab9a2c8c repository install ok Remote oceanbase-ce-4.3.5.5-105010032025121323.el7-7a9dd8938978178a63570564d825520dab9a2c8c repository lib check ok obcluster deployed Please execute ` obd cluster start obcluster ` to start Trace ID: d3de6d1a-f047-11f0-8496-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace d3de6d1a-f047-11f0-8496-00505621a1ea [admin@ocean example]$

启动 OceanBase 数据库

[admin@ocean ~]$ obd cluster start obcluster Get local repositories ok Load cluster param plugin ok Open ssh connection ok [WARN] OBD-1012: (192.*.*.60) clog and data use the same disk (/data) cluster scenario: htap Start observer ok observer program health check ok Connect to observer 192.*.*.60:2881 ok oceanbase bootstrap ok obshell start ok obshell program health check ok obshell bootstrap ok Connect to observer 192.*.*.60:2881 ok Wait for observer init ok +--------------------------------------------------+ | oceanbase-ce | +----------------+---------+------+-------+--------+ | ip | version | port | zone | status | +----------------+---------+------+-------+--------+ | 192.*.*.60 | 4.3.5.5 | 2881 | zone1 | ACTIVE | +----------------+---------+------+-------+--------+ obclient -h192.*.*.60 -P2881 -uroot@sys -p'******' -Doceanbase -A cluster unique id: ff60b35d-165b-5caa-8233-379311c81018-19bb65bf344-05050304 obshell program health check ok display obshell dashboard ok +---------------------------------------------------------------------+ | obshell Dashboard | +----------------------------+------+------------------------+--------+ | url | user | password | status | +----------------------------+------+------------------------+--------+ | http://192.*.*.60:2886 | root | 'nH7ucriuJ03tvmhnacKH' | active | +----------------------------+------+------------------------+--------+ obcluster running Trace ID: 71190006-f055-11f0-80f1-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace 71190006-f055-11f0-80f1-00505621a1ea [admin@ocean ~]$

查看 OceanBase 集群列表

[admin@ocean ~]$ obd cluster list +------------------------------------------------------------------+ | Cluster List | +-----------+------------------------------------+-----------------+ | Name | Configuration Path | Status (Cached) | +-----------+------------------------------------+-----------------+ | obcluster | /home/admin/.obd/cluster/obcluster | running | +-----------+------------------------------------+-----------------+ Trace ID: fcf6fe0c-f055-11f0-8580-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace fcf6fe0c-f055-11f0-8580-00505621a1ea [admin@ocean ~]$

查看 OceanBase 集群状态

[admin@ocean ~]$ obd cluster display obcluster Get local repositories and plugins ok Open ssh connection ok Connect to observer 192.*.*.60:2881 ok Wait for observer init ok +--------------------------------------------------+ | oceanbase-ce | +----------------+---------+------+-------+--------+ | ip | version | port | zone | status | +----------------+---------+------+-------+--------+ | 192.*.*.60 | 4.3.5.5 | 2881 | zone1 | ACTIVE | +----------------+---------+------+-------+--------+ obclient -h192.*.*.60 -P2881 -uroot@sys -p'******' -Doceanbase -A cluster unique id: ff60b35d-165b-5caa-8233-379311c81018-19bb65bf344-05050304 obshell program health check ok display obshell dashboard ok +---------------------------------------------------------------------+ | obshell Dashboard | +----------------------------+------+------------------------+--------+ | url | user | password | status | +----------------------------+------+------------------------+--------+ | http://192.*.*.60:2886 | root | 'nH7ucriuJ03tvmhnacKH' | active | +----------------------------+------+------------------------+--------+ Trace ID: 6c8f1088-f056-11f0-9544-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace 6c8f1088-f056-11f0-9544-00505621a1ea [admin@ocean ~]$

停止运行中的集群

[admin@ocean ~]$ obd cluster stop obcluster Get local repositories ok Get local repositories and plugins ok Open ssh connection ok Stop observer ok Stop obshell ok obcluster stopped Trace ID: ae891de4-f056-11f0-aeb2-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace ae891de4-f056-11f0-aeb2-00505621a1ea [admin@ocean ~]$

连接 OceanBase 数据库

[admin@ocean ~]$ obclient -h192.*.*.60 -P2881 -uroot@sys -p'******' -Doceanbase -A Welcome to the OceanBase. Commands end with ; or \g. Your OceanBase connection id is 3221491119 Server version: OceanBase_CE 4.3.5.5 (r105010032025121323-524cb9015f8e905b5361bd410f99cf97c7df6557) (Built Dec 13 2025 23:37:29) Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. obclient(root@sys)[oceanbase]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | LBACSYS | | mysql | | oceanbase | | ocs | | ORAAUDITOR | | SYS | | sys_external_tbs | | test | +--------------------+ 9 rows in set (0.002 sec) obclient(root@sys)[oceanbase]>

附录

1、卸载 OceanBase All in One

1、卸载安装包
您需进入 OceanBase All in One 的安装目录执行 uninstall.sh 脚本。在线安装时,默认安装目录为 /tmp/tmp.xxxx/oceanbase-all-in-one;离线安装时,默认安装目录为 ~/oceanbase-all-in-one。

cd oceanbase-all-in-one/bin/ ./uninstall.sh

2、删除环境变量

vim ~/.bash_profile 删除该文件中的 source /home/admin/.oceanbase-all-in-one/bin/env.sh

3、使修改生效
删除环境变量后,您需重新登录终端,或者执行 source 命令使修改生效,可参考如下命令:

source ~/.bash_profile

2、销毁已部署的集群

[admin@ocean ~]$ obd cluster destroy obcluster Are you sure to destroy the "obcluster" cluster ? [y/n]: y Get local repositories ok Open ssh connection ok Get deployment connections ok Get standbys info ok Cluster status check ok oceanbase-ce work dir cleaning ok obcluster destroyed To completely remove configuration files, you can use: obd cluster prune-config obcluster Trace ID: ea9f0570-f054-11f0-9fce-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace ea9f0570-f054-11f0-9fce-00505621a1ea [admin@ocean ~]$ obd cluster prune-config obcluster Are you sure to remove configuration files for the destroyed cluster "obcluster"? This action cannot be undone, and you will not be able to deploy with this configuration again. [y/n]: y Configuration files for "obcluster" have been removed. Trace ID: f49b9a66-f054-11f0-8e5b-00505621a1ea If you want to view detailed obd logs, please run: obd display-trace f49b9a66-f054-11f0-8e5b-00505621a1ea [admin@ocean ~]$

参考文档

OceanBase 数据库社区版部署概述:
https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000002013023
安装obd:
https://www.oceanbase.com/docs/community-obd-cn-1000000001882001
快速部署 OceanBase 数据库:
https://www.oceanbase.com/docs/community-obd-cn-1000000001882000
单机部署 OceanBase 数据库:
https://www.oceanbase.com/docs/community-obd-cn-1000000001882017
配置文件说明:
https://www.oceanbase.com/docs/community-obd-cn-1000000001881971

总结

使用OBD 部署 OceanBase 数据库单机版的过程还是非常丝滑的~~~

关于作者

网名:飞天,墨天轮2024年度优秀原创作者,拥有 Oracle 10g OCM 认证、PGCE认证、MySQL 8.0 OCP认证以及OBCA、KCP、KCSM、ACP、YCP、HCIP、磐维等众多国产数据库认证证书,目前从事Oracle、Mysql、PostgreSQL、磐维数据库管理运维工作,喜欢结交更多志同道合的朋友,热衷于研究、分享数据库技术。
微信公众号:飞天online
墨天轮:https://www.modb.pro/u/15197
如有任何疑问,欢迎大家留言,共同探讨~~~

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论