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

OceanBase 小白学习-社区版OBD白屏部署

原创 布衣 2024-11-26
201

OceanBase 数据库社区版:

  兼容 MySQL 的单机分布式一体化数据库,具有原生分布式架构,支持金融级高可用、透明水平扩展、分布式事务、多租户和语法兼容等企业级特性。OceanBase 社区版数据库内核开源,与 MySQL 兼容,对接虚拟化和大数据技术及产品,支持多种图形化的开发工具、运维监控工具和数据迁移工具;同时社区版提供开放的接口和丰富的生态能力,支持企业或个人更好的实现定制化业务需求。

部署规划:

角色 角色IP 备注
OBD 10.10.5.136 中控机,自动化部署软件
OBPROXY 10.10.5.136 OceanBase访问反向代理
OBCLIENT 10.10.5.136 OceanBase命令行客户端
OBSERVER 10.10.5.163 OceanBase数据库zone1
OBSERVER 10.10.5.164 OceanBase数据库zone2
OBSERVER 10.10.5.165 OceanBase数据库zone3

下载安装包:

安装部署

OBD:10.10.5.136

  • 1、下载最新版本 all-in-one 安装包,并将其上传到<10.10.5.136>任一目录下。
  • 2、解压安装包并安装
[root@localhost ~]$ tar -zxf oceanbase-all-in-one-4.2.1_BP9_HF1_20241018.el7.x86_64.tar.gz [root@localhost ~]$ cd oceanbase-all-in-one/bin/ [root@localhost ~]# cd /home/admin/oceanbase-all-in-one/bin [root@localhost bin]# ./install.sh install obd as root No previous obd installed, try install..., wait a moment name: grafana version: 7.5.17 release:1 arch: x86_64 md5: 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 size: 177766248 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.2 release:100000042024011120.el7 arch: x86_64 md5: 19739a07a12eab736aff86ecf357b1ae660b554e size: 72919140 add /home/admin/oceanbase-all-in-one/rpms/obagent-4.2.2-100000042024011120.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 /home/admin/oceanbase-all-in-one/rpms/ob-configserver-1.0.0-2.el7.x86_64.rpm to local mirror name: ob-deploy version: 2.10.1 release:1.el7 arch: x86_64 md5: 12bbe7e79275d8ff316769aa9fa909997771db5b size: 158164767 add /home/admin/oceanbase-all-in-one/rpms/ob-deploy-2.10.1-1.el7.x86_64.rpm to local mirror name: obproxy-ce version: 4.3.1.0 release:4.el7 arch: x86_64 md5: 835f4803c1f4da186439323b66c51db4662678a3 size: 1913858511 add /home/admin/oceanbase-all-in-one/rpms/obproxy-ce-4.3.1.0-4.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 /home/admin/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 /home/admin/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 /home/admin/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 /home/admin/oceanbase-all-in-one/rpms/oceanbase-ce-4.2.1.8-108000022024072217.el7.x86_64.rpm to local mirror name: oceanbase-ce version: 4.2.1.9 release:109010012024101414.el7 arch: x86_64 md5: 67b8a2b699db96053d3f8d8ba3116b0e97a27722 size: 467980964 add /home/admin/oceanbase-all-in-one/rpms/oceanbase-ce-4.2.1.9-109010012024101414.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 /home/admin/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.2.1.9 release:109010012024101414.el7 arch: x86_64 md5: 03d52091e97a2207a9d8abcf601d62cc207142b7 size: 468528 add /home/admin/oceanbase-all-in-one/rpms/oceanbase-ce-libs-4.2.1.9-109010012024101414.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 /home/admin/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.2.1.9 release:109010012024101414.el7 arch: x86_64 md5: 28c5a70d31a78418b3093695e64c97ed4b9a0721 size: 405776144 add /home/admin/oceanbase-all-in-one/rpms/oceanbase-ce-utils-4.2.1.9-109010012024101414.el7.x86_64.rpm to local mirror name: oceanbase-diagnostic-tool version: 2.4.0 release:32024091010.el7 arch: x86_64 md5: 3817915bd36866590e1e6a74ad1c308817a6985e size: 43174675 add /home/admin/oceanbase-all-in-one/rpms/oceanbase-diagnostic-tool-2.4.0-32024091010.el7.x86_64.rpm to local mirror name: ocp-agent-ce version: 4.3.2 release:20241012145836.el7 arch: aarch64 md5: 467f53472b5979c8b90cba439d780eee1510f084 size: 121430330 add /home/admin/oceanbase-all-in-one/rpms/ocp-agent-ce-4.3.2-20241012145836.el7.aarch64.rpm to local mirror name: ocp-agent-ce version: 4.3.2 release:20241012145836.el7 arch: x86_64 md5: 13e464a5b51e5787b7e3276c913dea3855a631f0 size: 176463404 add /home/admin/oceanbase-all-in-one/rpms/ocp-agent-ce-4.3.2-20241012145836.el7.x86_64.rpm to local mirror name: ocp-express version: 4.2.2 release:100000022024011120.el7 arch: x86_64 md5: 09ffcf156d1df9318a78af52656f499d2315e3f7 size: 78426196 add /home/admin/oceanbase-all-in-one/rpms/ocp-express-4.2.2-100000022024011120.el7.x86_64.rpm to local mirror name: ocp-server-ce version: 4.3.2 release:20241012145836.el7 arch: noarch md5: 610610e2daf63f6df08af686f9a88b6d8cefcc52 size: 650124565 add /home/admin/oceanbase-all-in-one/rpms/ocp-server-ce-4.3.2-20241012145836.el7.noarch.rpm to local mirror name: openjdk-jre version: 1.8.0_322 release:b09.el7 arch: x86_64 md5: 051aa69c5abb8697d15c2f0dcb1392b3f815f7ed size: 69766947 add /home/admin/oceanbase-all-in-one/rpms/openjdk-jre-1.8.0_322-b09.el7.x86_64.rpm to local mirror name: prometheus version: 2.37.1 release:10000102022110211.el7 arch: x86_64 md5: 58913c7606f05feb01bc1c6410346e5fc31cf263 size: 211224073 add /home/admin/oceanbase-all-in-one/rpms/prometheus-2.37.1-10000102022110211.el7.x86_64.rpm to local mirror Trace ID: 88cc7cf2-a027-11ef-a4be-005056801edc If you want to view detailed obd logs, please run: obd display-trace 88cc7cf2-a027-11ef-a4be-005056801edc Disable remote ok Trace ID: 8bcdbd8a-a027-11ef-acb1-005056801edc If you want to view detailed obd logs, please run: obd display-trace 8bcdbd8a-a027-11ef-acb1-005056801edc add auto set env logic to profile: /root/.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 =========================================================================================
复制
  • 4、加载环境变量
