跳转至

集群卸载

集群卸载

发生以下情况时,可能需要将已经安装的集群卸载掉:

  1. 集群所有节点二进制文件安装或初始化时,如中途报错或发生其他异常,导致无法重复执行安装或初始化命令;

  2. 集群重新部署或需要销毁时卸载。

集群卸载按以下步骤执行:

  1. 集群最初安装的coordinator节点上,切换为seabox用户:

    # su - seabox
    
  2. 确保集群服务已全部停止,如未停止,执行seabox stop命令停止:

    [seabox@scnode1 ~]$ seabox stop -a 
    20210422:19:12:51:079939 seabox_stop:scnode1:seabox-[INFO]:-Gathering information and validating the environment...
    20210422:19:12:51:079939 seabox_stop:scnode1:seabox-[INFO]:-Seabox Version: 'seaboxsql (SeaboxSQL) 21.0.0.0'
    20210422:19:12:53:079939 seabox_stop:scnode1:seabox-[INFO]:-Stop monitor
    20210422:19:12:53:079939 seabox_stop:scnode1:seabox-[INFO]:-Targeting dbid [1, 2, 3] for shutdown
    20210422:19:12:53:079939 seabox_stop:scnode1:seabox-[INFO]:-Commencing parallel coordinator instance shutdown, please wait...
    20210422:19:12:53:079939 seabox_stop:scnode1:seabox-[INFO]:-0.00% of jobs completed
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-100.00% of jobs completed
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-----------------------------------------------------
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-   coordinators stopped successfully      = 3
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-   coordinators with errors during stop   = 0
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-----------------------------------------------------
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-Successfully shutdown 3 of 3 coordinator instances 
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-Database successfully shutdown with no errors reported
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-Targeting dbid [4, 7, 5, 8, 6, 9] for shutdown
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-Commencing parallel executor instance begin to shutdown, checkpoint maybe take few minutes, please wait patiently...
    20210422:19:12:55:079939 seabox_stop:scnode1:seabox-[INFO]:-0.00% of jobs completed
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-100.00% of jobs completed
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-----------------------------------------------------
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-   executors stopped successfully      = 6
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-   executors with errors during stop   = 0
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-----------------------------------------------------
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-Successfully shutdown 6 of 6 executor instances 
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-Database successfully shutdown with no errors reported
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-Cleaning up leftover scmmon process
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-Cleaning up leftover scsmon processes
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-Stop gtm
    20210422:19:12:58:079939 seabox_stop:scnode1:seabox-[INFO]:-0.00% of jobs completed
    20210422:19:12:59:079939 seabox_stop:scnode1:seabox-[INFO]:-100.00% of jobs completed
    20210422:19:12:59:079939 seabox_stop:scnode1:seabox-[INFO]:-Stop scdcs service
    
  3. 执行seabox uninstall命令卸载集群,注意:如集群已完成初始化,默认seabox uninstall不会删除各组件数据目录,如需要删除所有数据目录需要使用参数--force-clear-data,命令及输出如下:

    [seabox@scnode1 ~]$ seabox uninstall --force-clear-data
    20210422:19:18:25:080288 seabox_install:scnode1:seabox-[INFO]:-read info from scdcs
    20210422:19:18:25:080288 seabox_install:scnode1:seabox-[INFO]:-check scdcs active
    20210422:19:18:25:080288 seabox_install:scnode1:seabox-[INFO]:-Cannot get infomation from scdcs! Will read scdcs dump file
    20210422:19:18:25:080288 seabox_install:scnode1:seabox-[INFO]:-read info from scdcs dump file
    20210422:19:18:25:080288 seabox_install:scnode1:seabox-[INFO]:-check cluster password access
    20210422:19:18:25:080288 seabox_install:scnode1:seabox-[INFO]:-de-duplicate hostnames
    20210422:19:18:25:080288 seabox_install:scnode1:seabox-[INFO]:-coordinator hostname: scnode1
    
    All Seabox data will be cleared Yy|Nn (default=N):
    > y
    20210422:19:18:29:080288 seabox_install:scnode1:seabox-[INFO]:-uninstall cluster
    20210422:19:18:29:080288 seabox_install:scnode1:seabox-[INFO]:-Remove data path
    20210422:19:18:29:080288 seabox_install:scnode1:seabox-[INFO]:-Remove binary path
    20210422:19:18:31:080288 seabox_install:scnode1:seabox-[INFO]:-SUCCESS -- Requested commands completed
    

    注意:删除数据目录时,要求必须手工确认。