Greenplum主要由Master节点、Segment节点、interconnect三大部分组成。Greenplum master是Greenplum数据库系统的入口,接受客户端连接及提交的SQL语句,将工作负载分发给其它数据库实例(segment实例),由它们存储和处理数据。Greenplum interconnect负责不同PostgreSQL实例之间的通信。Greenplum segment是独立的PostgreSQL数据库,每个segment存储一部分数据。大部分查询处理都由segment完成。

一、安装环境配置

1.1 主机信息

1.2 操作系统配置

在所有节点执行以下操作步骤。

  • 安装操作系统软件包
yum -y install wget cmake3 git gcc gcc-c++ bison flex libedit-devel zlib zlib-devel perl-devel perl-ExtUtils-Embed python-devel libevent libevent-devel libxml2 libxml2-devel libcurl libcurl-devel bzip2 bzip2-devel net-tools libffi-devel openssl-devel
  • 设置OS内核参数
[root@pg01 ~]# vi /etc/sysctl.conf
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 500 1024000 200 4096
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.all.arp_filter = 1
net.ipv4.ip_local_port_range = 10000 65535
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
vm.overcommit_memory = 2
vm.swappiness = 10
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
vm.dirty_background_ratio = 0
vm.dirty_ratio=0
vm.dirty_background_bytes = 1610612736
vm.dirty_bytes = 4294967296
  • 设置OS资源限制
[root@pg01 ~]# vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
  • 设置xfs挂载参数
[root@pg01 ~]# vi /etc/fstab
/dev/datavg/lv01        /u01    xfs     nodev,noatime,inode64,allocsize=16m     0 0
  • 设置disk I/O scheduler
[root@pg01 ~]# grubby --update-kernel=ALL --args="elevator=deadline"
  • 禁用Transparent Huge Pages (THP)
[root@pg01 ~]# grubby --update-kernel=ALL --args="transparent_hugepage=never"
  • 设置disk device的read-ahead值为16384 默认为8192,根据官方要求,必须设置为16384。此参数重启后失效。
[root@pg01 ~]# blockdev --getra /dev/datavg/lv01 
8192
[root@pg01 ~]# blockdev --setra 16384 /dev/datavg/lv01
[root@pg01 ~]# blockdev --getra /dev/datavg/lv01 
16384

二、安装配置GreenPlum

2.1 安装GreenPlum

这里从官方下载的为二进制rpm软件包,只需在master节点安装即可。

[root@pg01 ~]# yum -y localinstall /u02/software/Greenplum/greenplum-db-5.14.0-rhel7-x86_64.rpm

2.2 创建ssh免密码登录

[root@pg01 ~]# cd /usr/local/greenplum-db
[root@pg01 greenplum-db]# . ./greenplum_path.sh
[root@pg01 greenplum-db]# cd etc
[root@pg01 etc]# vi gp_all_nodes
pg01
pg02
pg03
pg04
pg05
pg06
[root@pg01 etc]# gpssh-exkeys -f gp_all_nodes
[STEP 1 of 5] create local ID and authorize on local host
  ... /root/.ssh/id_rsa file exists ... key generation skipped

[STEP 2 of 5] keyscan all hosts and update known_hosts file

[STEP 3 of 5] authorize current user on remote hosts
  ... send to pg02
  ... send to pg03
  ... send to pg04
  ... send to pg05
  ... send to pg06

[STEP 4 of 5] determine common authentication file content

[STEP 5 of 5] copy authentication files to all remote hosts
  ... finished key exchange with pg02
  ... finished key exchange with pg03
  ... finished key exchange with pg04
  ... finished key exchange with pg05
  ... finished key exchange with pg06

[INFO] completed successfully

2.3 批量创建GP用户

[root@pg01 etc]# gpssh -f gp_all_nodes
=> groupadd -g 2000 gpadmin
[pg01]
[pg04]
[pg03]
[pg02]
[pg05]
[pg06]
=> groupadd -g 2001 gpmon
[pg01]
[pg04]
[pg03]
[pg02]
[pg05]
[pg06]
=> useradd -u 2000 -g gpadmin -m -s /bin/bash gpadmin
[pg01]
[pg04]
[pg03]
[pg02]
[pg05]
[pg06]
=> useradd -u 2001 -g gpmon -m -s /bin/bash gpmon
[pg01]
[pg04]
[pg03]
[pg02]
[pg05]
[pg06]
=> echo redhat|passwd --stdin gpadmin
[pg01] Changing password for user gpadmin.
[pg01] passwd: all authentication tokens updated successfully.
[pg04] Changing password for user gpadmin.
[pg04] passwd: all authentication tokens updated successfully.
[pg03] Changing password for user gpadmin.
[pg03] passwd: all authentication tokens updated successfully.
[pg02] Changing password for user gpadmin.
[pg02] passwd: all authentication tokens updated successfully.
[pg05] Changing password for user gpadmin.
[pg05] passwd: all authentication tokens updated successfully.
[pg06] Changing password for user gpadmin.
[pg06] passwd: all authentication tokens updated successfully.
=> echo redhat|passwd --stdin gpmon
[pg01] Changing password for user gpmon.
[pg01] passwd: all authentication tokens updated successfully.
[pg04] Changing password for user gpmon.
[pg04] passwd: all authentication tokens updated successfully.
[pg03] Changing password for user gpmon.
[pg03] passwd: all authentication tokens updated successfully.
[pg02] Changing password for user gpmon.
[pg02] passwd: all authentication tokens updated successfully.
[pg05] Changing password for user gpmon.
[pg05] passwd: all authentication tokens updated successfully.
[pg06] Changing password for user gpmon.
[pg06] passwd: all authentication tokens updated successfully.
=> chown -R gpadmin.gpadmin /u01
[pg01]
[pg04]
[pg03]
[pg02]
[pg05]
[pg06]
=> exit

