news 2026/10/10 10:36:36

anolis23.4上命令行部署 OceanBase v4.5 版本 3节点分布式集群

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
anolis23.4上命令行部署 OceanBase v4.5 版本 3节点分布式集群

看了网上,都是安装的v4.2或者更低版本,同时,大部分操作系统选择的是centos 7.9,我这里使用的是anolis23.4 ,其他RHEL10也没有问题。另外,网上单节点的居多,我这里按生产标准安装,只是机器配置是练习的机器,记录一下。

使用命令行部署 OceanBase 数据库生产环境

1.环境准备

1.1.硬件
obd 2c/8g
observer 2c/12g X 3,内存最好是16g以上。

1.2.IP规划
ip 用途
192.168.133.10 obd obconfigserver prometheus granfana
192.168.133.11 observer1 odp obagent
192.168.133.12 observer2 odp obagent
192.168.133.13 observer3 odp obagent

1.3.版本
本次操作系统使用的龙蜥23.4,OB使用的v4.5

os: anolis 23.4,操作系统可以选择最小安装
ob: v4.5.0

1.4 系统设置
对三个OBSERVER 机器的内核参数及资源限制进行设置


配置资源限制
vim /etc/security/limits.conf

* soft nofile 655350
* hard nofile 655350

* soft stack unlimited
* hard stack unlimited

* soft core unlimited
* hard core unlimited


配置内核参数

vim /etc/sysctl.conf

vm.swappiness = 0
vm.max_map_count = 655360
vm.min_free_kbytes = 2097152
vm.overcommit_memory = 0
fs.file-max = 6573688
fs.aio-max-nr = 1048576

使用sysctl -p 让内核参数配置生效。

# sysctl -p


1.5 用户建立
在所有机器,OBD,三个OBSERVER 机器上创建安装用户admin ,可以使用root安装,但建议使用非root用户安装
# useradd admin
# echo ob |passwd --stdin admin

1.6 建立 data及log目录,并授权
在三台OBSERVER机器上创建数据和日志的目录
# mkdir -p /data /redo
# chown -R admin:admin /data /redo

2.安装
2.1 安装 Oceanbase ALL IN ONE 包

选择离线安装

下载 all in one安装包,注意,由于操作系统是最新的操作系统,all in one 安装包,要下载el8的,下载下来如下:oceanbase-all-in-one-4.5.0_20260203.el8.x86_64.tar.gz,
并上传到中控机器

使用admin 用户解压all in one 安装包:
su - admin
$ tar xvf oceanbase-all-in-one-4.5.0_20260203.el8.x86_64.tar.gz

$ cd oceanbase-all-in-one/bin
./install.sh

。。。
If you want to view detailed obd logs, please run: obd display-trace 3fbab2d8-0d70-11f1-a094-000c29d50a70

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
Quick Start (performance): obd perf
Interactive install: obd cluster deploy -i
Use Web Service to install: obd web
Use Web Service to upgrade: obd web upgrade
More Details: obd -h
=========================================================================================

环境变量生效

source ~/.oceanbase-all-in-one/bin/env.sh


2.2 配置 OBD

2.2.1 禁用远程仓库
使用 obd mirror disable remote 命令完成

[admin@obd4 bin]$ obd mirror disable remote

2.2.2 查看禁用情况
[admin@obd4 bin]$ obd mirror list
+---------------------------------------------------------------------------------+
| Mirror Repository List |
+--------------------------------+--------+---------+----------+------------------+
| SectionName | Type | Enabled | Avaiable | Update Time |
+--------------------------------+--------+---------+----------+------------------+
| local | local | - | True | 2026-02-19 16:55 |
| oceanbase.community.stable.al8 | remote | False | False | 1970-01-01 08:00 |
| oceanbase.development-kit.al8 | remote | False | False | 1970-01-01 08:00 |
| oceanbase.community.stable.el | remote | False | False | 1970-01-01 08:00 |
| oceanbase.development-kit.el | remote | False | False | 1970-01-01 08:00 |
+--------------------------------+--------+---------+----------+------------------+

