oceanbase社区版3.1.0使用了OceanBase Deploy(obd)进行集群的管理,不同于企业版使用OCP进行集群管理,下文介绍使用obd对集群停启操作。
CentOS7.6.1810;
OceanBase-CE-3.1.0;
OceanBase Deploy 1.0.2。
1) 查看集群信息
admin用户下执行"obd cluster list":
[admin@ob3 ~]$ obd cluster list+------------------------------------------------------------------+| Cluster List |+-----------+------------------------------------+-----------------+| Name | Configuration Path | Status (Cached) |+-----------+------------------------------------+-----------------+| obcp_test | home/admin/.obd/cluster/obcp_test | running |+-----------+------------------------------------+-----------------+
显示集群名称为obcp_test;
配置路径/home/admin/.obd/cluster/obcp_test;
running表示当前进行运行,关闭状态会显示stopped。
2) 查看(编辑)配置文件
[admin@ob3 ~]$ ls home/admin/.obd/cluster/obcp_testconfig.yaml
配置文件内容可以通过cat config.yaml查看(或vi config.yaml编辑),也可通过"obd cluster edit-config obcp_test"进行查看(编辑)。
3) [ERROR] obd is running报错
当前主机只能运行1个obd命令,如果停止或启动过程中,使用obd查看集群会报错:
[admin@ob3 ~]$ obd cluster list[ERROR] obd is running
1) 停止前查看进程
[root@ob3 ~]# pidof observer36376 36347 36339[root@ob3 ~]# pidof obproxy38182 38146 38137
2) 停止
obd先停止observer、再停止obproxy。
[admin@ob3 ~]$ obd cluster stop obcp_testGet local repositories and plugins okOpen ssh connection okStop observer okStop obproxy okobcp_test stopped
3) 停止后查看进程
[admin@ob3 ~]$ pidof obproxy[admin@ob3 ~]$ pidof observer
obproxy、observer进程不存在。
obd先启动observer,再启动obproxy。
[admin@ob3 ~]$ obd cluster start obcp_testGet local repositories and plugins okOpen ssh connection okCluster param config check okCheck before start observer okCheck before start obproxy okStart observer okobserver program health check okConnect to observer okWait for observer init ok+---------------------------------------------+| observer |+-----------+---------+------+-------+--------+| ip | version | port | zone | status |+-----------+---------+------+-------+--------+| 127.0.0.1 | 3.1.0 | 2881 | zone1 | active || 127.0.0.1 | 3.1.0 | 3881 | zone2 | active || 127.0.0.1 | 3.1.0 | 4881 | zone3 | active |+-----------+---------+------+-------+--------+Start obproxy okobproxy program health check okConnect to obproxy okInitialize cluster+---------------------------------------------+| obproxy |+-----------+------+-----------------+--------+| ip | port | prometheus_port | status |+-----------+------+-----------------+--------+| 127.0.0.1 | 2883 | 2888 | active || 127.0.0.1 | 3883 | 3888 | active || 127.0.0.1 | 4883 | 4888 | active |+-----------+------+-----------------+--------+obcp_test running
obd可对集群、镜像进行操作,也可以进行部署测试,obd升级等功能:
[admin@ob3 ~]$ obdYou need to give some commandUsage: obd <command> [options]Available Commands:cluster deploy and manager clustermirror Manage a component repository for obd.test run test for a running deployupdate update obdOptions:--version show program's version number and exit-h, --help show this help message and exit-v, --verbose verbose operation
可进一步对obd命令查看帮助,如:
obd cluster -hobd mirror -h
在oceanbase社区版中,提供的OceanBase Deploy(obd)工具可以方便的管理集群,如集群部署、停、启、编辑等操作,obd同时提供对obd repository管理,部署测试,obd升级等功能。
详见:
https://gitee.com/oceanbase/obdeploy/blob/master/README.md
旨在交流,不足之处,还望抛砖。
作者:王坤,微信公众号:rundba,欢迎转载,转载请注明出处。
如需公众号转发,请联系wx: landnow。




