跳转至

seabox collect

seabox collect

收集集群日志和core等文件

语法

``` bash seabox collect [OPTIONS]

Options: -l, –log collect cluster log -c, –core collect cluster core -C, –crash print cluster crash info -a, –all collect cluster log and core -m, –module_type TEXT which module to collect, "all" is default –dbid TEXT collect information of specified dbid, can only be specified when module_type is coordinator or executor, multiple dbids are split with ","

–begin_time TEXT collect file newer than begin time, exclusive –end_time TEXT collect file not newer than begin time, inclusive -t, –tar_command TEXT the options to tar, "zcf" is default -k, –keyword TEXT collect files contain keyword, can only be specified when log is collected

-h, –host TEXT collect information of specified host, multiple dbids are split with ","

–quiet do not print info messages -?, –help show this help, then exit
```

描述

收集集群日志和core等文件,支持收集指定的集群组件上的文件,支持收集指定集群组件实例上的文件,支持收集指定时间以前或以后的文件,支持收集指定host上的文件,支持收集文件内容中含有指定关键字的文件

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

该命令支持选项说明如下

OPTIONS

命令支持的选项

-l, --log
使用该选项时表示收集集群日志
-c, --core
使用该选项时表示收集集群宕机core文件
-C, --crash
使用该选项时打印发生过宕机事件的节点信息
-a, --all
使用该选项时表示收集集群日志和core等文件
-m, --module_type
使用该选项时表示指定要收集的组件,后面跟指定的组件名称
--dbid
使用该选项时表示指定要收集的组件实例的dbid,后面跟指定的dbid,仅支持coordinator和executor,多个dbid逗号隔开
--begin_time
使用该选项时表示收集比指定时间新的文件,后面跟指定时间
--end_time
使用该选项时表示收集比指定时间旧的文件,后面跟指定时间
-t, --tar_command
使用该选项时表示指定tar命令的选项,默认为“zcf”
-k, --keyword
使用该选项时表示收集文件内容含有指定关键字的文件,后面跟指定的关键字
-h, --host
使用该选项时表示收集指定host上的文件,后面跟指定的host名称
--quiet
使用该选项时表示不打印输出信息
-?, --help
使用该选项时返回seabox collect命令的帮助信息
注解

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

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

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

示例

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

[seabox@mpp-test-1 bin]$ seabox collect --help
collect cluster functional files.

Usage: 
  seabox collect [OPTIONS]

Options:
  -l, --log               collect cluster log
  -c, --core              collect cluster core
  -C, --crash             print cluster crash info
  -a, --all               collect cluster log and core
  -m, --module_type TEXT  which module to collect, "all" is default
  --dbid TEXT             collect information of specified dbid,
                          can only be specified when module_type is
                          coordinator or executor,
                          multiple dbids are split with ","

  --begin_time TEXT       collect file newer than begin time %Y-%m-%d, exclusive
  --end_time TEXT         collect file not newer than begin time %Y-%m-%d, inclusive
  -t, --tar_command TEXT  the options to tar, "zcf" is default
  -k, --keyword TEXT      collect files contain keyword,
                          can only be specified when log is collected

  -h, --host TEXT         collect information of specified host,
                          multiple dbids are split with ","

  --quiet                 do not print info messages
  -?, --help              show this help, then exit  

以下命令可收集集群日志和core文件

mpp $ seabox collect -a
2022-07-28 15:42:54 CST [24837] sccollect test-1:sy INFO: mkdir seabox_log
2022-07-28 15:42:54 CST [24837] sccollect test-1:sy INFO: seabox_stop_20220715.log                                  seabox_stop_20220715.log                                                           100%   31KB  39.0MB/s   00:00
2022-07-28 15:42:54 CST [24837] sccollect test-1:sy INFO: scp -q test-1:/home/sy/seaboxAdminLogs/seabox_stop_20220715.log test-1:/home/sy/seaboxsql/mpp/seabox_log/seaboxAdminLogs_1_seabox_stop_20220715.log
2022-07-28 15:42:55 CST [24837] sccollect test-1:sy INFO: scsegstop.py_test-1:sy_20220715.log                       scsegstop.py_test-1:sy_20220715.log                                                100%   12KB  19.5MB/s   00:00
2022-07-28 15:42:55 CST [24837] sccollect test-1:sy INFO: scp -q test-1:/home/sy/seaboxAdminLogs/scsegstop.py_test-1:sy_20220715.log test-1:/home/sy/seaboxsql/mpp/seabox_log/seaboxAdminLogs_1_scsegstop.py_test-1:sy_20220715.log

......

2022-07-28 15:43:26 CST [24837] sccollect test-1:sy INFO: scp -q test-1:/home/sy/seaboxsql/mpp/data/executordd/mirror/0/1/sd_log/startup.log test-1:/home/sy/seaboxsql/mpp/seabox_log/executor_9_startup.log
2022-07-28 15:43:26 CST [24837] sccollect test-1:sy INFO: executor_20220728.log                                     executor_20220728.log                                                              100%  936     2.0MB/s   00:00
2022-07-28 15:43:26 CST [24837] sccollect test-1:sy INFO: scp -q test-1:/home/sy/seaboxsql/mpp/data/executordd/mirror/0/1/sd_log/executor_20220728.log test-1:/home/sy/seaboxsql/mpp/seabox_log/executor_9_executor_20220728.log
2022-07-28 15:43:26 CST [24837] sccollect test-1:sy INFO: rm seabox_log -rf
2022-07-28 15:43:26 CST [24837] sccollect test-1:sy INFO: mkdir seabox_core
2022-07-28 15:43:30 CST [24837] sccollect test-1:sy INFO: rm seabox_core -rf
2022-07-28 15:43:30 CST [24837] sccollect test-1:sy INFO: begin to print crash info
2022-07-28 15:43:33 CST [24837] sccollect test-1:sy INFO: success to print crash info
2022-07-28 15:43:33 CST [24837] sccollect test-1:sy INFO: done
相关命令