2.2.3 将安装包添加至本地镜像库

[admin@obd4 local]$ obd mirror clone *.rpm

2.2.4 查看本地镜像库中安装包列表

[admin@obd4 local]$ obd mirror list local

+---------------------------------------------------------------------------------------------------------------------+
| local Package List |
+---------------------------+-----------+------------------------+---------+------------------------------------------+
| name | version | release | arch | md5 |
+---------------------------+-----------+------------------------+---------+------------------------------------------+
| alertmanager | 0.28.1 | 32025073111.el8 | x86_64 | 13b24d72fe5296a68a9dca70193ed693f5697a5e |
| grafana | 7.5.17 | 1 | x86_64 | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| obagent | 4.2.4 | 200000022025090416.el8 | x86_64 | a1f4d48503fce2f8b07eb1af3889161c6bc4c264 |
| ob-configserver | 1.0.0 | 2.el8 | x86_64 | 664f93205c913d5dc84e0779d565768fd60f1d5e |
| ob-deploy | 4.2.0 | 1.el8 | x86_64 | eb9188e03fab53aed739672db79f488cb2ef415b |
| obproxy-ce | 4.3.5.0 | 3.el8 | x86_64 | 73d0e9b4cecb53c8ba91f3ef50ac6742baa8be57 |
| ob-sysbench | 1.0.20 | 21.el8 | x86_64 | ae4bb45f91e434a62af366a59787bcfe6069951c |
| obtpcc | 5.0.0 | 1.el8 | x86_64 | 9bb0d729187938dd66fcfdf89eb7c5e9b59b0e58 |
| obtpch | 3.0.0 | 1.el8 | x86_64 | a09e5586ea25223f97169ee64acd7191610ec602 |
| oceanbase-ce | 4.2.1.8 | 108000022024072217.el8 | x86_64 | 67cdfd029a461e9563b4ed301c661479136e58bc |
| oceanbase-ce | 4.5.0.0 | 100000012025112711.el8 | x86_64 | 354e83c2c5a6d296aee92c5c762fd4dcee9d9ac5 |
| oceanbase-ce-libs | 4.2.1.8 | 108000022024072217.el8 | x86_64 | b7a867b144db1900a77c50dff33018adcc523232 |
| oceanbase-ce-libs | 4.5.0.0 | 100000012025112711.el8 | x86_64 | 9bbee841e80f1a6682b668a14ec36a38a0354bf0 |
| oceanbase-ce-utils | 4.2.1.8 | 108000022024072217.el8 | x86_64 | 8830434f4fde3a60dcfa9308182aa7d07163bda1 |
| oceanbase-ce-utils | 4.5.0.0 | 100000012025112711.el8 | x86_64 | f1dd0cd4a39ae6a7996539732b419d8500523e5f |
| oceanbase-diagnostic-tool | 3.7.1 | 12025102215.el8 | x86_64 | 92fb7e58edd3dd5507dfeed0e4fbc1562a50fae7 |
| 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.el8 | x86_64 | 6bd4c45a7b95d55433a18f244cea182232003d50 |
| prometheus | 2.37.1 | 10000102022110211.el8 | x86_64 | e4f8a3e784512fca75bf1b3464247d1f31542cb9 |
+---------------------------+-----------+------------------------+---------+------------------------------------------+


2.2.5 选择配置文件

在 ~/.oceanbase-all-in-one/obd/usr/obd/example 位置,有模板文件,我们选择 all-components.yaml作为模板文件
cp ~/.oceanbase-all-in-one/obd/usr/obd/example/all-components.yaml ~/deploy.yaml

2.2.6 修改配置文件
vim deploy.yaml

