OceanBase安装部署

news2025/5/25 8:46:55

OceanBase自动化安装部署OBD

  • 前提条件
  • 一、 OceanBase 集群部署规划
    • 1、创建用户
    • 2、规划目录
  • 二、安装OceanBase环境
    • 1、 方案一:若机器能联网执行如下命令在线下载并安装 all-in-one 安装包
    • 2、 方案二:若机器不能联网需要在官网下载 all-in-one安装包,步骤如下:
  • 三、OBD部署单节点集群
    • 1、编辑 OBD 配置文件

前提条件

官方给出硬件条件需要满足以下要求
在这里插入图片描述
Red Hat Enterprise Linux 8 64 位
下载链接:https://pan.baidu.com/s/1rZ39xJFhk0HdmC4wEJcxvg
提取码:c01x
本文操作系为:CentOS7

一、 OceanBase 集群部署规划

1、创建用户

OceanBase数据库可以在任何用户下运行。该软件包的默认解压目录位于 /home/admin/。为了安全起见,我们将其安装在 admin 用户下。

  1. 使用以下命令新建用户:
 useradd admin
  1. 给用户admin赋予root权限
    使用以下命令进入相关配置文件并进行修改,示例如下图:
  vi /etc/sudoers

在这里插入图片描述

2、规划目录

参数或目录备注
observer部署/启动目录/home/admin/oceanbaseRPM包自动创建
observer数据总目录/home/admin/oceanbase/store/obdemo手动创建
observer数据文件实际目录/data/obdemo/sstable手动创建,通过软链接映射到数据总目录下
observer事务日志实际目录/redo/obdemo/{clog,slog,ilog}手动创建,通过软链接映射到数据总目录下
observer参数文件目录/home/admin/oceanbase/etc启动时在启动目录自动创建或自动读取
observer运行日志目录/home/admin/oceanbase/log启动时在启动目录自动创建

创建命令如下:

 sudo mkdir -p /home/admin/oceanbase/store/obdemo /data/obdemo/sstable /redo/obdemo/{clog,slog,ilog}
sudo ln -s /data/obdemo/sstable /home/admin/oceanbase/store/obdemo/sstable
sudo ln -s /redo/obdemo/slog /home/admin/oceanbase/store/obdemo/slog
 sudo ln -s /redo/obdemo/clog /home/admin/oceanbase/store/obdemo/clog
 sudo ln -s /redo/obdemo/ilog /home/admin/oceanbase/store/obdemo/ilog
echo 'export LD_LIBRARY_PATH=\SLD_LIBRARY_PAT:~/oceanbase/lib'>> ~/.bash_profile

在这里插入图片描述
设置文件所有者

sudo chown -R admin.admin /data /redo

查看目录结构:

tree oceanbase/ /data/ /redo/

在这里插入图片描述

二、安装OceanBase环境

1、 方案一:若机器能联网执行如下命令在线下载并安装 all-in-one 安装包

bash -c "$(curl -s https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/download-center/opensource/oceanbase-all-in-one/installer.sh)"

执行完成后显示 Install Finished
然后在执行如下命令设置环境变量

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

2、 方案二:若机器不能联网需要在官网下载 all-in-one安装包,步骤如下:

(1)进入https://open.oceanbase.com/quickStart下载
在这里插入图片描述
(2)上传至虚拟机适当位置(这里我使用的是ssh客户端)
在这里插入图片描述
(3)进入其存放目录进行解压并安装
解压命令如下:

tar -xzf oceanbase-all-in-one-*.tar.gz

解压后进入其bin目录下:

 cd oceanbase-all-in-one/bin/

执行 ./install.sh进行安装
安装成功后执行source ~/.oceanbase-all-in-one/bin/env.sh,安装环境
示例如下:

[admin@localhost ~]$ ls
mini-single-with-obproxy-example.yaml  oceanbase  oceanbase-all-in-one-4.2.1.0-100120231013145059.el7.x86_64.tar.gz
[admin@localhost ~]$ tar -xzf oceanbase-all-in-one-*.tar.gz
[admin@localhost ~]$ cd oceanbase-all-in-one/bin/
[admin@localhost bin]$ ./install.sh
name: grafana
version: 7.5.17
release:1
arch: x86_64
md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6
add /home/admin/oceanbase-all-in-one/rpms/grafana-7.5.17-1.el7.x86_64.rpm to local mirror
name: obagent
version: 4.2.0
release:3.el7
arch: x86_64
md5: 30793df12dc6b8ec5ccdc93262e5e9f1d51ed50a
add /home/admin/oceanbase-all-in-one/rpms/obagent-4.2.0-3.el7.x86_64.rpm to local mirror
name: obproxy-ce
version: 4.2.1.0
release:11.el7
arch: x86_64
md5: 0aed4b782120e4248b749f67be3d2cc82cdcb70d
add /home/admin/oceanbase-all-in-one/rpms/obproxy-ce-4.2.1.0-11.el7.x86_64.rpm to local mirror
name: oceanbase-ce
version: 4.2.1.0
release:100000102023092807.el7
arch: x86_64
md5: a8b9979de1f2809d74de71b2a536cff8aab15bff
add /home/admin/oceanbase-all-in-one/rpms/oceanbase-ce-4.2.1.0-100000102023092807.el7.x86_64.rpm to local mirror
name: oceanbase-ce-libs
version: 4.2.1.0
release:100000102023092807.el7
arch: x86_64
md5: c440e2a7f36297521a108c2316ef0e35ce1251f7
add /home/admin/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.2.1.0-100000102023092807.el7.x86_64.rpm to local mirror
name: ocp-express
version: 4.2.0
release:100000042023073111.el7
arch: x86_64
md5: ccec08112a29067633797d20685b6e6d70e890d9
add /home/admin/oceanbase-all-in-one/rpms/ocp-express-4.2.0-100000042023073111.el7.x86_64.rpm to local mirror
name: prometheus
version: 2.37.1
release:10000102022110211.el7
arch: x86_64
md5: 58913c7606f05feb01bc1c6410346e5fc31cf263
add /home/admin/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror
Trace ID: cd8397b2-748c-11ee-a969-000c2911f467
If you want to view detailed obd logs, please run: obd display-trace cd8397b2-748c-11ee-a969-000c2911f467
Disable remote ok
Trace ID: d00fd7de-748c-11ee-a6eb-000c2911f467
If you want to view detailed obd logs, please run: obd display-trace d00fd7de-748c-11ee-a6eb-000c2911f467

add auto set env logic to profile: /home/admin/.bash_profile

#####################################################################
 Install Finished
=====================================================================
Setup Environment:     source ~/.oceanbase-all-in-one/bin/env.sh
Start Web Service:     obd web
Quick Start:           obd demo
More Details:          obd -h
=====================================================================
[admin@localhost bin]$ source ~/.oceanbase-all-in-one/bin/env.sh
[admin@localhost bin]$

(4)确认OBD是否安装成功
在这里插入图片描述

三、OBD部署单节点集群

1、编辑 OBD 配置文件

(1)部署单节点 observer 和 obproxy 进程,需要在官网下载配置文件
https://github.com/oceanbase/obdeploy/blob/master/example/mini-single-with-obproxy-example.yaml
(2)按照自己的设置编辑配置文件

## Only need to configure when remote login is required
user:
  username: admin
  password: 112424wjw
#   key_file: your ssh-key file path if need
#   port: your ssh port, default 22
#   timeout: ssh connection timeout (second), default 30
oceanbase-ce:
  servers:
    # Please don't use hostname, only IP can be supported
    - 192.168.66.110
  global:
    #  The working directory for OceanBase Database. OceanBase Database is started under this directory. This is a required field.
    home_path: /home/admin/oceanbase-ce
    # The directory for data storage. The default value is $home_path/store.
    data_dir: /data
    # The directory for clog, ilog, and slog. The default value is the same as the data_dir value.
    redo_dir: /redo
    # Please set devname as the network adaptor's name whose ip is  in the setting of severs.
    # if set severs as "127.0.0.1", please set devname as "lo"
    # if current ip is 192.168.1.10, and the ip's network adaptor's name is "eth0", please use "eth0"
    devname: ens33 #设置为自己的网卡
    mysql_port: 2881 # External port for OceanBase Database. The default value is 2881. DO NOT change this value after the cluster is started.
    rpc_port: 2882 # Internal port for OceanBase Database. The default value is 2882. DO NOT change this value after the cluster is started.
    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: 2G # 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: 13G # The size of disk space used by the clog files.
    cpu_count: 16
    production_mode: false
    syslog_level: WARN 
    enable_syslog_wf: false # Print system logs whose levels are higher than WARNING to a separate log file. The default value is true.
    enable_syslog_recycle: true # Enable auto system log recycling or not. The default value is false.
    max_syslog_file_count: 4 # The maximum number of reserved log files before enabling auto recycling. The default value is 0.
    # observer cluster name, consistent with obproxy's cluster_name
    appname: obcluster
    root_password: root # root user password, can be empty
    proxyro_password: root # proxyro user pasword, consistent with obproxy's observer_sys_password, can be empty