2.4 其他节点安装GP

[root@pg01 ~]# source /usr/local/greenplum-db/greenplum_path.sh
[root@pg01 ~]# export MASTER_DATA_DIRECTORY=/u01/gpmaster
[root@pg01 ~]# cd /usr/local/greenplum-db/etc/
[root@pg01 etc]# gpseginstall -f gp_all_nodes -u gpadmin -p redhat
20181207:13:47:49:013628 gpseginstall:pg01:root-[INFO]:-Installation Info:
link_name greenplum-db
binary_path /usr/local/greenplum-db-5.14.0
binary_dir_location /usr/local
binary_dir_name greenplum-db-5.14.0
20181207:13:47:49:013628 gpseginstall:pg01:root-[INFO]:-check cluster password access
20181207:13:47:50:013628 gpseginstall:pg01:root-[INFO]:-de-duplicate hostnames
20181207:13:47:50:013628 gpseginstall:pg01:root-[INFO]:-master hostname: pg01
20181207:13:47:51:013628 gpseginstall:pg01:root-[INFO]:-check for user gpadmin on cluster
20181207:13:47:52:013628 gpseginstall:pg01:root-[INFO]:-add user gpadmin on master
20181207:13:47:52:013628 gpseginstall:pg01:root-[INFO]:-add user gpadmin on cluster
20181207:13:47:52:013628 gpseginstall:pg01:root-[INFO]:-chown -R gpadmin:gpadmin /usr/local/greenplum-db
20181207:13:47:52:013628 gpseginstall:pg01:root-[INFO]:-chown -R gpadmin:gpadmin /usr/local/greenplum-db-5.14.0
20181207:13:47:52:013628 gpseginstall:pg01:root-[INFO]:-rm -f /usr/local/greenplum-db-5.14.0.tar; rm -f /usr/local/greenplum-db-5.14.0.tar.gz
20181207:13:47:52:013628 gpseginstall:pg01:root-[INFO]:-cd /usr/local; tar cf greenplum-db-5.14.0.tar greenplum-db-5.14.0
20181207:13:47:55:013628 gpseginstall:pg01:root-[INFO]:-gzip /usr/local/greenplum-db-5.14.0.tar
20181207:13:48:31:013628 gpseginstall:pg01:root-[INFO]:-remote command: mkdir -p /usr/local
20181207:13:48:32:013628 gpseginstall:pg01:root-[INFO]:-remote command: rm -rf /usr/local/greenplum-db-5.14.0
20181207:13:48:33:013628 gpseginstall:pg01:root-[INFO]:-scp software to remote location
20181207:13:48:37:013628 gpseginstall:pg01:root-[INFO]:-remote command: gzip -f -d /usr/local/greenplum-db-5.14.0.tar.gz
20181207:13:48:45:013628 gpseginstall:pg01:root-[INFO]:-md5 check on remote location
20181207:13:48:49:013628 gpseginstall:pg01:root-[INFO]:-remote command: cd /usr/local; tar xf greenplum-db-5.14.0.tar
20181207:13:48:52:013628 gpseginstall:pg01:root-[INFO]:-remote command: rm -f /usr/local/greenplum-db-5.14.0.tar
20181207:13:48:53:013628 gpseginstall:pg01:root-[INFO]:-remote command: cd /usr/local; rm -f greenplum-db; ln -fs greenplum-db-5.14.0 greenplum-db
20181207:13:48:54:013628 gpseginstall:pg01:root-[INFO]:-remote command: chown -R gpadmin:gpadmin /usr/local/greenplum-db
20181207:13:48:54:013628 gpseginstall:pg01:root-[INFO]:-remote command: chown -R gpadmin:gpadmin /usr/local/greenplum-db-5.14.0
20181207:13:48:55:013628 gpseginstall:pg01:root-[INFO]:-rm -f /usr/local/greenplum-db-5.14.0.tar.gz
20181207:13:48:55:013628 gpseginstall:pg01:root-[INFO]:-Changing system passwords ...
20181207:13:49:02:013628 gpseginstall:pg01:root-[INFO]:-exchange ssh keys for user root
20181207:13:49:07:013628 gpseginstall:pg01:root-[INFO]:-exchange ssh keys for user gpadmin
20181207:13:49:13:013628 gpseginstall:pg01:root-[INFO]:-/usr/local/greenplum-db/./sbin/gpfixuserlimts -f /etc/security/limits.conf -u gpadmin
20181207:13:49:14:013628 gpseginstall:pg01:root-[INFO]:-remote command: . /usr/local/greenplum-db/./greenplum_path.sh; /usr/local/greenplum-db/./sbin/gpfixuserlimts -f /etc/security/limits.conf -u gpadmin
20181207:13:49:15:013628 gpseginstall:pg01:root-[INFO]:-version string on master: gpssh version 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88
20181207:13:49:15:013628 gpseginstall:pg01:root-[INFO]:-remote command: . /usr/local/greenplum-db/./greenplum_path.sh; /usr/local/greenplum-db/./bin/gpssh --version
20181207:13:49:16:013628 gpseginstall:pg01:root-[INFO]:-remote command: . /usr/local/greenplum-db-5.14.0/greenplum_path.sh; /usr/local/greenplum-db-5.14.0/bin/gpssh --version
20181207:13:49:17:013628 gpseginstall:pg01:root-[INFO]:-SUCCESS -- Requested commands completed

