资源规划建议
ocp主机1台 内存:64G CPU1:2C及以上 硬盘大于500G
observer服务器3台 内存32G CPU:4C以上 硬盘大于1T 建议存储硬盘与操作系统硬盘隔开实现IO隔离
一、OBD、OCP安装包准备

[root@observer /]# chown -R admin:admin /software/
[root@observer /]# ls -ld /software/
drwxr-xr-x 6 admin admin 4096 Apr 16 05:00 /software/
二、OBD部署
2.1本地安装obd
rpm -ivh ob-deploy-2.7.0-5.el7.x86_64.rpm
source /etc/profile.d/obd.sh

三、OCP部署
3.1解压ocp
tar -zxf ocp-all-in-one-4.2.2-20240329111923.el7.x86_64.tar.gz

3.2解压部署程序并安装
执行如下命令进入解压后软件包的 bin 目录下安装部署程序
cd /software/obsq/ocp-all-in-one/bin && bash install.sh

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
生效环境变量
source ~/.oceanbase-all-in-one/bin/env.sh
配置环境变量
[admin@observer bin]$ cd ~/.oceanbase-all-in-one/bin/
[admin@observer bin]$ ls
env.sh install.sh uninstall.sh
[admin@observer bin]$ cat env.sh
#!/bin/bash
export OBD_INSTALL_PRE=~/.oceanbase-all-in-one/obd
source $OBD_INSTALL_PRE/etc/profile.d/obd.sh
export OBCLIENT_HOME=~/.oceanbase-all-in-one/obclient
export PATH=OBD_INSTALL_PRE/usr/bin:OBCLIENT_HOME/u01/obclient/bin:$PATH
[admin@observer bin]$ vi ~/.bash_profile
[admin@observer bin]$ cat ~/.bash_profile
Source /root/.bashrc if user has one
[ -f ~/.bashrc ] && . ~/.bashrc
export OBD_INSTALL_PRE=~/.oceanbase-all-in-one/obd
source $OBD_INSTALL_PRE/etc/profile.d/obd.sh
export OBCLIENT_HOME=~/.oceanbase-all-in-one/obclient
export PATH=OBD_INSTALL_PRE/usr/bin:OBCLIENT_HOME/u01/obclient/bin:$PATH
[admin@observer bin]$ . ~/.bash_profile
3.3 启动obd
3.3.1执行 obd web install在返回信息中获取部署向导页面的 IP 地址

3.3.2进入浏览器登录输出结果的网址

3.4 选择OCP产品并点击确定

3.5 选择创建全新的 OceanBase 数据库

3.6 配置部署信息
- 自定义待管理的 OceanBase 集群名称
该名称具有唯一性,且集群名称必须以英文字母开头,英文或数字结尾,长度为 2~32 字符。
- 选择要部署的产品版本
OceanBase 与 OBProxy 的版本具有关联性。例如,当选择部署 V4.1.0 及以上版本的 OceanBase 数据库时,仅支持部署 V4.1.0 及以上版本的 OBProxy。

下一步

3.7 metadb配置
3.7.1部署用户配置
这里注意zone1设置为ocp的服务器其他的zone删除即可,如果ocp是集群可以选择多个zone对应的服务器。


3.7.2集群配置
注意ocp主机内存为64G,确保主机有足够的内存否则在分配组件资源的时候无法正常完成安装。


更多配置


3.8 OCP配置
3.8.1服务配置

校验端口

3.8.2资源规划
注意:资源有限的情况下默认即可,如果主机内存及CPU资源远超过文档的资源按找实际资源分配ocp组件的资源,资源越多性能越好.

3.8.3确认信息后预检查

遇到可以自动修复的选择自动修复,这里为了演示搭建直接选择自动修复
注意:该问题是磁盘目录资源不足,文档资源为500G,正常存储盘需要单独挂载划分需大于1T

没有报错直接下一步

3.8.4部署过程及日志查看


记录ocp obproxy相关的obclient登录信息便于后期黑屏登录使用。
后台安装日志:

3.8.5 OCP部署成功(整体部署时间在5~10分钟左右)

记录ocp登录ip、用户名、密码便于登录使用。
四、登录OCP进行ocp集群相关白屏take over操作

按照之前安装完成给的用户密码登录

4.1执行任务Take over primary OB cluster

第二步报错选择跳过即可。

4.2查看租户状态


4.2OCP集群重启
obd cluster list
obd cluster stop cluster_obtest

启动过程稍长,请耐心等待(3-5分钟)
obd cluster start cluster_obtest
