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

0074.O 使用obd对oceanbase社区版集群停启

rundba 2021-07-26
2512

oceanbase社区版3.1.0使用了OceanBase Deploy(obd)进行集群的管理,不同于企业版使用OCP进行集群管理,下文介绍使用obd对集群停启操作。

0.ENV

  • CentOS7.6.1810;

  • OceanBase-CE-3.1.0;

  • OceanBase Deploy 1.0.2。

1. 查看当前集群信息

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_test
      config.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

        2. 使用obd停止集群

        1) 停止前查看进程

          [root@ob3 ~]# pidof observer
          36376 36347 36339
          [root@ob3 ~]# pidof obproxy
          38182 38146 38137

          2) 停止

          obd先停止observer、再停止obproxy。

            [admin@ob3 ~]$ obd cluster stop obcp_test
            Get local repositories and plugins ok
            Open ssh connection ok
            Stop observer ok
            Stop obproxy ok
            obcp_test stopped

            3) 停止后查看进程

              [admin@ob3 ~]$ pidof obproxy
              [admin@ob3 ~]$ pidof observer

              obproxy、observer进程不存在。

              3. 使用obd启动集群

              obd先启动observer,再启动obproxy。

                [admin@ob3 ~]$ obd cluster start obcp_test
                Get local repositories and plugins ok
                Open ssh connection ok
                Cluster param config check ok
                Check before start observer ok
                Check before start obproxy ok
                Start observer ok
                observer program health check ok
                Connect to observer ok
                Wait 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 ok
                obproxy program health check ok
                Connect to obproxy ok
                Initialize 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

                4. obd命令帮助

                obd可对集群、镜像进行操作,也可以进行部署测试,obd升级等功能:

                  [admin@ob3 ~]$ obd
                  You need to give some command
                  Usage: obd <command> [options]

                  Available Commands:
                  cluster        deploy and manager cluster
                  mirror         Manage a component repository for obd.
                  test           run test for a running deploy
                  update update obd

                  Options:
                  --version show program's version number and exit
                  -h, --help show this help message and exit
                  -v, --verbose verbose operation

                  可进一步对obd命令查看帮助,如:

                    obd cluster -h
                    obd mirror -h

                    5. 小结

                    在oceanbase社区版中,提供的OceanBase Deploy(obd)工具可以方便的管理集群,如集群部署、停、启、编辑等操作,obd同时提供对obd repository管理,部署测试,obd升级等功能。

                    6. 更多OBD功能

                    详见:

                    https://gitee.com/oceanbase/obdeploy/blob/master/README.md


                    -  完 -

                    旨在交流,不足之处,还望抛砖。

                    作者:王坤,微信公众号:rundba,欢迎转载,转载请注明出处。

                    如需公众号转发,请联系wx: landnow。


                    文章转载自rundba,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

                    评论