obproxy-ce:
  # Set dependent components for the component.
  # When the associated configurations are not done, OBD will automatically get the these configurations from the dependent components.
  depends:
    - oceanbase-ce
  servers:
    - 192.168.66.110
  global:
    listen_port: 2883 # External port. The default value is 2883.
    prometheus_listen_port: 2884 # The Prometheus port. The default value is 2884.
    home_path: /home/admin/obproxy
    # oceanbase root server list
    # format: ip:mysql_port;ip:mysql_port. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    rs_list: 192.168.66.110:2881
    enable_cluster_checkout: false
    # observer cluster name, consistent with oceanbase-ce's appname. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    # cluster_name: obcluster
    skip_proxy_sys_private_check: true
    enable_strict_kernel_release: false
    # obproxy_sys_password: # obproxy sys user password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
    # observer_sys_password: # proxyro user pasword, consistent with oceanbase-ce's proxyro_password, can be empty. When a depends exists, OBD gets this value from the oceanbase-ce of the depends.
  1. 部署集群
    使用如下命令部署集群
obd cluster deploy obcluster -c single-with-obproxy.yaml

在这里插入图片描述
报上图中所示错误原因:配置文件中的 user 用户(未填的情况下默认为当前用户)没有对应目录的写权限。可修改配置文件解决。
待其执行结束如下图所示:
在这里插入图片描述

  1. 部署结果
    使用命令 obd cluster list 查看部署状态
    在这里插入图片描述
  2. 启动和初始化集群
 obd cluster stop obcluster

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1149229.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

8+双疾病+WGCNA+多机器学习筛选疾病的共同靶点并验证表达

今天给同学们分享一篇双疾病WGCNA多机器学习的生信文章“Shared diagnostic genes and potential mechanism between PCOS and recurrent implantation failure revealed by integrated transcriptomic analysis and machine learning”,这篇文章于2023年5月16日发表…

雅思小作文笔记

mostly from Simon’s methods and techniques remember the task is describe what you see, not give an opinion. Just write a report.no conclusion, just a summary(the overview) Question type 小作文的题目类型大致如上 Simon所述,在描述数字的时候&…

云服务器 centos 部署 code-server 并配置 c/c++ 环境

将你的云服务器改为 centos 8 为什么要将云服务器的操作系统改成 centos 8 呢?原因就是 centos 7 里面的配置满足不了 code-server 的需求。如果你使用的是 centos 7 那么就需要你升级一些东西,这个过程比较麻烦。我在 centos 7 上面运行 code-server 的…

内含800个程序案例,最强Python学习资料来了,清华北大都在用!

IEEE Spectrum 重磅发布了 2023 年度编程语言榜单,Python 不仅在“Spectrum”综合排名中保持第一的位置,而且远超第二名 Java。Python以其简洁明了的语法、丰富的库支持和强大的社区生态,赢得了全球开发者的青睐。同时,Python的跨…

拥抱健康生活:TikTok引领健康与生活方式趋势

在当今数字化时代,社交媒体平台的崛起已经改变了我们获取信息、分享经验和塑造生活方式的方式。其中,TikTok已经成为引领健康和生活方式趋势的先锋,为数百万用户提供了丰富多彩的健康相关内容。这篇文章将探讨TikTok如何影响了我们的健康观念…

免费录屏软件哪个好?帮你轻松找到最佳选择

在当今社会,录制屏幕已经成为了生活和工作中不可或缺的一部分。无论您是教育工作者、演示者还是视频创作者,掌握一款优秀的免费录屏软件都能够帮助您更好地传达您的信息。可是免费录屏软件哪个好呢?本文将深入探讨三款常用的免费录屏软件&…

CSDN热榜分析4:生成词云图

文章目录 函数封装UI设计输出词云 热榜分析系列: CSDN热榜分析🔥 UI界面🔥 领域热榜 函数封装 词云图的绘制功能早在最开始做热榜分析的时候就已经实现了,但需要依赖matplotlib来画图,而并没有直接导出功能&#x…

[Unity][VR]透视开发系列3-Passthrough应用的真机测试方法

