lightdb22.2-新增集群启停脚本

lightdb22.2 - 新增集群启停脚本 lightdb_service.py

lightdb22.2 版本新增了集群启停脚本,脚本名为lightdb_service.py。使用python2.7开发。使用该脚本会对涉及的lightdb,ltcluster,keepalive 进行相应操作。

由于需要依赖installer安装后生成的json文件来获取集群信息,目前此脚本只能用于通过installer安装的数据库集群,且需要使用root用户执行(因为涉及keepalive的启停,需要root权限)。

用法

usage: lightdb_service.py [-h] [-F OP_INSTALL_INFO]
                          [-c {start,stop,restart,status}] [-C] [-D] [-P] [-S]
                          [--dry-run] [-f] [-B <parallel_processes>] [-v] [-q]
                          [-l <directory>]

optional arguments:
  -h, --help            show this help message and exit
  -F OP_INSTALL_INFO, --filename OP_INSTALL_INFO
                        specifies the path to a json file containing
                        installation information
  -c {start,stop,restart,status}, --command {start,stop,restart,status}
                        start/stop/restart/status lightdb service
  -C, --cn_only         only start/stop coordinator node
  -D, --dn_only         only start/stop data node
  -P, --primary_only    only start/stop primary node for primary restart
  -S, --standby_only    only start/stop standby node for standby restart
  --dry-run             show what would happen for action, but don't execute
                        it
  -f, --force           force stop of cluster even if some nodes are in
                        incorrect state, skip incorrect nodes
  -B <parallel_processes>, --parallel <parallel_processes>
                        number of segment hosts to run in parallel. Default is
                        1
  -v, --verbose         debug print
  -q, --quiet           suppress status messages for stdout logging
  -l <directory>, --log_dir <directory>
                        Logfile directory, default is /tmp/ltAdminLogs

启动/停止/重启当前集群

lightdb_service.py -c start/stop/restart

启动/停止/重启所有CN节点

lightdb_service.py -c start/stop/restart --cn_only 

启动/停止/重启所有DN节点

lightdb_service.py -c start/stop/restart --dn_only 

启动/停止/重启所有主节点

lightdb_service.py -c start/stop/restart --primary_only 

启动/停止/重启所有备节点

lightdb_service.py -c start/stop/restart --standby_only 

在启动/停止/重启对DN节点进行并发处理

lightdb_service.py -c start/stop/restart --parallel 4 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

紫无之紫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值