2.5 如何安装 OBD 自动化部署软件
OBD 全称为 OceanBase Deployer,是 OceanBase 数据库社区版的命令行自动化部署软件。 根据中控机器能否连接公网,提供离线和在线两种安装方法,您可根据实际情况选择安装方式。
安装 OBD 软件(离线)
您需要在中控机上部署 OBD 软件。如果中控机不能上网,则需要提前下载好 OBD、OceanBase 和 ODP 相关软件包。
下载相关软件包
请根据使用的操作系统版本下载对应的软件包。
Redhat / CentOS 7.x 下载地址:https://mirrors.aliyun.com/oceanbase/community/stable/el/7/x86_64
Redhat / CentOS 8.x 下载地址:https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64
下载 Redhat / CentOS 8.x 相关软件命令:
wget https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/ob-deploy-x.x.x-*.rpm wget https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/oceanbase-ce-x.x.x-*.rpm wget https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/oceanbase-ce-libs-x.x.x-*.rpm wget https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/obclient-x.x.x-*.rpm wget https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/libobclient-x.x.x-*.rpm wget https://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/obproxy-x.x.x-*.rpm
说明
请根据实际需求下载软件包,建议使用最新版本的软件。
离线安装 OBD
您可执行如下命令通过 RPM 安装 OBD。
rpm -ivh ob-deploy-x.x.x-*.rpm
ob-deploy 软件默认安装在 /usr/obd 下。不同版本可能有点变化,您可通过以下命令查看安装位置。
rpm -ql `rpm -qa|grep ob-deploy`
但是 OBD 工作的文件都在当前用户 HOME 目录下:~/.obd/。
[admin@obce00 ~]$ tree ~/.obd -L 1 /home/admin/.obd ├── cluster ├── log ├── mirror ├── obd.conf ├── plugins ├── repository └── version 5 directories, 2 files
您可使用 -h 查看 OBD 命令使用帮助。
obd -h 输出: [admin@obce00 ~]$ obd -h Usage: obd <command> [options] Available commands: cluster Deploy and manage a cluster. mirror Manage a component repository for OBD. repo Manage local repository for OBD. test Run test for a running deploy deployment. update Update OBD. Options: --version show program's version number and exit -h, --help Show help and exit. -v, --verbose Activate verbose output.
将软件包添加到离线仓库
注意
下面命令需在部署运行 OBD 的操作系统用户下操作。这里是用户 admin。
您可使用如下命令禁用远程镜像仓库。
obd mirror disable remote
使用下面命令将前面的软件包复制到本地仓库。
obd mirror clone /tmp/obd/*.rpm
查看仓库的 RPM 列表。
obd mirror list local
输出:
[admin@obce00 ~]$ obd mirror list local +-------------------------------------------------------------------------------------------+ | local Package List | +-------------------+---------+---------+--------+------------------------------------------+ | name | version | release | arch | md5 | +-------------------+---------+---------+--------+------------------------------------------+ | libobclient | 2.0.0 | 2.el8 | x86_64 | 358a90b4a47da193140c3bee023b2450126de4c6 | | obclient | 2.0.0 | 2.el8 | x86_64 | 71753559d82e9f6c0b8a6d949b9a5194c6c53dc6 | | ob-deploy | 1.1.0 | 1.el8 | x86_64 | 0c84129b699aca0b43fdfb01fb2c4439f36ff856 | | obproxy | 3.1.0 | 1.el8 | x86_64 | d242ea5fe45222b8f61c3135ba2aaa778c61ea22 | | oceanbase-ce | 3.1.0 | 3.el8 | x86_64 | 84bd2fe27f8b8243cc57d8a3f68b4c50f94aab80 | | oceanbase-ce-libs | 3.1.0 | 3.el8 | x86_64 | 1c20be0df8929f843e9bdd509de4916f883d62f8 | +-------------------+---------+---------+--------+------------------------------------------+
安装 OBD 软件(在线)
在中控机上部署 OBD 软件。
如果中控机能上网,您可直接添加 OceanBase 数据库的仓库,使用 YUM 安装。
yum install -y yum-utils yum-config-manager --add-repo https://mirrors.aliyun.com/oceanbase/OceanBase.repo yum install -y ob-deploy
说明 YUM 命令默认安装最新版本,您可通过声明版本号安装指定版本,如使用
yum install -y ob-deploy-1.3.3命令安装 OBD V1.3.3。推荐安装最新版本。查看
OceanBase.repo内容。cat /etc/yum.repos.d/OceanBase.repo 输出: # OceanBase.repo [oceanbase.community.stable] name=OceanBase-community-stable-el$releasever baseurl=http://mirrors.aliyun.com/oceanbase/community/stable/el/$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://mirrors.aliyun.com/oceanbase/RPM-GPG-KEY-OceanBase [oceanbase.development-kit] name=OceanBase-development-kit-el$releasever baseurl=http://mirrors.aliyun.com/oceanbase/development-kit/el/$releasever/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://mirrors.aliyun.com/oceanbase/RPM-GPG-KEY-OceanBase