[root@localhost ~]# source ~/.oceanbase-all-in-one/bin/env.sh 
复制
  • 5、安装demo
[root@localhost ~]# obd demo
Package obagent-4.2.2-100000042024011120.el7 is available.
Package oceanbase-ce-4.2.1.9-109010012024101414.el7 is available.
Package prometheus-2.37.1-10000102022110211.el7 is available.
Package grafana-7.5.17-1 is available.
Package obproxy-ce-4.3.1.0-4.el7 is available.
install obagent-4.2.2 for local ok
install oceanbase-ce-4.2.1.9 for local ok
install prometheus-2.37.1 for local ok
install grafana-7.5.17 for local ok
install obproxy-ce-4.3.1.0 for local ok
Cluster param config check ok
Open ssh connection ok
Generate obproxy configuration ok
Generate grafana configuration ok
Generate prometheus configuration ok
Generate observer configuration ok
Generate obagent configuration ok
+--------------------------------------------------------------------------------------------+
|                                          Packages                                          |
+--------------+---------+------------------------+------------------------------------------+
| Repository   | Version | Release                | Md5                                      |
+--------------+---------+------------------------+------------------------------------------+
| obagent      | 4.2.2   | 100000042024011120.el7 | 19739a07a12eab736aff86ecf357b1ae660b554e |
| oceanbase-ce | 4.2.1.9 | 109010012024101414.el7 | 67b8a2b699db96053d3f8d8ba3116b0e97a27722 |
| prometheus   | 2.37.1  | 10000102022110211.el7  | 58913c7606f05feb01bc1c6410346e5fc31cf263 |
| grafana      | 7.5.17  | 1                      | 1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 |
| obproxy-ce   | 4.3.1.0 | 4.el7                  | 835f4803c1f4da186439323b66c51db4662678a3 |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Load param plugin ok
Open ssh connection ok
Parameter check ok
Cluster status check ok
Initializes obagent work home ok
Initializes observer work home ok
Initializes prometheus work home ok
Initializes grafana work home ok
Initializes obproxy work home ok
Remote obagent-4.2.2-100000042024011120.el7-19739a07a12eab736aff86ecf357b1ae660b554e repository install ok
Remote obagent-4.2.2-100000042024011120.el7-19739a07a12eab736aff86ecf357b1ae660b554e repository lib check ok
Remote oceanbase-ce-4.2.1.9-109010012024101414.el7-67b8a2b699db96053d3f8d8ba3116b0e97a27722 repository install ok
Remote oceanbase-ce-4.2.1.9-109010012024101414.el7-67b8a2b699db96053d3f8d8ba3116b0e97a27722 repository lib check !!
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository install ok
Remote prometheus-2.37.1-10000102022110211.el7-58913c7606f05feb01bc1c6410346e5fc31cf263 repository lib check ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository install ok
Remote grafana-7.5.17-1-1bf1f338d3a3445d8599dc6902e7aeed4de4e0d6 repository lib check ok
Remote obproxy-ce-4.3.1.0-4.el7-835f4803c1f4da186439323b66c51db4662678a3 repository install ok
Remote obproxy-ce-4.3.1.0-4.el7-835f4803c1f4da186439323b66c51db4662678a3 repository lib check ok
Try to get lib-repository
Package oceanbase-ce-libs-4.2.1.9-109010012024101414.el7 is available.
install oceanbase-ce-libs-4.2.1.9 for local ok
Remote oceanbase-ce-libs-4.2.1.9-109010012024101414.el7-03d52091e97a2207a9d8abcf601d62cc207142b7 repository install ok
Remote oceanbase-ce-4.2.1.9-109010012024101414.el7-67b8a2b699db96053d3f8d8ba3116b0e97a27722 repository lib check ok
demo deployed
Get local repositories ok
Search plugins ok
Load cluster param plugin ok
Open ssh connection ok
Check before start observer x
[WARN] OBD-1011: (127.0.0.1) The recommended value of fs.aio-max-nr is 1048576 (Current value: 65536)
[WARN] OBD-1007: (127.0.0.1) The recommended number of open files is 655350 (Current value: 65535)
[ERROR] OBD-1007: (127.0.0.1) The value of the ulimit parameter "max user processes" must not be less than 120000 (Current value: 31204), Please execute `echo -e "* soft nproc 120000\n* hard nproc 120000" >> /etc/security/limits.d/nproc.conf` as root in 127.0.0.1. if it dosen't work, please check whether UsePAM is yes in /etc/ssh/sshd_config.
[WARN] OBD-1007: (127.0.0.1) The recommended number of core file size is unlimited (Current value: 0)
[WARN] OBD-1007: (127.0.0.1) The recommended number of stack size is unlimited (Current value: 8192)
[WARN] OBD-1017: (127.0.0.1) The value of the "vm.max_map_count" must be within [327600, 1310720] (Current value: 65530, Recommended value: 655360)
[WARN] OBD-1017: (127.0.0.1) The value of the "fs.file-max" must be greater than 6573688 (Current value: 791443, Recommended value: 6573688)
[WARN] OBD-2000: (127.0.0.1) not enough memory. (Free: 132M, Need: 6G)
[WARN] OBD-1012: (127.0.0.1) clog and data use the same disk (/)

