跳转至

seabox stop

seabox stop

停止SeaboxMPP数据库服务

语法

``` bash seabox stop [OPTIONS]

Options: -a, –prompt execute automatically -g, –group TEXT logic group -f, –fast fast shutdown, active transactions interrupted and rolled back

-i, –immediate immediate shutdown, active transaction aborted

-s, –smart smart shutdown, wait for active transaction to complete (default)

-t, –timeout INTEGER time to wait for module stop (in seconds), default: 120s

-v, –verbose debug output -M, –mode [fast|immediate|smart] set the method of shutdown, default: smart -h, –help show this help, then exit ```

描述

停止SeaboxMPP数据库服务,支持停止指定的逻辑集群,支持设置关闭方法(fast,immediate或smart),支持设置组件停止的最大超时时间等等

  • 注意:如有注意事项,补充
选项

该命令支持选项说明如下:

Options

命令支持的选项

-a, --prompt
使用该选项时表示自动执行,不再需要用户确认
-g, --group
使用该选项时表示停止逻辑集群,后面跟指定的逻辑集群名称
-f, --fast
使用该选项时表示采用fast关闭模式,活动事务中断并回滚
-i, --immediate
使用该选项时表示采用immediate关闭模式,活动事务中止
-s, --smart
使用该选项时表示采用smart关闭模式,等待活动事务结束后再关闭。该模式为默认的关闭模式
--timeout
使用该选项时表示设置组件停止的最大超时时间,后面跟指定的最大超时时间。默认为120s
-v, --verbose
使用该选项时表示程序运行过程中,输出详细的调试信息,便于故障定位
-M, --mode
使用该选项时设置关闭方法。可以是fast,immediate,smart,默认为smart
-h, --help
使用该选项时返回seabox stop命令的帮助信息
注解

如有具体的使用限制及注意事项,在这部分列出。

  • 注意:
  • seabox stop命令要求使用SeaboxMPP数据库集群安装用户seabox,或root用户,且需通过以下命令设置正确的环境变量:
source $SDHOME/seaboxmpp_path.sh

其中,$SDHOME为安装SeaboxMPP数据库服务的主目录。

  1. 当使用-M immediate模式停止时,如果seaboxsql.conf中配置了restore_command选项,可能会导致wal相关数据处于中间状态。seaboxsql下次启动时,读取到这种中间状态的数据将会启动失败。
示例

以下是seabox stop --help的执行结果:

[seabox@mpp-test-1 bin]$ seabox stop --help
stop seabox service.

Usage: 
  seabox stop [OPTIONS]

Options:
  -a, --prompt                    execute automatically
  -g, --group TEXT                logic group
  -f, --fast                      fast shutdown, active transactions
                                  interrupted and rolled back

  -i, --immediate                 immediate shutdown, active transaction
                                  aborted

  -s, --smart                     smart shutdown, wait for active transaction
                                  to complete (default)

  -t, --timeout INTEGER           time to wait for module stop (in seconds),
                                  default: 120s

  -v, --verbose                   debug output
  -M, --mode [fast|immediate|smart]
                                  set the method of shutdown, default: smart
  -h, --help                      show this help, then exit

以下命令可停止数据库服务

[seabox@sy1 mpp]$ seabox stop -a
2022-07-07 03:19:44 UTC [11860] seabox_stop sy1:seabox INFO: gathering information and validating the environment...
2022-07-07 03:19:44 UTC [11860] seabox_stop sy1:seabox INFO: seabox version: 'seaboxsql (SeaboxSQL) 21.1.0.1678'
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: coordinator instance parameters
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    shutdown mode   = smart
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    timeout         = 120
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: coodinator instances that will be shutdown:
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    host   datadir                                 port    status
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/coordinatordd/0   33711   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: executor instances that will be shutdown:
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    host   datadir                                       port    status
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy2    /home/seabox/mpp/data/executordd/mirror/0/2   33724   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/executordd/mirror/0/3   33722   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/executordd/mirror/0/4   33723   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/executordd/mirror/0/5   33724   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/executordd/primary/0    33712   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/executordd/primary/1    33713   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/executordd/primary/2    33714   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy2    /home/seabox/mpp/data/executordd/primary/3    33712   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy2    /home/seabox/mpp/data/executordd/primary/4    33713   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy2    /home/seabox/mpp/data/executordd/primary/5    33714   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy2    /home/seabox/mpp/data/executordd/mirror/0/0   33722   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy2    /home/seabox/mpp/data/executordd/mirror/0/1   33723   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: gtm instances that will be shutdown:
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    Host   Datadir                     Port    Status
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/gtm   33726   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: monitor instances that will be shutdown:
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    Host   Datadir                                          Status
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/coordinatordd/monitor/14   u
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: scdcs instances that will be shutdown:
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: --------------------------------------------
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    Host   Datadir                         ServicePort   InnerPort
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO:    sy1    /home/seabox/mpp/data/scdcs/0   33731         33732
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: stop monitor
2022-07-07 03:19:46 UTC [11860] seabox_stop sy1:seabox INFO: successfully shutdown 1 of 1 monitor instances
..
2022-07-07 03:19:49 UTC [11860] seabox_stop sy1:seabox INFO: stop audit
2022-07-07 03:19:50 UTC [11860] seabox_stop sy1:seabox INFO: targeting dbid ['1'] for shutdown
2022-07-07 03:19:50 UTC [11860] seabox_stop sy1:seabox INFO: commencing parallel coordinator instance shutdown, please wait...
2022-07-07 03:19:50 UTC [11860] seabox_stop sy1:seabox INFO: stopping coordinators and waiting for user connections to finish ...
..
2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO: ----------------------------------------------------
2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO:    coordinators stopped successfully      = 1
2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO:    coordinators with errors during stop   = 0
2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO: ----------------------------------------------------
2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO: successfully shutdown 1 of 1 coordinator instances 
2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO: database successfully shutdown with no errors reported

2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO: targeting dbid ['10', '11', '12', '13', '2', '3', '4', '5', '6', '7', '8', '9'] for shutdown
2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO: commencing parallel executor instance begin to shutdown, checkpoint maybe take few minutes, please wait patiently...
2022-07-07 03:19:53 UTC [11860] seabox_stop sy1:seabox INFO: 0.00% of jobs completed
2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO: 100.00% of jobs completed
2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO: ----------------------------------------------------
2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO:    executors stopped successfully      = 12
2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO:    executors with errors during stop   = 0
2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO: ----------------------------------------------------
2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO: successfully shutdown 12 of 12 executor instances 
2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO: database successfully shutdown with no errors reported

2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO: stop gtm
2022-07-07 03:19:55 UTC [11860] seabox_stop sy1:seabox INFO: 0.00% of jobs completed
2022-07-07 03:19:56 UTC [11860] seabox_stop sy1:seabox INFO: 100.00% of jobs completed

2022-07-07 03:19:57 UTC [11860] seabox_stop sy1:seabox INFO: stop scdcs service
相关命令