2.5 创建相关数据目录

--master和slave创建以下目录
[root@pg01 ~]# su - gpadmin
[gpadmin@pg01 ~]$ mkdir /u01/gpmaster
--其他节点创建以下目录
[root@pg03 ~]# su - gpadmin
[gpadmin@pg03 ~]$ mkdir /u01/gpdatap{1,2};mkdir /u01/gpdatam{1,2}

2.6 初始化GP

--创建初始化文件
[gpadmin@pg01 ~]$ cd /usr/local/greenplum-db/etc
[gpadmin@pg01 etc]$ vi gp_seg_nodes 
pg03
pg04
pg05
pg06
[gpadmin@pg01 etc]$ vi gpinitsystem_config 
ARRAY_NAME="Lee Greenplum DW"
SEG_PREFIX=gpseg
PORT_BASE=40000
declare -a DATA_DIRECTORY=(/u01/gpdatap1 /u01/gpdatap2)
MASTER_HOSTNAME=pg01
MASTER_DIRECTORY=/u01/gpmaster
MASTER_PORT=5432
CHECK_POINT_SEGMENTS=8
ENCODING=UNICODE
//如果不想启用mirror,下面几条就不需要。
MIRROR_PORT_BASE=50000
REPLICATION_PORT_BASE=41000
MIRROR_REPLICATION_PORT_BASE=51000
declare -a MIRROR_DATA_DIRECTORY=(/u01/gpdatam1 /u01/gpdatam2)
--初始化GP
[gpadmin@pg01 etc]$ gpinitsystem -c gpinitsystem_config -h gp_seg_nodes -s pg02 -S
20181207:14:13:16:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20181207:14:13:16:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Reading Greenplum configuration file gpinitsystem_config
20181207:14:13:16:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Locale has not been set in gpinitsystem_config, will set to default value
20181207:14:13:16:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Locale set to en_US.utf8
20181207:14:13:16:020658 gpinitsystem:pg01:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20181207:14:13:16:020658 gpinitsystem:pg01:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250
20181207:14:13:17:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Checking configuration parameters, Completed
20181207:14:13:17:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
....
20181207:14:13:18:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Configuring build for standard array
20181207:14:13:18:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Sufficient hosts for spread mirroring request
20181207:14:13:18:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Commencing multi-home checks, Completed
20181207:14:13:18:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Building primary segment instance array, please wait...
........
20181207:14:13:22:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Building spread mirror array type , please wait...
........
20181207:14:13:26:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Checking Master host
20181207:14:13:26:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Checking new segment hosts, please wait...
................
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Checking new segment hosts, Completed
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Greenplum Database Creation Parameters
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:---------------------------------------
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master Configuration
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:---------------------------------------
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master instance name       = Lee Greenplum DW
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master hostname            = pg01
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master port                = 5432
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master instance dir        = /u01/gpmaster/gpseg-1
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master LOCALE              = en_US.utf8
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Greenplum segment prefix   = gpseg
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master Database            = 
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master connections         = 250
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master buffers             = 128000kB
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Segment connections        = 750
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Segment buffers            = 128000kB
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Checkpoint segments        = 8
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Encoding                   = UNICODE
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Postgres param file        = Off
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Initdb to be used          = /usr/local/greenplum-db/./bin/initdb
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-GP_LIBRARY_PATH is         = /usr/local/greenplum-db/./lib
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-HEAP_CHECKSUM is           = on
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-HBA_HOSTNAMES is           = 0
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Ulimit check               = Passed
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Array host connect type    = Single hostname per node
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master IP address [1]      = ::1
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master IP address [2]      = 192.168.120.141
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Master IP address [3]      = fe80::250:56ff:feb0:59ea
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Standby Master             = pg02
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Primary segment #          = 2
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Standby IP address         = ::1
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Standby IP address         = 192.168.120.142
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Standby IP address         = fe80::250:56ff:feb0:696
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Total Database segments    = 8
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Trusted shell              = /bin/ssh
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Number segment hosts       = 4
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Mirror port base           = 50000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Replicaton port base       = 41000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Mirror replicaton port base= 51000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Mirror segment #           = 2
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Mirroring config           = ON
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Mirroring type             = Spread
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:----------------------------------------
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Greenplum Primary Segment Configuration
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:----------------------------------------
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg03         /u01/gpdatap1/gpseg0    40000   2       0       41000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg03         /u01/gpdatap1/gpseg1    40001   3       1       41001
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg04         /u01/gpdatap1/gpseg2    40000   4       2       41000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg04         /u01/gpdatap1/gpseg3    40001   5       3       41001
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg05         /u01/gpdatap1/gpseg4    40000   6       4       41000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg05         /u01/gpdatap1/gpseg5    40001   7       5       41001
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg06         /u01/gpdatap1/gpseg6    40000   8       6       41000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg06         /u01/gpdatap1/gpseg7    40001   9       7       41001
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:---------------------------------------
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Greenplum Mirror Segment Configuration
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:---------------------------------------
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg04         /u01/gpdatam1/gpseg0    50000   10      0       51000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg05         /u01/gpdatam2/gpseg1    50001   11      1       51001
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg05         /u01/gpdatam1/gpseg2    50000   12      2       51000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg06         /u01/gpdatam2/gpseg3    50001   13      3       51001
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg06         /u01/gpdatam1/gpseg4    50000   14      4       51000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg03         /u01/gpdatam2/gpseg5    50001   15      5       51001
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg03         /u01/gpdatam1/gpseg6    50000   16      6       51000
20181207:14:13:44:020658 gpinitsystem:pg01:gpadmin-[INFO]:-pg04         /u01/gpdatam2/gpseg7    50001   17      7       51001