Check before start obproxy ok
Check before start obagent ok
Check before start prometheus ok
Check before start grafana ok
See https://www.oceanbase.com/product/ob-deployer/error-codes .
Trace ID: eeb9aeb8-a027-11ef-9e41-005056801edc
If you want to view detailed obd logs, please run: obd display-trace eeb9aeb8-a027-11ef-9e41-005056801edc
复制

启动web部署数据库

  • 默认端口:8680
  • 命令指定端口:obd web -p PORT
[root@localhost ~]# obd web start OBD WEB in 0.0.0.0:8680 please open http://127.0.0.1:8680
复制

image.png

  • 安装
    image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

  • OBD-1007 检查报错
    image.png
  • 解决处理
echo -e "* soft nproc 120000\n* hard nproc 120000" >> /etc/security/limits.d/nproc.conf
复制
  • 再次检查问题,报错:OBD-2008
    image.png
  • 解决方案查找很方便
    image.png

配置时钟源-解决:OBD-2008

  OceanBase 相关产品之间,在时间上都有一些隐含的联系,因此要求 OceanBase 产品的所有服务器的物理时间要保持同步,误差尽量控制在 2 s 以内,甚至更小。因此集群的多个节点以及 OCP 节点的时钟必须配置时钟同步服务 NTP 或者 chrony,保证所有节点的时钟偏差在 2 s 以内。本文介绍如何为集群内的多台机器配置 NTP 时钟源。
如果您是单机安装 OceanBase 数据库,则无需设置。

  • 每台机器上安装NTP
