环境介绍:
- centos 7.6
- 可用内存不少于8G
- 安装目录空间不少于50G(默认安装在当前安装用户的家目录下)
1. 什么是obd?
odb是oceanbase社区版部署工具oceanbase deployer的简称,通过obd可以快速完成oceanbase clusterr的部署。
不传入配置文件的情况下,在单机通过执行obd demo在线快速(默认使用远程仓库)部署oceanbase cluster的最新版本,集群名称是demo。
使用obd demo在线快速部署单副本集群,默认安装的组件:grafana、obproxy-ce、oceanbase-ce、obagent、prometheus,版本是当前最新版本。
下载需要的组件,使用obd demo离线快速部署单副本集群。
2. 下载oceanbase组件包:ob-deploy、obclient、oceanbase、obproxy,到/tmp/ob/目录
https://www.oceanbase.com/softwarecenter
3. 安装obd
[root]# rpm -ivh ob-deploy-2.0.0-10.el7.x86_64.rpm
4. 删除远程仓库()
[root]# rm -fr /root/.obd/mirror/remote/OceanBase.repo
5. 将下载的组件报复制到本地仓库
[root]# obd mirror clone /tmp/ob/*.rpm
6. 查看本地镜像仓库中的组件信息
[root]# obd mirror list local
+----------------------------------------------------------------------------------------------------------+
| local Package List |
+-------------------+---------+------------------------+--------+------------------------------------------+
| name | version | release | arch | md5 |
+-------------------+---------+------------------------+--------+------------------------------------------+
| libobclient | 2.2.2 | 3.el7 | x86_64 | c27a06e49690660f747a5935adab7a034629bcd2 |
| obclient | 2.2.2 | 1.el7 | x86_64 | 9d1b3d21f9274f74bdca36ed19f127842849923f |
| ob-deploy | 2.0.0 | 10.el7 | x86_64 | 130fee987e0c1ab430fbdd0d733d3f135ab977a2 |
| obproxy-ce | 4.0.0 | 5.el7 | x86_64 | de53232a951184fad75b15884458d85e31d2f6c3 |
| oceanbase-ce | 4.0.0.0 | 100000272022110114.el7 | x86_64 | 42611dc51ca9bb28f36e60e4406ceea4a74914c7 |
| oceanbase-ce-libs | 4.0.0.0 | 100000272022110114.el7 | x86_64 | 188919f8128394bf9b62e3989220ded05f1d14da |
+-------------------+---------+------------------------+--------+------------------------------------------+
Trace ID: 81f3542a-df15-11ed-a18d-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace 81f3542a-df15-11ed-a18d-000c29501e19
7. 使用本地镜像仓库部署指定安装组件:obclient、obproxy-ce、oceanbase-ce,报“No such install plugin for obclient-2.2.2”
[root]# obd demo -c obclient,obproxy-ce,oceanbase-ce
Package obclient-2.2.2-1.el7 is available.
[ERROR] No such install plugin for obclient-2.2.2
Trace ID: bc184e5e-df14-11ed-8257-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace bc184e5e-df14-11ed-8257-000c29501e19
8. 使用本地镜像仓库部署指定安装组件:obproxy-ce、oceanbase-ce,后面使用rpm安装obclient
[root]# obd demo -c obproxy-ce,oceanbase-ce
Cluster param config check ok
Open ssh connection ok
Generate obproxy configuration ok
Generate observer configuration ok
+--------------------------------------------------------------------------------------------+
| Packages |
+--------------+---------+------------------------+------------------------------------------+
| Repository | Version | Release | Md5 |
+--------------+---------+------------------------+------------------------------------------+
| obproxy-ce | 4.0.0 | 5.el7 | de53232a951184fad75b15884458d85e31d2f6c3 |
| oceanbase-ce | 4.0.0.0 | 100000272022110114.el7 | 42611dc51ca9bb28f36e60e4406ceea4a74914c7 |
+--------------+---------+------------------------+------------------------------------------+
Repository integrity check ok
Parameter check ok
Open ssh connection ok
Cluster status check ok
Initializes obproxy work home ok
Initializes observer work home ok
Remote obproxy-ce-4.0.0-5.el7-de53232a951184fad75b15884458d85e31d2f6c3 repository install ok
Remote obproxy-ce-4.0.0-5.el7-de53232a951184fad75b15884458d85e31d2f6c3 repository lib check ok
Remote oceanbase-ce-4.0.0.0-100000272022110114.el7-42611dc51ca9bb28f36e60e4406ceea4a74914c7 repository install ok
Remote oceanbase-ce-4.0.0.0-100000272022110114.el7-42611dc51ca9bb28f36e60e4406ceea4a74914c7 repository lib check !!
Try to get lib-repository
Remote oceanbase-ce-libs-4.0.0.0-100000272022110114.el7-188919f8128394bf9b62e3989220ded05f1d14da repository install ok
Remote oceanbase-ce-4.0.0.0-100000272022110114.el7-42611dc51ca9bb28f36e60e4406ceea4a74914c7 repository lib check ok
demo deployed
Get local repositories ok
Search plugins ok
Open ssh connection ok
Load cluster param plugin ok
Check before start observer ok
[WARN] OBD-1012: (127.0.0.1) clog and data use the same disk (/)
Check before start obproxy ok
Start observer ok
observer program health check ok
Connect to observer ok
Initialize oceanbase-ce ok
Start obproxy ok
obproxy program health check ok
Connect to obproxy ok
Initialize obproxy-ce ok
Wait for observer init ok
+---------------------------------------------+
| observer |
+-----------+---------+------+-------+--------+
| ip | version | port | zone | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 4.0.0.0 | 2881 | zone1 | ACTIVE |
+-----------+---------+------+-------+--------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A
+---------------------------------------------+
| obproxy |
+-----------+------+-----------------+--------+
| ip | port | prometheus_port | status |
+-----------+------+-----------------+--------+
| 127.0.0.1 | 2883 | 2884 | active |
+-----------+------+-----------------+--------+
obclient -h127.0.0.1 -P2883 -uroot -Doceanbase -A
demo running
Trace ID: 548dcd48-df16-11ed-9947-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace 548dcd48-df16-11ed-9947-000c29501e19
9. 查看集群信息
[root]# obd cluster list
+--------------------------------------------------+
| Cluster List |
+------+-------------------------+-----------------+
| Name | Configuration Path | Status (Cached) |
+------+-------------------------+-----------------+
| demo | /root/.obd/cluster/demo | running |
+------+-------------------------+-----------------+
Trace ID: bd632fd4-df16-11ed-85ee-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace bd632fd4-df16-11ed-85ee-000c29501e19
10. 查看demo集群组件信息
[root]# obd cluster display demo
Get local repositories and plugins ok
Open ssh connection ok
Cluster status check ok
Connect to observer ok
Wait for observer init ok
+---------------------------------------------+
| observer |
+-----------+---------+------+-------+--------+
| ip | version | port | zone | status |
+-----------+---------+------+-------+--------+
| 127.0.0.1 | 4.0.0.0 | 2881 | zone1 | ACTIVE |
+-----------+---------+------+-------+--------+
obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A
Connect to obproxy ok
+---------------------------------------------+
| obproxy |
+-----------+------+-----------------+--------+
| ip | port | prometheus_port | status |
+-----------+------+-----------------+--------+
| 127.0.0.1 | 2883 | 2884 | active |
+-----------+------+-----------------+--------+
obclient -h127.0.0.1 -P2883 -uroot -Doceanbase -A
Trace ID: c9dedb64-df16-11ed-bd44-000c29501e19
If you want to view detailed obd logs, please run: obd display-trace c9dedb64-df16-11ed-bd44-000c29501e19
11. rpm方式安装obclient
[root]# rpm -ivh .obd/mirror/local/obclient-2.2.2-1.el7.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:obclient-2.2.2-1.el7 ################################# [100%]
12. 连接oceanbase(密码为空)
[root]# obclient -h127.0.0.1 -P2881 -uroot -Doceanbase -A -p
参考:《oceanbase社区版入门与实战.pdf》