Continue with Greenplum creation Yy|Nn (default=N):
> y
20181207:14:13:59:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Building the Master instance database, please wait...
20181207:14:14:07:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Starting the Master in admin mode
20181207:14:14:18:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Commencing parallel build of primary segment instances
20181207:14:14:18:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
........
20181207:14:14:18:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.................
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:------------------------------------------------
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Parallel process exit status
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:------------------------------------------------
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Total processes marked as completed           = 8
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Total processes marked as killed              = 0
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Total processes marked as failed              = 0
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:------------------------------------------------
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances
20181207:14:14:35:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
........
20181207:14:14:36:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.............
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:------------------------------------------------
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Parallel process exit status
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:------------------------------------------------
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Total processes marked as completed           = 8
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Total processes marked as killed              = 0
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Total processes marked as failed              = 0
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:------------------------------------------------
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Deleting distributed backout files
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Removing back out file
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:-No errors generated from parallel processes
20181207:14:14:49:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Restarting the Greenplum instance in production mode
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Starting gpstop with args: -a -l /home/gpadmin/gpAdminLogs -i -m -d /u01/gpmaster/gpseg-1
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Gathering information and validating the environment...
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Obtaining Segment details from master...
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88'
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-There are 0 connections to the database
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='immediate'
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Master host=pg01
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=immediate
20181207:14:14:50:029433 gpstop:pg01:gpadmin-[INFO]:-Master segment instance directory=/u01/gpmaster/gpseg-1
20181207:14:14:51:029433 gpstop:pg01:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20181207:14:14:51:029433 gpstop:pg01:gpadmin-[INFO]:-Terminating processes for segment /u01/gpmaster/gpseg-1
20181207:14:14:51:029461 gpstart:pg01:gpadmin-[INFO]:-Starting gpstart with args: -a -l /home/gpadmin/gpAdminLogs -d /u01/gpmaster/gpseg-1
20181207:14:14:51:029461 gpstart:pg01:gpadmin-[INFO]:-Gathering information and validating the environment...
20181207:14:14:51:029461 gpstart:pg01:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88'
20181207:14:14:52:029461 gpstart:pg01:gpadmin-[INFO]:-Greenplum Catalog Version: '301705051'
20181207:14:14:52:029461 gpstart:pg01:gpadmin-[INFO]:-Starting Master instance in admin mode
20181207:14:14:53:029461 gpstart:pg01:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20181207:14:14:53:029461 gpstart:pg01:gpadmin-[INFO]:-Obtaining Segment details from master...
20181207:14:14:53:029461 gpstart:pg01:gpadmin-[INFO]:-Setting new master era
20181207:14:14:53:029461 gpstart:pg01:gpadmin-[INFO]:-Master Started...
20181207:14:14:53:029461 gpstart:pg01:gpadmin-[INFO]:-Shutting down master
20181207:14:14:55:029461 gpstart:pg01:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
... 
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-Process results...
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-   Successful segment starts                                            = 16
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-Successfully started 16 of 16 segment instances 
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:14:58:029461 gpstart:pg01:gpadmin-[INFO]:-Starting Master instance pg01 directory /u01/gpmaster/gpseg-1 
20181207:14:14:59:029461 gpstart:pg01:gpadmin-[INFO]:-Command pg_ctl reports Master pg01 instance active
20181207:14:14:59:029461 gpstart:pg01:gpadmin-[INFO]:-No standby master configured.  skipping...
20181207:14:14:59:029461 gpstart:pg01:gpadmin-[INFO]:-Database successfully started
20181207:14:14:59:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Completed restart of Greenplum instance in production mode
20181207:14:15:00:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Starting initialization of standby master pg02
20181207:14:15:00:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Validating environment and parameters for standby initialization...
20181207:14:15:00:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Checking for filespace directory /u01/gpmaster/gpseg-1 on pg02
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:------------------------------------------------------
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Greenplum standby master initialization parameters
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:------------------------------------------------------
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Greenplum master hostname               = pg01
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Greenplum master data directory         = /u01/gpmaster/gpseg-1
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Greenplum master port                   = 5432
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Greenplum standby master hostname       = pg02
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Greenplum standby master port           = 5432
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Greenplum standby master data directory = /u01/gpmaster/gpseg-1
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Greenplum update system catalog         = On
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:------------------------------------------------------
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:- Filespace locations
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:------------------------------------------------------
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-pg_system -> /u01/gpmaster/gpseg-1
20181207:14:15:01:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Syncing Greenplum Database extensions to standby
20181207:14:15:02:029608 gpinitstandby:pg01:gpadmin-[INFO]:-The packages on pg02 are consistent.
20181207:14:15:02:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Adding standby master to catalog...
20181207:14:15:02:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Database catalog updated successfully.
20181207:14:15:02:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Updating pg_hba.conf file...
20181207:14:15:04:029608 gpinitstandby:pg01:gpadmin-[INFO]:-pg_hba.conf files updated successfully.
20181207:14:15:05:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Updating filespace flat files...
20181207:14:15:05:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Filespace flat file updated successfully.
20181207:14:15:05:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Starting standby master
20181207:14:15:05:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Checking if standby master is running on host: pg02  in directory: /u01/gpmaster/gpseg-1
20181207:14:15:07:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Cleaning up pg_hba.conf backup files...
20181207:14:15:08:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Backup files of pg_hba.conf cleaned up successfully.
20181207:14:15:08:029608 gpinitstandby:pg01:gpadmin-[INFO]:-Successfully created standby master on pg02
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Successfully completed standby master initialization
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Scanning utility log file for any warning messages
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[WARN]:-*******************************************************
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[WARN]:-Scan of log file indicates that some warnings or errors
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[WARN]:-were generated during the array creation
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Please review contents of log file
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-/home/gpadmin/gpAdminLogs/gpinitsystem_20181207.log
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-To determine level of criticality
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-These messages could be from a previous run of the utility
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-that was called today!
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[WARN]:-*******************************************************
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Greenplum Database instance successfully created
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-------------------------------------------------------
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-To complete the environment configuration, please 
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-update gpadmin .bashrc file with the following
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-1. Ensure that the greenplum_path.sh file is sourced
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-2. Add "export MASTER_DATA_DIRECTORY=/u01/gpmaster/gpseg-1"
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-   to access the Greenplum scripts for this instance:
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-   or, use -d /u01/gpmaster/gpseg-1 option for the Greenplum scripts
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-   Example gpstate -d /u01/gpmaster/gpseg-1
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Script log file = /home/gpadmin/gpAdminLogs/gpinitsystem_20181207.log
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-To remove instance, run gpdeletesystem utility
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Standby Master pg02 has been configured
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-To activate the Standby Master Segment in the event of Master
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-failure review options for gpactivatestandby
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-------------------------------------------------------
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-The Master /u01/gpmaster/gpseg-1/pg_hba.conf post gpinitsystem
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-has been configured to allow all hosts within this new
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-array to intercommunicate. Any hosts external to this
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-new array must be explicitly added to this file
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-Refer to the Greenplum Admin support guide which is
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-located in the /usr/local/greenplum-db/./docs directory
20181207:14:15:09:020658 gpinitsystem:pg01:gpadmin-[INFO]:-------------------------------------------------------