# 查看是否安装 [root@OBCLIENT ~]# yum list | grep ntp ntp.x86_64 4.2.6p5-29.el7.centos.2 ntpdate.x86_64 4.2.6p5-29.el7.centos.2 # 未安装则使用命令进行安装 [root@OBCLIENT ~]# yum install ntp # 启动服务 [root@OBCLIENT ~]# systemctl start ntpd # 开机自启动 [root@OBCLIENT ~]# systemctl enable ntpd # 查看ntp服务器状态 [root@OBCLIENT ~]# ntpstat synchronised to NTP server (100.100.61.88) at stratum 2 time correct to within 14 ms polling server every 1024 s
复制
  • 配置 ntp.conf 文件
[root@OBCLIENT ~]# vim /etc/ntp.conf driftfile /var/lib/ntp/drift # 1.default表示对所有的计算机进行控制 restrict default nomodify notrap nopeer noquery # 局域网可放行可以指定网段或列出单独IP # restrict xxx.xxx.xxx.x mask 255.255.255.0 nomodify # restrict xxx.xxx.xxx.x nomodify # 1.end restrict 127.0.0.1 restrict ::1 # 2.注释掉公网NTP服务器 # server 0.centos.pool.ntp.org iburst # server 1.centos.pool.ntp.org iburst # server 2.centos.pool.ntp.org iburst # server 3.centos.pool.ntp.org iburst # 2.end # 3.开启自身同步 server 127.127.1.0 Fudge 127.127.1.0 stratum 8 # 3.end includefile /etc/ntp/crypto/pw keys /etc/ntp/keys disable monitor
复制
  • 服务器端测试
# 重启服务 [root@OBCLIENT ~]#systemctl restart ntpd # 测试 [root@OBCLIENT ~]# ntpstat synchronised to local net (127.127.1.0) at stratum 6 time correct to within 949 ms polling server every 64 s
复制
  • 客户端配置
    – 安装
    – 客户端配置
[root@OBSERVER ~]# vim /etc/ntp.conf driftfile /var/lib/ntp/drift restrict default nomodify notrap nopeer noquery restrict 127.0.0.1 restrict ::1 # 1.注释掉公网NTP服务器 # server 0.centos.pool.ntp.org iburst # server 1.centos.pool.ntp.org iburst # server 2.centos.pool.ntp.org iburst # server 3.centos.pool.ntp.org iburst # 1.end # 2.开启服务器同步 server 10.10.5.136 Fudge 10.10.5.136 stratum 8 # 2.end includefile /etc/ntp/crypto/pw keys /etc/ntp/keys disable monitor
复制
  • 客户端测试
# 查看NTP服务是否开启 [root@OBSERVER ~]# timedatectl Local time: Fri 2022-03-25 15:29:25 CST Universal time: Fri 2022-03-25 07:29:25 UTC RTC time: Fri 2022-03-25 07:29:24 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: no NTP synchronized: no RTC in local TZ: no DST active: n/a # 开启NTP服务 [root@OBSERVER ~]# timedatectl set-ntp yes [root@OBSERVER ~]# timedatectl Local time: Fri 2022-03-25 15:52:30 CST Universal time: Fri 2022-03-25 07:52:30 UTC RTC time: Fri 2022-03-25 07:52:29 Time zone: Asia/Shanghai (CST, +0800) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: n/a # 重启服务 [root@OBSERVER ~]# systemctl restart ntpd # 测试 [root@OBSERVER ~]# ntpstat unsynchronised time server re-starting polling server every 8 s # 配置后一般要等待几分钟才能与/etc/ntp.conf中的服务器端完成同步 [root@OBSERVER ~]# ntpstat synchronised to NTP server (101.201.69.99) at stratum 7 time correct to within 968 ms polling server every 64 s
复制

检查通过

image.png

开始部署

image.png
image.png

登录数据库

  • obclient -h10.10.5.163 -P2881 -uroot -p’OraclE1234{}’ -Doceanbase -A
    image.png

登录 OCP

  • http://10.10.5.136:8180 账号:amdin 密码:OraclE1234{}
    image.png
  • 监控界面
    image.png

登录 OBP

  • obclient -h10.10.5.136 -P2883 -uroot@proxysys -p’}WozTBO6#’ -Doceanbase -A
    image.png

学习小结

  • 通过OBD白屏部署另类的图形界面部署很方便,尤其这种多个服务器的分布部署,统一管理部署很方便;
  • 建议安装规范文档,有个前置准备或要求,例如文档上是用admin用户安装的,找了半天没找到admin用户创建的相关内容,我这边用root安装到一半了,找到admin创建的命令了已经没办法回退了。

欢迎赞赏支持或留言指正
image.png

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

文章被以下合辑收录

评论