Greenplum实战--检查集群状态gpstate

本文介绍了使用gpstate命令检查Greenplum数据库集群状态的方法,包括显示简要状态、主镜像映射、镜像状态问题片段等。通过具体实例展示了如何获取数据库版本、实例状态、镜像同步情况及备用主机详情。
    1. 查看进程命令

$gpssh -f /home/gpadmin/gpconfig/all_host -e "ps -eaf|grep green"

[ mdw] ps -eaf|grep green

[ mdw] gpadmin   2601     1  0 01:04 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/master/gpseg-1 -p 5432 --gp_dbid=1 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M master --gp_contentid=-1 -x 14 -E

[ mdw] gpadmin   7772  7703  5 23:12 pts/0    00:00:00 python /usr/local/greenplum-db/./bin/gpssh -f /home/gpadmin/gpconfig/all_host -e ps -eaf|grep green

[ mdw] gpadmin   7899  7843  0 23:12 pts/15   00:00:00 grep --color=auto green

[sdw3] ps -eaf|grep green

[sdw3] gpadmin   7428     1  0 01:04 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/mirror1/gpseg2 -p 50000 --gp_dbid=10 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=2

[sdw3] gpadmin   7429     1  0 01:04 ?        00:00:01 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/primary2/gpseg5 -p 40001 --gp_dbid=7 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=5

[sdw3] gpadmin   7430     1  0 01:04 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/mirror2/gpseg3 -p 50001 --gp_dbid=11 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=3

[sdw3] gpadmin   7431     1  0 01:04 ?        00:00:01 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/primary1/gpseg4 -p 40000 --gp_dbid=6 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=4

[sdw3] gpadmin   7593     1  0 01:04 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/master/gpseg-1 -p 5432 --gp_dbid=14 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M master --gp_contentid=-1 -x 0 -y -E

[sdw3] gpadmin  26794 26741  0 23:12 pts/1    00:00:00 grep --color=auto green

[sdw1] ps -eaf|grep green

[sdw1] gpadmin  12608     1  0 01:04 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/mirror1/gpseg4 -p 50000 --gp_dbid=12 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=4

[sdw1] gpadmin  12609     1  0 01:04 ?        00:00:02 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/primary1/gpseg0 -p 40000 --gp_dbid=2 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=0

[sdw1] gpadmin  12610     1  0 01:04 ?        00:00:02 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/primary2/gpseg1 -p 40001 --gp_dbid=3 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=1

[sdw1] gpadmin  12611     1  0 01:04 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/mirror2/gpseg5 -p 50001 --gp_dbid=13 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=5

[sdw1] gpadmin  31663 31610  0 23:12 pts/1    00:00:00 grep --color=auto green

[sdw2] ps -eaf|grep green

[sdw2] gpadmin   2053     1  0 01:04 ?        00:00:02 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/primary1/gpseg2 -p 40000 --gp_dbid=4 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=2

[sdw2] gpadmin   2054     1  0 01:04 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/mirror1/gpseg0 -p 50000 --gp_dbid=8 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=0

[sdw2] gpadmin   2055     1  0 01:04 ?        00:00:00 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/mirror2/gpseg1 -p 50001 --gp_dbid=9 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=1

[sdw2] gpadmin   2056     1  0 01:04 ?        00:00:02 /usr/local/greenplum-db-5.10.2/bin/postgres -D /greenplum/gpdata/primary2/gpseg3 -p 40001 --gp_dbid=5 --gp_num_contents_in_cluster=6 --silent-mode=true -i -M quiescent --gp_contentid=3

[sdw2] gpadmin  21101 21048  0 23:12 pts/1    00:00:00 grep --color=auto green

 

    1. 检查状态 gpstate
      1. gpstate 常用命令

gpstate -b => 显示简要状态

gpstate -c => 显示主镜像映射

gpstart -d => 指定数据目录(默认值:$MASTER_DATA_DIRECTORY)

gpstate -e => 显示具有镜像状态问题的片段

gpstate -f => 显示备用主机详细信息

gpstate -i => 显示GRIPLUM数据库版本

gpstate -m => 显示镜像实例同步状态

gpstate -p => 显示使用端口

gpstate -Q => 快速检查主机状态

gpstate -s => 显示集群详细信息

gpstate -v => 显示详细信息

 

      1. gpstate

gpstate

[gpadmin@mdw ~]$ gpstate

20200419:00:52:03:001506 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args:

20200419:00:52:03:001506 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.10.2 build commit:b3c02f3acd880e2d676dacea36be015e4a3826d4'

20200419:00:52:03:001506 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.3.23 (Greenplum Database 5.10.2 build commit:b3c02f3acd880e2d676dacea36be015e4a3826d4) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Aug 10 2018 07:30:24'

20200419:00:52:03:001506 gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...

20200419:00:52:03:001506 gpstate:mdw:gpadmin-[INFO]:-Gathering data from segments...

.

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-Greenplum instance status summary

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Master instance                                           = Active

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Master standby                                            = No master standby configured

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total segment instance count from metadata                = 12

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Primary Segment Status

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total primary segments                                    = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total primary segment valid (at master)                   = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total primary segment failures (at master)                = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid files missing              = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid files found                = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs missing               = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs found                 = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of /tmp lock files missing                   = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of /tmp lock files found                     = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number postmaster processes missing                 = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number postmaster processes found                   = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Mirror Segment Status

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total mirror segments                                     = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total mirror segment valid (at master)                    = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total mirror segment failures (at master)                 = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid files missing              = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid files found                = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs missing               = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs found                 = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of /tmp lock files missing                   = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number of /tmp lock files found                     = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number postmaster processes missing                 = 0

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number postmaster processes found                   = 6

20200419:00:52:04:001506 gpstate:mdw:gpadmin-[INFO]:-   Total number mirror se

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值