2.7 GP登录验证

[gpadmin@pg01 etc]$ psql postgres
psql (8.3.23)
Type "help" for help.

postgres=# \l
                  List of databases
   Name    |  Owner  | Encoding |  Access privileges  
-----------+---------+----------+---------------------
 postgres  | gpadmin | UTF8     | 
 template0 | gpadmin | UTF8     | =c/gpadmin          
                                : gpadmin=CTc/gpadmin
 template1 | gpadmin | UTF8     | =c/gpadmin          
                                : gpadmin=CTc/gpadmin
(3 rows)

postgres=# \l+
                                           List of databases
   Name    |  Owner  | Encoding |  Access privileges  | Size  | Tablespace |        Description        
-----------+---------+----------+---------------------+-------+------------+---------------------------
 postgres  | gpadmin | UTF8     |                     | 94 MB | pg_default | 
 template0 | gpadmin | UTF8     | =c/gpadmin          | 93 MB | pg_default | 
                                : gpadmin=CTc/gpadmin                        
 template1 | gpadmin | UTF8     | =c/gpadmin          | 94 MB | pg_default | default template database
                                : gpadmin=CTc/gpadmin                        
(3 rows)

postgres=# select *from gp_toolkit.gp_disk_free order by dfhostname;
 dfsegment | dfhostname |         dfdevice         | dfspace  
-----------+------------+--------------------------+----------
         0 |  pg03      |  /dev/mapper/datavg-lv01 | 51966932
         1 |  pg03      |  /dev/mapper/datavg-lv01 | 51966932
         3 |  pg04      |  /dev/mapper/datavg-lv01 | 51966928
         2 |  pg04      |  /dev/mapper/datavg-lv01 | 51966928
         5 |  pg05      |  /dev/mapper/datavg-lv01 | 51966912
         4 |  pg05      |  /dev/mapper/datavg-lv01 | 51966912
         7 |  pg06      |  /dev/mapper/datavg-lv01 | 51966932
         6 |  pg06      |  /dev/mapper/datavg-lv01 | 51966932
(8 rows)

2.8 集群状态信息