user:
username: admin
password: ob
oceanbase-ce:
depends:
- ob-configserver
servers:
- name: server1
ip: 192.168.133.11
- name: server2
ip: 192.168.133.12
- name: server3
ip: 192.168.133.13
global:
devname: ens160
memory_limit: 10G # 使用free -g 可用的内存
system_memory: 6G # 低于 memory_limit的75%
datafile_size: 50G # Size of the data file.
log_disk_size: 20G # The size of disk space used by the clog files.
enable_syslog_wf: false
max_syslog_file_count: 4

appname: obcluster

mysql_port: 2881
rpc_port: 2882
obshell_port: 2886
home_path: /home/admin/observer
data_dir: /data
redo_dir: /redo

server1:
zone: zone1
server2:
zone: zone2
server3:
zone: zone3

obproxy-ce:
depends:
- oceanbase-ce
- ob-configserver
servers:
- name: server1
ip: 192.168.133.11

- name: server2
ip: 192.168.133.12

- name: server3
ip: 192.168.133.13

global:
listen_port: 2883
prometheus_listen_port: 2884
home_path: /home/admin/obtest/obproxy
enable_cluster_checkout: false
skip_proxy_sys_private_check: true
enable_strict_kernel_release: false
obproxy_sys_password: ob
observer_sys_password: ob
obagent:
depends:
- oceanbase-ce
servers:
- name: server1
ip: 192.168.133.11
- name: server2
ip: 192.168.133.12
- name: server3
ip: 192.168.133.13
global:
home_path: /home/admin/obagent

prometheus:
servers:
- 192.168.133.10
depends:
- obagent
global:
home_path: /home/admin/prometheus
port: 9090
data_dir: /home/admin/prometheus/data
basic_auth_users:
admin: ob

grafana:
servers:
- 192.168.133.10
depends:
- prometheus
global:
home_path: /home/admin/grafana
login_password: 'oceanbase'


2.3 部署 OceanBase 集群

[admin@obd4 ~]$ obd cluster deploy obtest -c deploy.yaml

启动集群

[admin@obd4 ~]$ obd cluster start obtest

Wait for observer init ok
+--------------------------------------------------+
| oceanbase-ce |
+----------------+---------+------+-------+--------+
| ip | version | port | zone | status |
+----------------+---------+------+-------+--------+
| 192.168.133.11 | 4.5.0.0 | 2881 | zone1 | ACTIVE |
| 192.168.133.12 | 4.5.0.0 | 2881 | zone2 | ACTIVE |
| 192.168.133.13 | 4.5.0.0 | 2881 | zone3 | ACTIVE |
+----------------+---------+------+-------+--------+
obclient -h192.168.133.11 -P2881 -uroot@sys -p'9Ppk3kstwd9YFfjTiOQW' -Doceanbase -A

cluster unique id: 844da582-3e09-59ae-a25d-43c59f91d5c3-19c758fe5a4-00000504

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

Connect to obproxy ok
+--------------------------------------------------------------------+
| obproxy-ce |
+----------------+------+-----------------+-----------------+--------+
| ip | port | prometheus_port | rpc_listen_port | status |
+----------------+------+-----------------+-----------------+--------+
| 192.168.133.11 | 2883 | 2884 | 2885 | active |
| 192.168.133.12 | 2883 | 2884 | 2885 | active |
| 192.168.133.13 | 2883 | 2884 | 2885 | active |
+----------------+------+-----------------+-----------------+--------+
obclient -h192.168.133.11 -P2883 -uroot@proxysys -p'ob' -Doceanbase -A