【视频讲解】 视频讲解地址请关注我的B站。 专栏后期会有一些不公开的高阶实战内容或是更细节的指导内容。 B站地址: https://www.bilibili.com/video/BV1Zg4y1w7fZ/ 我还有一些免费和收费课程在网易云课堂(大徐VR课堂): https://study.163.com/provider/480000002282025/…

Apollo上机实践:一次对自动驾驶技术的亲身体验

上机实践 概述自动驾驶通信分布式系统开发模式开发工具 自动驾驶感知传感器特性感知流程及算法部署感知模型 自动驾驶决策规划决策规划流程和算法使用 Dreamview 进行控制在环的规划调试开发规划场景和算法 福利活动 主页传送门:📀 传送 概述 Apollo 是…

【3妹教我学历史-秦朝史】1 秦朝初期

插: 前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家。点击跳转到网站。 坚持不懈,越努力越幸运,大家一起学习鸭~~~ 2哥 :3妹,在干嘛呢 3妹:读书呢…

不定长顺序表3

六.判空函数 刚刚忘记参数判断了 七.查找函数——在顺序表PS中 查找第一个key值,找到返回key值的下标,没有找到返回-1 不管能否扩容,查找都是在有效数据内部查找,所以可以把定长顺序表的查找Search函数搬过来 测试也跟定长的一样…

PCA9865 模块使用

本来是用来控制灯的,若用来控制舵机等,需外接电源 arduino arduino stm32 引脚A4为SDA,引脚A5为SCL asrpro 使用softiic库,使用arduino的 Adafruit_PWMServoDriver驱动库 进行修改 若要封装,需将Adafruit_PWMServoD…

Python实现文件压缩和解压功能

目录 一、常见的压缩格式 1、ZIP格式 2、RAR格式 3、7Z格式 二、压缩算法 1、Huffman编码 2、LZ77算法 3、Bzip2算法 三、解压算法 1、解压zip文件 2、解压rar文件 3、解压7z文件 总结 Python是一种功能强大的编程语言,具有易学易用的特点。它提供了许…

2021-arxiv-GPT Understands, Too

2021-arxiv-GPT Understands, Too Paper: https://arxiv.org/abs/2103.10385 Code: https://github.com/THUDM/P-tuning Prompt 简单理解 举例来讲,今天如果有这样两句评论: 1. 什么苹果啊,都没有苹果味&#xff0c…

DevChat:VSCode中基于大模型的AI智能编程助手

文章目录 1. 前言2. 安装2.1 注册新用户2.2 在VSCode中安装DevChat插件2.3 设置Access Key 3. 实战使用4. 总结 1. 前言 DevChat是由Merico公司精心打造的AI智能编程助手。它利用了最先进的大语言模型技术,像人类开发者一样高效地理解需求,并提供最佳的代…

Star History 九月开源精选 |开源 GitHub Copilot 替代

虽然大火了近一年,但是截至目前 AI 唯一破圈的场景是帮助写代码(谷歌云旗下的 DORA 年度报告也给 AI 泼了盆冷水)。不过对于软件开发来说,生成式人工智能绝对已经是新的标配。 本期 Star History 收集了一些开源 GitHub Copilot …

双十一好物提前看!双十一买什么最省心、好用又实惠的好物推荐

双十一即将来临,你是否已经开始为购物车准备填满各种好物?一年一度大促购物节可千万要清点好需要买刚需好物有哪些,毕竟错过了这个促销活动的时间就要等下一年,辛苦一年了,就等着双十一大促的时候买点好东西讨好一下自…

一文读懂多云CDN

本文带你了解火山引擎边缘云推出的一款创新产品:多云CDN。如果你的业务同时由多家CDN厂商提供服务,而你作为多家CDN服务的购买者/使用者/运维人员,那么多云CDN是帮助你“降本增效”的不二利器! 在不久前结束的“2023稀土掘金开发…

1400*B. Phoenix and Beauty(贪心构造)

Problem - 1348B - Codeforces 解析: 满足题意,会构成循环序列,其中循环节长度为 k,统计数列中不同元素的个数 cnt ,如果cnt > k,显然无解。 否则,由于题意中已经证明,答案序列个…

用CHAT分析:为什么层次网络模型理论,不容易解释熟悉性效应?

今天小编带大家探索新的事物,这个问题对于小编来说也是未知~ 问Chat:试分析为什么层次网络模型理论不容易解释熟悉性效应? 熟悉性效应(Familiarity Effect)是指人们对于熟悉的事物、人或情境有更积极的评价和感知。这…