GaussDB 100提供了gs_checkclusterinfo脚本收集集群信息,用于集群升级前后的数据一致性检验。仅支持分布式部署模式下使用。
注意事项
本脚本需要在升级前后各执行一次,然后手动对比两次执行的输出结果。
语法
- 执行收集集群运行信息
gs_checkclusterinfo -t running_info [-o OUTPUT] [-l LOGFILE]
执行收集集群备机信息
gs_checkclusterinfo -t standby_state [-l LOGFILE]
显示帮助信息
gs_checkclusterinfo { -? | --help }
显示版本信息
gs_checkclusterinfo { -V | --version }
参数说明
gs_checkclusterinfo参数可以分为如下几类:
- 通用参数:
- -t
命令参数类型。
取值范围:running_info、standby_state。
- -o
存储集群运行信息的输出文件。默认存放在当前路径下。
- -l
指定日志文件及存放路径。
默认值:$GAUSSLOG/om/gs_checkclusterinfo.log。
- -?,--help
显示帮助信息。
- -V,--version
显示版本号信息。
- -t
示例
- gs_checkclusterinfo帮助信息。
omm@plat1:/opt/software/gaussdb/script> gs_checkclusterinfo -?
gs_checkclusterinfo is a utility to collection cluster's running information.
Usage:
gs_checkclusterinfo -t running_info [-o OUTPUT] [-l LOGFILE]
gs_checkclusterinfo -t standby_state [-l LOGFILE]
General options:
-t Type of action to do.
If action is running_info, this script will collect cluster running information.
If action is standby_state, this script will check each DN's LSN and LFN information.
-o Output file's path which must be a file. Create it if not exists, cover otherwise.
Default value is gs_checkclusterinfo_output in current path
-l Path of log file, default in cluster log path.
-?, --help Show help information for this utility, and exit the command line mode.
- 收集DN备信息。
omm@plat1:/opt/software/gaussdb/script> gs_checkclusterinfo -t standby_state
Start checking standby state.
----------- DB1_2 ------------
LSN:20484 LFN:728
----------- DB1_1 ------------
LSN:20484 LFN:728
----------- DB2_3 ------------
LSN:20484 LFN:728
----------- DB2_4 ------------
LSN:20484 LFN:728
Successfully checking standby state.
- 收集集群运行状态信息。
omm@plat1:/opt/software/gaussdb/script> gs_checkclusterinfo -t running_info -o nothong.output
Start to query CN's running information.
--------------------- CONNECTION INFO ---------------------
----------- cn_402 -----------
CONNECTION_COUNT: 3
USERNAME CLIENT_IP CLIENT_PORT
---------------------------------------------------------------- -------------------- -----------
SYS 0.0.0.0 0
SYS 0.0.0.0 0
SYS 127.0.0.1 53781
----------- cn_401 -----------
CONNECTION_COUNT: 3
USERNAME CLIENT_IP CLIENT_PORT
---------------------------------------------------------------- -------------------- -----------
SYS 0.0.0.0 0
SYS 0.0.0.0 0
SYS 127.0.0.1 53783
----------------------- TABLE COUNT ------------------------
------------- CN -------------
TABLE_COUNT: 53
----------- DB1_2 ------------
TABLE_COUNT: 53
----------- DB1_1 ------------
TABLE_COUNT: 53
----------- DB2_3 ------------
TABLE_COUNT: 53
----------- DB2_4 ------------
TABLE_COUNT: 53
--------------------- PARTITION COUNT ----------------------
----------- DB1_2 ------------
PARTITION_COUNT: 0
----------- DB1_1 ------------
PARTITION_COUNT: 0
----------- DB2_3 ------------
PARTITION_COUNT: 0
----------- DB2_4 ------------
PARTITION_COUNT: 0
----------------------- INDEX COUNT ------------------------
----------- DB1_2 ------------
INDEX_COUNT: 71
----------- DB1_1 ------------
INDEX_COUNT: 71
----------- DB2_3 ------------
INDEX_COUNT: 71
----------- DB2_4 ------------
INDEX_COUNT: 71
----------------------- COLUMN COUNT -----------------------
----------- DB1_2 ------------
COLUMN_COUNT: 526
----------- DB1_1 ------------
COLUMN_COUNT: 526
----------- DB2_3 ------------
COLUMN_COUNT: 526
----------- DB2_4 ------------
COLUMN_COUNT: 526
----------------------- TODAY COUNT ------------------------
----------- DB1_1 ------------
GS-00708, [1:48]The object user CCPDBO does not exist.
----------- DB1_2 ------------
GS-00708, [1:48]The object user CCPDBO does not exist.
----------- DB2_4 ------------
GS-00708, [1:48]The object user CCPDBO does not exist.
----------- DB2_3 ------------
GS-00708, [1:48]The object user CCPDBO does not exist.
----------- DB1_1 ------------
GS-00708, [1:48]The object user CCPDBO does not exist.
----------- DB1_2 ------------
GS-00708, [1:48]The object user CCPDBO does not exist.
----------- DB2_4 ------------
GS-00708, [1:48]The object user CCPDBO does not exist.
----------- DB2_3 ------------
GS-00708, [1:48]The object user CCPDBO does not exist.
----------------------- ROUTING INFO -----------------------
------------- CN -------------
NODE_ID NODE_NAME NODE_TYPE NODE_HOST NODE_PORT NODE_USER NODE_PASSWORD MIN_CONN MAX_CONN GROUP_ID IS_PRIMARY WEIGHT
------------ ---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ------------ ---------------------------------------------------------------- ---------------------------------------------------------------- ------------ ------------ ------------ ------------ ------------
401 CN_401 COORDINATOR 10.10.10.10 9079 VIOLA HkbkfhTlC8kCTij8gy79kD6lVknPILmoa19FcaJHWEM= 10 200
402 CN_402 COORDINATOR 10.10.10.12 9079 VIOLA F6YlKqdLDaYDCq2Mpmfftn1ZqZjXYxeoA/YkoqAIEOg= 10 200
1 DB1_1 DATANODE 10.10.10.10 15431 VIOLA 1c0ZWnIiUTBOX9N3v0WxOmbsmSslwW88dX2oft3JPvk= 10 200 1 1 0
2 DB1_2 DATANODE 10.10.10.11 15431 VIOLA Sq0tUz8yHeAo/61TMvoiHVKj7BFQBVYyH5hO3wZaeNQ= 10 200 1 0 0
4 DB2_4 DATANODE 10.10.10.11 17431 VIOLA EQKdUZw/Bibu//Minsr0L1584f8BDUvrWcqKYoy9xys= 10 200 2 0 0
3 DB2_3 DATANODE 10.10.10.12 17431 VIOLA kMRZBQ8h2uQi1tmqHov/Dr1/zyToNW7zk8E12ZlgPAo= 10 200 2 1 0
Successfully query CN's running information.