Connect to Obagent ok
+-------------------------------------------------------------------+
| obagent |
+----------------+--------------------+--------------------+--------+
| ip | mgragent_http_port | monagent_http_port | status |
+----------------+--------------------+--------------------+--------+
| 192.168.133.11 | 8089 | 8088 | active |
| 192.168.133.12 | 8089 | 8088 | active |
| 192.168.133.13 | 8089 | 8088 | active |
+----------------+--------------------+--------------------+--------+
Connect to Prometheus ok
+-------------------------------------------------------+
| prometheus |
+----------------------------+------+----------+--------+
| url | user | password | status |
+----------------------------+------+----------+--------+
| http://192.168.133.10:9090 | | | active |
+----------------------------+------+----------+--------+
Connect to grafana ok
+-----------------------------------------------------------------------+
| grafana |
+----------------------------------------+-------+-------------+--------+
| url | user | password | status |
+----------------------------------------+-------+-------------+--------+
| http://192.168.133.10:3000/d/oceanbase | admin | 'oceanbase' | active |
+----------------------------------------+-------+-------------+--------+
obtest running
Trace ID: 495580e0-0d82-11f1-885d-000c29d50a70
If you want to view detailed obd logs, please run: obd display-trace 495580e0-0d82-11f1-885d-000c29d50a70
[admin@obd4 ~]$

可以登录 obshell http://192.168.133.11:2886 进行查看

到此,社区版 OB基于 OBD 黑盒安装已经完成。

最后,obshell 仪表盘发出来看看

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/10/5 2:06:42

互联网大厂Java求职面试实战:核心技术栈与AI应用解析

互联网大厂Java求职面试实战:核心技术栈与AI应用解析 面试场景介绍 在一家顶级互联网大厂,面试官严肃而专业地与水货程序员谢飞机进行Java技术面试。面试围绕Java核心版本、构建工具、Web框架、数据库ORM、微服务云原生、安全框架、消息队列、缓存技术及…

作者头像 李华
网站建设 2026/10/10 10:36:23

从此告别拖延,AI论文网站千笔AI VS 万方智搜AI,本科生写作更高效!

随着人工智能技术的迅猛迭代与普及,AI辅助写作工具已逐步渗透到高校学术写作场景中,成为专科生、本科生、研究生完成毕业论文不可或缺的辅助手段。越来越多面临毕业论文压力的学生,开始依赖各类AI工具简化写作流程、提升创作效率。但与此同时…

作者头像 李华
网站建设 2026/10/5 2:07:29

Word页眉形状自动调整技巧

调整形状以适应页眉大小在Word中插入形状后,选中该形状,右键点击选择“大小和位置”。在弹出的对话框中,将“宽度”设置为“100%”或与页眉区域匹配的百分比,确保形状宽度与页眉宽度一致。勾选“锁定纵横比”以避免形状变形&#…

作者头像 李华
网站建设 2026/10/5 2:07:33

RMBG-1.4镜像免配置优势:AI净界降低AI图像分割技术使用门槛

RMBG-1.4镜像免配置优势:AI净界降低AI图像分割技术使用门槛 1. 背景去除的痛点与解决方案 你有没有遇到过这样的烦恼?想要给产品换个背景,结果抠图边缘像狗啃的一样;想给自己照片换个好看的背景,头发丝却总是处理不干…

作者头像 李华
网站建设 2026/10/5 2:08:07

基于Spring Cloud的家政服务平台的设计与实现(任务书)

本科毕业论文(设计)任务书 学院:数学与数据科学学院 学生姓名 专业班级 信计213 学号 校内指导教师姓名 职称/职务 副教授 签名 校外指导教师姓名 职称/职务 技术经理 签名 论文题目 基于Spring Cloud的家政服务平台的设计与实现 起始日期 2024-9 ~ 2025-5 一、论文(设…

作者头像 李华
网站建设 2026/10/5 2:08:07

Angular路由深度解析

# Angular路由:构建单页面应用的导航系统 一、路由是什么 想象一下你去图书馆找书。图书馆有明确的区域划分:小说区在二楼A区,科技类在三楼B区,历史类在一楼C区。当你需要某类书籍时,你会直接前往对应的区域&#xff0…

作者头像 李华