[gpadmin@pg01 ~]$ gpstate -s
20181207:14:37:37:031467 gpstate:pg01:gpadmin-[INFO]:-Starting gpstate with args: -s
20181207:14:37:37:031467 gpstate:pg01:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88'
20181207:14:37:37:031467 gpstate:pg01:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.3.23 (Greenplum Database 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Nov 28 2018 08:08:06'
20181207:14:37:37:031467 gpstate:pg01:gpadmin-[INFO]:-Obtaining Segment details from master...
20181207:14:37:37:031467 gpstate:pg01:gpadmin-[INFO]:-Gathering data from segments...
... 
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:--Master Configuration & Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Master host                    = pg01
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Master postgres process ID     = 29548
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Master data directory          = /u01/gpmaster/gpseg-1
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Master port                    = 5432
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Master current role            = dispatch
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Greenplum initsystem version   = 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Greenplum current version      = PostgreSQL 8.3.23 (Greenplum Database 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Nov 28 2018 08:08:06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Postgres version               = 8.3.23
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Master standby                 = pg02
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Standby master state           = Standby host passive
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-Segment Instance Status Report
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg03
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg03
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatap1/gpseg0
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 40000
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17457
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Database status                   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg04
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg04
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatam1/gpseg0
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 50000
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17513
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Segment status                    = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg03
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg03
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatap1/gpseg1
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 40001
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17455
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Database status                   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg05
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg05
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatam2/gpseg1
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 50001
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17476
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Segment status                    = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg04
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg04
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatap1/gpseg2
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 40000
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17509
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Database status                   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg05
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg05
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatam1/gpseg2
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 50000
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17473
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Segment status                    = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg04
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg04
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatap1/gpseg3
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 40001
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17512
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Database status                   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatam2/gpseg3
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 50001
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17484
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Segment status                    = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg05
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg05
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatap1/gpseg4
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 40000
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17474
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Database status                   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatam1/gpseg4
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 50000
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17483
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Segment status                    = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg05
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg05
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatap1/gpseg5
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 40001
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17475
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Database status                   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg03
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg03
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatam2/gpseg5
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 50001
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17456
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Segment status                    = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatap1/gpseg6
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 40000
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17481
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Database status                   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg03
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg03
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatam1/gpseg6
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 50000
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17454
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Segment status                    = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg06
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatap1/gpseg7
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 40001
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Primary
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17482
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Database status                   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Segment Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Hostname                          = pg04
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Address                           = pg04
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Datadir                           = /u01/gpdatam2/gpseg7
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Port                              = 50001
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Mirroring Info
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Current role                      = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Preferred role                    = Mirror
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Mirror status                     = Synchronized
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-   Status
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      PID                               = 17514
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Configuration reports status as   = Up
20181207:14:37:40:031467 gpstate:pg01:gpadmin-[INFO]:-      Segment status                    = Up

三、安装GreenPlum Performance Monitor

3.1 创建gpperfmon数据库

[gpadmin@pg01 ~]$ gpperfmon_install --enable --password redhat --port 5432
20181207:16:14:14:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-createdb gpperfmon >& /dev/null
20181207:16:14:16:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-PGPORT=5432 psql -f /usr/local/greenplum-db/./lib/gpperfmon/gpperfmon.sql gpperfmon >& /dev/null
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-PGPORT=5432 psql template1 -c "DROP ROLE IF EXISTS gpmon"  >& /dev/null
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-PGPORT=5432 psql template1 -c "CREATE ROLE gpmon WITH SUPERUSER CREATEDB LOGIN ENCRYPTED PASSWORD 'redhat'"  >& /dev/null
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-echo "local    gpperfmon         gpmon         md5" >> /u01/gpmaster/gpseg-1/pg_hba.conf
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-echo "host     all         gpmon         127.0.0.1/28    md5" >> /u01/gpmaster/gpseg-1/pg_hba.conf
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-echo "host     all         gpmon         ::1/128    md5" >> /u01/gpmaster/gpseg-1/pg_hba.conf
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-touch /home/gpadmin/.pgpass >& /dev/null
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-mv -f /home/gpadmin/.pgpass /home/gpadmin/.pgpass.1544170454 >& /dev/null
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-echo "*:5432:gpperfmon:gpmon:redhat" >> /home/gpadmin/.pgpass
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-cat /home/gpadmin/.pgpass.1544170454 >> /home/gpadmin/.pgpass
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-chmod 0600 /home/gpadmin/.pgpass >& /dev/null
20181207:16:14:18:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-PGPORT=5432 gpconfig -c gp_enable_gpperfmon -v on >& /dev/null
20181207:16:14:20:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-PGPORT=5432 gpconfig -c gpperfmon_port -v 8888 >& /dev/null
20181207:16:14:21:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-PGPORT=5432 gpconfig -c gp_external_enable_exec -v on --masteronly >& /dev/null
20181207:16:14:23:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-PGPORT=5432 gpconfig -c gpperfmon_log_alert_level -v warning >& /dev/null
20181207:16:14:25:005559 gpperfmon_install:pg01:gpadmin-[INFO]:-gpperfmon will be enabled after a full restart of GPDB
[gpadmin@pg01 ~]$ gpstop -afr
20181207:16:14:45:005890 gpstop:pg01:gpadmin-[INFO]:-Starting gpstop with args: -afr
20181207:16:14:45:005890 gpstop:pg01:gpadmin-[INFO]:-Gathering information and validating the environment...
20181207:16:14:45:005890 gpstop:pg01:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20181207:16:14:45:005890 gpstop:pg01:gpadmin-[INFO]:-Obtaining Segment details from master...
20181207:16:14:46:005890 gpstop:pg01:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88'
20181207:16:14:46:005890 gpstop:pg01:gpadmin-[INFO]:-There are 0 connections to the database
20181207:16:14:46:005890 gpstop:pg01:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='fast'
20181207:16:14:46:005890 gpstop:pg01:gpadmin-[INFO]:-Master host=pg01
20181207:16:14:46:005890 gpstop:pg01:gpadmin-[INFO]:-Detected 0 connections to database
20181207:16:14:46:005890 gpstop:pg01:gpadmin-[INFO]:-Using standard WAIT mode of 120 seconds
20181207:16:14:46:005890 gpstop:pg01:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=fast
20181207:16:14:46:005890 gpstop:pg01:gpadmin-[INFO]:-Master segment instance directory=/u01/gpmaster/gpseg-1
20181207:16:14:47:005890 gpstop:pg01:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20181207:16:14:47:005890 gpstop:pg01:gpadmin-[INFO]:-Terminating processes for segment /u01/gpmaster/gpseg-1
20181207:16:14:47:005890 gpstop:pg01:gpadmin-[INFO]:-Stopping master standby host pg02 mode=fast
20181207:16:14:49:005890 gpstop:pg01:gpadmin-[INFO]:-Successfully shutdown standby process on pg02
20181207:16:14:49:005890 gpstop:pg01:gpadmin-[INFO]:-Targeting dbid [2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17] for shutdown
20181207:16:14:49:005890 gpstop:pg01:gpadmin-[INFO]:-Commencing parallel primary segment instance shutdown, please wait...
20181207:16:14:49:005890 gpstop:pg01:gpadmin-[INFO]:-0.00% of jobs completed
20181207:16:14:51:005890 gpstop:pg01:gpadmin-[INFO]:-100.00% of jobs completed
20181207:16:14:51:005890 gpstop:pg01:gpadmin-[INFO]:-Commencing parallel mirror segment instance shutdown, please wait...
20181207:16:14:51:005890 gpstop:pg01:gpadmin-[INFO]:-0.00% of jobs completed
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-100.00% of jobs completed
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-   Segments stopped successfully      = 16
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-   Segments with errors during stop   = 0
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-----------------------------------------------------
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-Successfully shutdown 16 of 16 segment instances 
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-Cleaning up leftover gpmmon process
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-No leftover gpmmon process found
20181207:16:14:53:005890 gpstop:pg01:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes
20181207:16:14:54:005890 gpstop:pg01:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts
20181207:16:14:54:005890 gpstop:pg01:gpadmin-[INFO]:-Cleaning up leftover shared memory
20181207:16:14:54:005890 gpstop:pg01:gpadmin-[INFO]:-Restarting System...

3.2 解压安装CC

[root@pg01 ~]# unzip /u02/software/Greenplum/greenplum-cc-web-4.5.0-LINUX-x86_64.zip 
[root@pg01 ~]# cd greenplum-cc-web-4.5.0-LINUX-x86_64/
[root@pg01 greenplum-cc-web-4.5.0-LINUX-x86_64]# ./gpccinstall-4.5.0 -W
Password for GPDB user gpmon:
......
Do you agree to the Pivotal Greenplum Command Center End User License Agreement? Yy/Nn (Default=Y)
Y 

Where would you like to install Greenplum Command Center? (Default=/usr/local)


What would you like to name this installation of Greenplum Command Center? (Default=gpcc)


What port would you like gpcc webserver to use? (Default=28080)


Would you like to enable kerberos? Yy/Nn (Default=N)


Would you like enable SSL? Yy/Nn (Default=N)


Installation in progress...

Successfully installed Greenplum Command Center.

We recommend ssh to standby master before starting GPCC webserver

To start the GPCC webserver on the current host, run gpcc start

To manage Command Center, use the gpcc utility.
Usage:
  gpcc [OPTIONS] <command>

Application Options:
  -v, --version   Show Greenplum Command Center version
      --settings  Print the current configuration settings

Help Options:
  -h, --help      Show this help message

Available commands:
  help        Print list of commands
  krbdisable  Disables kerberos authentication
  krbenable   Enables kerberos authentication
  start       Starts Greenplum Command Center webserver and metrics collection agents [-W]  option to force password prompt for GPDB user gpmon [optional]
  status      Print agent status  with  [-W]  option to force password prompt for GPDB user gpmon [optional]
  stop        Stops Greenplum Command Center webserver and metrics collection agents [-W]  option to force password prompt for GPDB user gpmon [optional] 
[gpadmin@pg01 ~]$  vi .bash_profile
source /usr/local/greenplum-cc-web-4.5.0/gpcc_path.sh
[gpadmin@pg01 ~]$ source .bash_profile
[gpadmin@pg01 ~]$ gpcc start
Starting the gpcc agents and webserver…
2018/12/07 16:25:02 Agent successfully started on 6/6 hosts
2018/12/07 16:25:02 View Greenplum Command Center at http://pg01:28080

完了后,使用gpmon用户登录web界面,如下图所示:

四、GreenPlum主从切换

4.1 切换前状态

postgres=# select * from gp_segment_configuration;

[gpadmin@pg01 ~]$ gpstate -f
20181211:14:24:16:024459 gpstate:pg01:gpadmin-[INFO]:-Starting gpstate with args: -f
20181211:14:24:17:024459 gpstate:pg01:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88'
20181211:14:24:17:024459 gpstate:pg01:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.3.23 (Greenplum Database 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Nov 28 2018 08:08:06'
20181211:14:24:17:024459 gpstate:pg01:gpadmin-[INFO]:-Obtaining Segment details from master...
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:-Standby master details
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:-----------------------
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:-   Standby address          = pg02
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:-   Standby data directory   = /u01/gpmaster/gpseg-1
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:-   Standby port             = 5432
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:-   Standby PID              = 21940
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:-   Standby status           = Standby host passive
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--------------------------------------------------------------
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--pg_stat_replication
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--------------------------------------------------------------
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--WAL Sender State: streaming
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--Sync state: sync
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--Sent Location: 0/E39F510
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--Flush Location: 0/E39F510
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--Replay Location: 0/E39F510
20181211:14:24:18:024459 gpstate:pg01:gpadmin-[INFO]:--------------------------------------------------------------

4.2 GreenPlum主从切换

kill掉master上所有gpadmin的进程,然后再执行切换操作。

[gpadmin@pg01 ~]$ killall5 
[gpadmin@pg02 ~]$ export PGPORT=5432
[gpadmin@pg02 ~]$ gpactivatestandby -d /u01/gpmaster/gpseg-1
20181211:14:40:10:024607 gpactivatestandby:pg02:gpadmin-[INFO]:------------------------------------------------------
20181211:14:40:10:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Standby data directory    = /u01/gpmaster/gpseg-1
20181211:14:40:10:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Standby port              = 5432
20181211:14:40:11:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Standby running           = yes
20181211:14:40:11:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Force standby activation  = no
20181211:14:40:11:024607 gpactivatestandby:pg02:gpadmin-[INFO]:------------------------------------------------------
Do you want to continue with standby master activation? Yy|Nn (default=N):
> y
20181211:14:40:14:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-found standby postmaster process
20181211:14:40:14:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Updating transaction files filespace flat files...
20181211:14:40:14:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Updating temporary files filespace flat files...
20181211:14:40:14:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Promoting standby...
20181211:14:40:14:024607 gpactivatestandby:pg02:gpadmin-[DEBUG]:-Waiting for connection...
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Standby master is promoted
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Reading current configuration...
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[DEBUG]:-Connecting to dbname='template1'
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Writing the gp_dbid file - /u01/gpmaster/gpseg-1/gp_dbid...
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-But found an already existing file.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Hence removed that existing file.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Creating a new file...
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Wrote dbid: 1 to the file.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Now marking it as read only...
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Verifying the file...
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:------------------------------------------------------
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-The activation of the standby master has completed successfully.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-pg02 is now the new primary master.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-You will need to update your user access mechanism to reflect
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-the change of master hostname.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Do not re-start the failed master while the fail-over master is
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-operational, this could result in database corruption!
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-MASTER_DATA_DIRECTORY is now /u01/gpmaster/gpseg-1 if
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-this has changed as a result of the standby master activation, remember
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-to change this in any startup scripts etc, that may be configured
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-to set this value.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-MASTER_PORT is now 5432, if this has changed, you
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-may need to make additional configuration changes to allow access
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-to the Greenplum instance.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Refer to the Administrator Guide for instructions on how to re-activate
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-the master to its previous state once it becomes available.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-Query planner statistics must be updated on all databases
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-following standby master activation.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:-When convenient, run ANALYZE against all user databases.
20181211:14:40:16:024607 gpactivatestandby:pg02:gpadmin-[INFO]:------------------------------------------------------
postgres=# select *from gp_segment_configuration;

4.3 原master转换为standby

切换完成后,standby 角色转换为master角色,原master服务器恢复后,需要以standby的角色加入集群。首先删除或者备份原master服务器的数据目录,然后再添加。否则,在添加的过程中会报错。

[gpadmin@pg01 ~]$ rm -rf /u01/gpmaster/gpseg-1
[gpadmin@pg02 ~]$ gpinitstandby -s pg01
20181211:14:50:10:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Validating environment and parameters for standby initialization...
20181211:14:50:10:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Checking for filespace directory /u01/gpmaster/gpseg-1 on pg01
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:------------------------------------------------------
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Greenplum standby master initialization parameters
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:------------------------------------------------------
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Greenplum master hostname               = pg02
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Greenplum master data directory         = /u01/gpmaster/gpseg-1
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Greenplum master port                   = 5432
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Greenplum standby master hostname       = pg01
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Greenplum standby master port           = 5432
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Greenplum standby master data directory = /u01/gpmaster/gpseg-1
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Greenplum update system catalog         = On
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:------------------------------------------------------
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:- Filespace locations
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:------------------------------------------------------
20181211:14:50:11:025830 gpinitstandby:pg02:gpadmin-[INFO]:-pg_system -> /u01/gpmaster/gpseg-1
Do you want to continue with standby master initialization? Yy|Nn (default=N):
> y
20181211:14:50:12:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Syncing Greenplum Database extensions to standby
20181211:14:50:13:025830 gpinitstandby:pg02:gpadmin-[INFO]:-The packages on pg01 are consistent.
20181211:14:50:13:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Adding standby master to catalog...
20181211:14:50:13:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Database catalog updated successfully.
20181211:14:50:13:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Updating pg_hba.conf file...
20181211:14:50:15:025830 gpinitstandby:pg02:gpadmin-[INFO]:-pg_hba.conf files updated successfully.
20181211:14:50:16:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Updating filespace flat files...
20181211:14:50:16:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Filespace flat file updated successfully.
20181211:14:50:16:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Starting standby master
20181211:14:50:16:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Checking if standby master is running on host: pg01  in directory: /u01/gpmaster/gpseg-1
20181211:14:50:18:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Cleaning up pg_hba.conf backup files...
20181211:14:50:19:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Backup files of pg_hba.conf cleaned up successfully.
20181211:14:50:19:025830 gpinitstandby:pg02:gpadmin-[INFO]:-Successfully created standby master on pg01
[gpadmin@pg02 ~]$ gpstate -f
20181211:14:50:57:026039 gpstate:pg02:gpadmin-[INFO]:-Starting gpstate with args: -f
20181211:14:50:57:026039 gpstate:pg02:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88'
20181211:14:50:57:026039 gpstate:pg02:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.3.23 (Greenplum Database 5.14.0 build commit:13927a46a9b39527fc1af2cbb1571d4fd394ff88) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Nov 28 2018 08:08:06'
20181211:14:50:57:026039 gpstate:pg02:gpadmin-[INFO]:-Obtaining Segment details from master...
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:-Standby master details
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:-----------------------
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:-   Standby address          = pg01
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:-   Standby data directory   = /u01/gpmaster/gpseg-1
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:-   Standby port             = 5432
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:-   Standby PID              = 27175
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:-   Standby status           = Standby host passive
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--------------------------------------------------------------
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--pg_stat_replication
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--------------------------------------------------------------
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--WAL Sender State: streaming
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--Sync state: sync
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--Sent Location: 0/14000370
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--Flush Location: 0/14000370
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--Replay Location: 0/14000370
20181211:14:50:58:026039 gpstate:pg02:gpadmin-[INFO]:--------------------------------------------------------------