部署Greenplum-4.3.6.2集群(一)

一、准备

1.1.环境

测试服务器主要使用阿里云的ECS服务器

主机名 ip 内存 磁盘 部署用户及目录 gp版本 os版本 节点
host1 172.19.159.4 8g 50g gpadmin /home/gpadmin 4.3.6.2 centos6.7 master
host2 172.19.159.5 8g 50g gpadmin /home/gpadmin 4.3.6.2 centos6.7 segment1
host3 172.19.159.6 8g 50g gpadmin /home/gpadmin 4.3.6.2 centos6.7 segment2

1.2.关闭防火墙与selinux

所有节点均执行以下操作
本身阿里云默认关闭了,这里做个记录
service iptables stop
chkconfig iptables off
setenforce 0
sed -i 's/enforcing/disabled/g' /etc/selinux/config

1.3.修改主机名与hosts

所有节点均执行以下操作
cat change_hosts.sh

#!/bin/bash

read -p "enter three position args:" a b c
cat <<EOF>> /etc/hosts
172.19.159.4 $a
172.19.159.5 $b
172.19.159.6 $c
EOF
read -p "node name:" d
case $d in
master) 
sed -i '/127/s/localhost.localdomain/host1/g' /etc/hosts 
sed -i '/HOSTNAME/s/localhost.localdomain.localdomain/host1/g' /etc/sysconfig/network
;;
segment1)
sed -i '/127/s/localhost.localdomain/host2/g' /etc/hosts 
sed -i '/HOSTNAME/s/localhost.localdomain.localdomain/host2/g' /etc/sysconfig/network
;;
segment2)
sed -i '/127/s/localhost.localdomain/host3/g' /etc/hosts 
sed -i '/HOSTNAME/s/localhost.localdomain.localdomain/host3/g' /etc/sysconfig/network
;;
*)
esac

bash change_hosts.sh && reboot

1.4.创建用户用户组

所有节点均执行以下操作
groupadd -g 550 gpadmin
useradd -m -d /home/gpadmin -g 550 -u 550 -s /bin/bash gpadmin
chown -R gpadmin:gpadmin /home/gpadmin
passwd gpadmin

1.5.修改系统内核参数

所有节点均执行以下操作
vi /etc/sysctl.conf

net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 1
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
kernel.sem = 250 512000 100 2048
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
vm.swappiness = 0
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.ip_local_port_range = 1025 65535
net.core.netdev_max_backlog = 10000
vm.overcommit_memory = 2
net.ipv4.conf.all.arp_filter = 1
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152

sysctl -p
预读参数
blockdev --getra /dev/vda
256
这里的设备文件根据服务器不同来改变,阿里云的为vda,物理服务器可能会是hda或sda
blockdev --setra 16384 /dev/vda
磁盘IO调度
echo "echo deadline > /sys/block/vda/queue/scheduler" >> /etc/rc.local

1.6.修改用户资源限制

所有节点均执行下面操作
vi /etc/security/limits.conf

* soft nofile 65536
* hard nofile 65536
* soft nproc 131072 
* hard nproc 131072

vi /etc/security/limits.d/90-nproc.conf

*          soft    nproc     unlimited
root       soft    nproc     unlimited

1.7.时间同步

阿里云已经时钟同步了,若是自建虚拟机需要建立ntp服务器进行时间同步

二、部署GP

2.1.master节点安装GP

上传gp-4.3.6.2包
[root@host1 ~]# unzip greenplum-db-4.3.6.2-build-1-RHEL5-x86_64.zip
[root@host1 ~]# bash greenplum-db-4.3.6.2-build-1-RHEL5-x86_64.bin
下面是安装提示

********************************************************************************
Do you accept the Pivotal Database license agreement? [yes|no]
********************************************************************************
                yes

********************************************************************************
Provide the installation path for Greenplum Database or press ENTER to 
accept the default installation path: /usr/local/greenplum-db-4.3.6.2
********************************************************************************

/home/gpadmin/greenplum

********************************************************************************
Install Greenplum Database into </home/gpadmin/greenplum>? [yes|no]
********************************************************************************

yes
********************************************************************************
/home/gpadmin/greenplum does not exist.
Create /home/gpadmin/greenplum ? [yes|no]
(Selecting no will exit the installer)
********************************************************************************

yes
Extracting product to /home/gpadmin/greenplum

********************************************************************************
Installation complete.
Greenplum Database is installed in /home/gpadmin/greenplum

Pivotal Greenplum documentation is available
for download at http://docs.gopivotal.com/gpdb
********************************************************************************

chown -R gpadmin:gpadmin /home/gpadmin/greenplum

2.2.配置互信

这次是利用gp里的脚本来配置互信,不适用ssh来配置
在master节点进行如下操作
su gpadmin
mkdir conf
cd conf
vi hostlist

host1
host2
host3

vi seg_hosts

host2
host3

设置环境变量
source /home/gpadmin/greenplum-db/greenplum_path.sh
配置互信,根据提示输入gpadmin的密码
gpssh-exkeys -f /home/gpadmin/conf/hostlist
下面是提示

[STEP 1 of 5] create local ID and authorize on local host

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

[STEP 3 of 5] authorize current user on remote hosts
  ... send to host2
  ***
  *** Enter password for host2: 
  ... send to host3

[STEP 4 of 5] determine common authentication file content

[STEP 5 of 5] copy authentication files to all remote hosts
  ... finished key exchange with host2
  ... finished key exchange with host3

[INFO] completed successfully

2.3.分发软件包

以下操作均在master主机进行操作
su gpadmin
cd /home/gpadmin
tar -vcf greenplum.tar ./greenplum
source /home/gpadmin/greenplum/greenplum_path.sh
分发包
gpscp -f /home/gpadmin/conf/seg_hosts greenplum.tar =:/home/gpadmin
解包
gpssh -f /home/gpadmin/conf/seg_hosts
以下是提示

Note: command history unsupported on this machine ...
=> cd /home/gpadmin
[host3]
[host2]   
=> ls
[host3] greenplum.tar
[host2] greenplum.tar
=> tar -vxf greenplum.tar
=> ls
[host3] greenplum.tar greenplum
[host2] greenplum.targreenplum
=> ln -s ./greenplum greenplum-db
[host2]
[host3]
=> exit

2.4.初始化数据库

在master执行以下操作
su gpadmin
source /home/gpadmin/greenplum/greenplum_path.sh
gpssh -f /home/gpadmin/conf/hostlist
提示

Note: command history unsupported on this machine ...
=> pwd
[host3] /home/gpadmin
[host2] /home/gpadmin
[host1] /home/gpadmin
=> mkdir gpdata 
[host3]
[host2]
[host1]
=> cd gpdata
[host3]
[host2]
[host1]
=> mkdir gpmaster gpdatap gpdatam
[host3]
[host2]
[host1]
=> ll
[host3] total 12
[host3] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpdatam
[host3] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpdatap
[host3] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpmaster
[host2] total 12
[host2] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpdatam
[host2] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpdatap
[host2] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpmaster
[host1] total 12
[host1] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpdatam
[host1] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpdatap
[host1] drwxrwxr-x 2 gpadmin gpadmin 4096 Feb 10 22:30 gpmaster
=> exit

配置环境变量
在所有节点执行下面操作
vi env_configure.sh

#!/bin/bash

cat <<EOF>> .bash_profile   
source /home/gpadmin/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/home/gpadmin/gpdata/gpmaster/gpseg-1
export PGPORT=5432
export PGDATABASE=postres
EOF

source .bash_profile

配置gp初始化参数
在master执行以下操作
vi /home/gpadmin/conf/gpinitsystem_config

ARRAY_NAME="Greenplum"
SEG_PREFIX=gpseg
PORT_BASE=33000
declare -a DATA_DIRECTORY=(/home/gpadmin/gpdata/gpdatap)
MASTER_HOSTNAME=host1
MASTER_DIRECTORY=/home/gpadmin/gpdata/gpmaster
MASTER_PORT=5432
TRUSTED_SHELL=/usr/bin/ssh
MIRROR_PORT_BASE=43000
REPLICATION_PORT_BASE=34000
MIRROR_REPLICATION_PORT_BASE=44000
declare -a MIRROR_DATA_DIRECTORY=(/home/gpadmin/gpdata/gpdatam)
MACHINE_LIST_FILE=/home/gpadmin/conf/seg_hosts

初始化集群
gpinitsystem -c /home/gpadmin/conf/gpinitsystem_config -h /home/gpadmin/conf/seg_hosts
提示

20200210:22:47:48:002389 gpinitsystem:host1:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20200210:22:47:48:002389 gpinitsystem:host1:gpadmin-[INFO]:-Reading Greenplum configuration file /home/gpadmin/conf/gpinitsystem_config
20200210:22:47:48:002389 gpinitsystem:host1:gpadmin-[INFO]:-Locale has not been set in /home/gpadmin/conf/gpinitsystem_config, will set to default value
20200210:22:47:48:002389 gpinitsystem:host1:gpadmin-[INFO]:-Locale set to en_US.utf8
20200210:22:47:48:002389 gpinitsystem:host1:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20200210:22:47:48:002389 gpinitsystem:host1:gpadmin-[WARN]:-CHECK_POINT_SEGMENTS variable not set, will set to default value
20200210:22:47:48:002389 gpinitsystem:host1:gpadmin-[WARN]:-ENCODING variable not set, will set to default UTF-8
20200210:22:47:48:002389 gpinitsystem:host1:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250
20200210:22:47:49:002389 gpinitsystem:host1:gpadmin-[INFO]:-Checking configuration parameters, Completed
20200210:22:47:49:002389 gpinitsystem:host1:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
..
20200210:22:47:49:002389 gpinitsystem:host1:gpadmin-[INFO]:-Configuring build for standard array
20200210:22:47:49:002389 gpinitsystem:host1:gpadmin-[INFO]:-Commencing multi-home checks, Completed
20200210:22:47:49:002389 gpinitsystem:host1:gpadmin-[INFO]:-Building primary segment instance array, please wait...
..
20200210:22:47:50:002389 gpinitsystem:host1:gpadmin-[INFO]:-Building group mirror array type , please wait...
..
20200210:22:47:51:002389 gpinitsystem:host1:gpadmin-[INFO]:-Checking Master host
20200210:22:47:51:002389 gpinitsystem:host1:gpadmin-[INFO]:-Checking new segment hosts, please wait...
.20200210:22:47:53:002389 gpinitsystem:host1:gpadmin-[WARN]:-----------------------------------------------------------
20200210:22:47:53:002389 gpinitsystem:host1:gpadmin-[WARN]:-Host host2 is assigned as localhost in /etc/hosts
20200210:22:47:54:002389 gpinitsystem:host1:gpadmin-[WARN]:-This will cause segment->master communication failures
20200210:22:47:54:002389 gpinitsystem:host1:gpadmin-[WARN]:-Remove host2 from local host line in /etc/hosts
20200210:22:47:54:002389 gpinitsystem:host1:gpadmin-[WARN]:-----------------------------------------------------------
.20200210:22:47:54:002389 gpinitsystem:host1:gpadmin-[WARN]:-----------------------------------------------------------
20200210:22:47:54:002389 gpinitsystem:host1:gpadmin-[WARN]:-Host host3 is assigned as localhost in /etc/hosts
20200210:22:47:54:002389 gpinitsystem:host1:gpadmin-[WARN]:-This will cause segment->master communication failures
20200210:22:47:54:002389 gpinitsystem:host1:gpadmin-[WARN]:-Remove host3 from local host line in /etc/hosts
20200210:22:47:54:002389 gpinitsystem:host1:gpadmin-[WARN]:-----------------------------------------------------------
..
20200210:22:47:55:002389 gpinitsystem:host1:gpadmin-[INFO]:-Checking new segment hosts, Completed
20200210:22:47:55:002389 gpinitsystem:host1:gpadmin-[INFO]:-Greenplum Database Creation Parameters
20200210:22:47:55:002389 gpinitsystem:host1:gpadmin-[INFO]:---------------------------------------
20200210:22:47:55:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master Configuration
20200210:22:47:55:002389 gpinitsystem:host1:gpadmin-[INFO]:---------------------------------------
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master instance name       = Greenplum
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master hostname            = host1
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master port                = 5432
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master instance dir        = /home/gpadmin/gpdata/gpmaster/gpseg-1
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master LOCALE              = en_US.utf8
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Greenplum segment prefix   = gpseg
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master Database            = 
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master connections         = 250
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master buffers             = 128000kB
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Segment connections        = 750
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Segment buffers            = 128000kB
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Checkpoint segments        = 8
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Encoding                   = UTF-8
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Postgres param file        = Off
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Initdb to be used          = /home/gpadmin/greenplum-db/./bin/initdb
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-GP_LIBRARY_PATH is         = /home/gpadmin/greenplum-db/./lib
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Ulimit check               = Passed
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Array host connect type    = Single hostname per node
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master IP address [1]      = ::1
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master IP address [2]      = 172.19.159.4
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Master IP address [3]      = fe80::216:3eff:fe06:4d89
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Standby Master             = Not Configured
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Primary segment #          = 1
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total Database segments    = 2
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Trusted shell              = /usr/bin/ssh
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Number segment hosts       = 2
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Mirror port base           = 43000
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Replicaton port base       = 34000
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Mirror replicaton port base= 44000
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Mirror segment #           = 1
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Mirroring config           = ON
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Mirroring type             = Group
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:----------------------------------------
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Greenplum Primary Segment Configuration
20200210:22:47:56:002389 gpinitsystem:host1:gpadmin-[INFO]:----------------------------------------
20200210:22:47:57:002389 gpinitsystem:host1:gpadmin-[INFO]:-host2       /home/gpadmin/gpdata/gpdatap/gpseg0     33000   2       0       34000
20200210:22:47:57:002389 gpinitsystem:host1:gpadmin-[INFO]:-host3       /home/gpadmin/gpdata/gpdatap/gpseg1     33000   3       1       34000
20200210:22:47:57:002389 gpinitsystem:host1:gpadmin-[INFO]:---------------------------------------
20200210:22:47:57:002389 gpinitsystem:host1:gpadmin-[INFO]:-Greenplum Mirror Segment Configuration
20200210:22:47:57:002389 gpinitsystem:host1:gpadmin-[INFO]:---------------------------------------
20200210:22:47:57:002389 gpinitsystem:host1:gpadmin-[INFO]:-host3       /home/gpadmin/gpdata/gpdatam/gpseg0     43000   4       0       44000
20200210:22:47:57:002389 gpinitsystem:host1:gpadmin-[INFO]:-host2       /home/gpadmin/gpdata/gpdatam/gpseg1     43000   5       1       44000
Continue with Greenplum creation Yy/Nn>
Y
20200210:22:48:33:002389 gpinitsystem:host1:gpadmin-[INFO]:-Building the Master instance database, please wait...
20200210:22:48:48:002389 gpinitsystem:host1:gpadmin-[INFO]:-Starting the Master in admin mode
20200210:22:48:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Commencing parallel build of primary segment instances
20200210:22:48:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
..
20200210:22:48:56:002389 gpinitsystem:host1:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
..................
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-Parallel process exit status
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total processes marked as completed           = 0
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total processes marked as killed              = 0
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[WARN]:-Total processes marked as failed              = 2 <<<<<
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
..
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.....
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-Parallel process exit status
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total processes marked as completed           = 0
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total processes marked as killed              = 0
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[WARN]:-Total processes marked as failed              = 2 <<<<<
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[FATAL]:-Errors generated from parallel processes
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-Dumped contents of status file to the log file
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-Building composite backout file
20200210:22:49:21:gpinitsystem:host1:gpadmin-[FATAL]:-Failures detected, see log file /home/gpadmin/gpAdminLogs/gpinitsystem_20200210.log for more detail Script Exiting!
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[WARN]:-Script has left Greenplum Database in an incomplete state
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[WARN]:-Run command /bin/bash /home/gpadmin/gpAdminLogs/backout_gpinitsystem_gpadmin_20200210_224747 to remove these changes
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function BACKOUT_COMMAND   

tail -n 200 /home/gpadmin/gpAdminLogs/gpinitsystem_20200210.log

ok

Success. You can now start the database server using:

    /home/gpadmin/greenplum-db/./bin/postgres -D /home/gpadmin/gpdata/gpdatap/gpseg1
or
    /home/gpadmin/greenplum-db/./bin/pg_ctl -D /home/gpadmin/gpdata/gpdatap/gpseg1 -l logfile start


WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
20200210:22:49:13:011928 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20200210:22:49:13:011928 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function BACKOUT_COMMAND
20200210:22:49:13:011928 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20200210:22:49:13:011928 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function BACKOUT_COMMAND
20200210:22:49:13:011928 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Completed to start segment instance database host3 /home/gpadmin/gpdata/gpdatap/gpseg1
20200210:22:49:13:011928 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Configuring segment postgresql.conf
20200210:22:49:13:011928 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Completed Update /home/gpadmin/gpdata/gpdatap/gpseg1/postgresql.conf file
20200210:22:49:14:011928 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Completed Update /home/gpadmin/gpdata/gpdatap/gpseg1/postgresql.conf file
20200210:22:49:14:011928 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function ED_PG_CONF
20200210:22:49:14:011928 gpcreateseg.sh:host1:gpadmin-[WARN]:-Failed to insert port=33000 in /home/gpadmin/gpdata/gpdatap/gpseg1/postgresql.conf on host3
20200210:22:49:14:011928 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function ED_PG_CONF
20200210:22:49:14:011928 gpcreateseg.sh:host1:gpadmin-[FATAL][1]:-Failed Update port number to 33000
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function PARALLEL_WAIT
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function PARALLEL_COUNT
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function PARALLEL_SUMMARY_STATUS_REPORT
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-Parallel process exit status
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total processes marked as completed           = 0
20200210:22:49:14:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total processes marked as killed              = 0
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[WARN]:-Total processes marked as failed              = 2 <<<<<
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function PARALLEL_SUMMARY_STATUS_REPORT
FAILED:host2~33000~/home/gpadmin/gpdata/gpdatap/gpseg0~2~0~34000
FAILED:host3~33000~/home/gpadmin/gpdata/gpdatap/gpseg1~3~1~34000
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function CREATE_QES_PRIMARY
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function CREATE_QES_MIRROR
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function PARALLEL_SETUP
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function PARALLEL_SETUP
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function PARALLEL_COUNT
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function PARALLEL_COUNT
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function PARALLEL_COUNT
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function PARALLEL_WAIT
20200210:22:49:15:002389 gpinitsystem:host1:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
20200210:22:49:15:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Start Main
20200210:22:49:15:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Command line options passed to utility = ::1~172.19.159.4~fe80::216:3eff:fe06:4d89
20200210:22:49:15:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Start Main
20200210:22:49:15:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Start Function PROCESS_QE
20200210:22:49:15:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Command line options passed to utility = ::1~172.19.159.4~fe80::216:3eff:fe06:4d89
20200210:22:49:15:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Processing segment host3
20200210:22:49:15:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Start Function PROCESS_QE
20200210:22:49:15:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Processing segment host2
The files belonging to this database system will be owned by user "gpadmin".
This user must also own the server process.

The database cluster will be initialized with locale en_US.utf8.

creating directory /home/gpadmin/gpdata/gpdatam/gpseg0 ... ok
creating subdirectories ... ok
selecting default max_connections ... The files belonging to this database system will be owned by user "gpadmin".
This user must also own the server process.

The database cluster will be initialized with locale en_US.utf8.

creating directory /home/gpadmin/gpdata/gpdatam/gpseg1 ... ok
creating subdirectories ... ok
selecting default max_connections ... 750
selecting default shared_buffers/max_fsm_pages ... 125MB/200000
creating configuration files ... ok

Success. You can now start the database server using:

    /home/gpadmin/greenplum-db/./bin/postgres -D /home/gpadmin/gpdata/gpdatam/gpseg1
or
    /home/gpadmin/greenplum-db/./bin/pg_ctl -D /home/gpadmin/gpdata/gpdatam/gpseg1 -l logfile start


WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
750
selecting default shared_buffers/max_fsm_pages ... 125MB/200000
creating configuration files ... ok

Success. You can now start the database server using:

    /home/gpadmin/greenplum-db/./bin/postgres -D /home/gpadmin/gpdata/gpdatam/gpseg0
or
    /home/gpadmin/greenplum-db/./bin/pg_ctl -D /home/gpadmin/gpdata/gpdatam/gpseg0 -l logfile start


WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
20200210:22:49:16:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20200210:22:49:16:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20200210:22:49:16:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function BACKOUT_COMMAND
20200210:22:49:16:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function BACKOUT_COMMAND
20200210:22:49:16:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20200210:22:49:16:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20200210:22:49:16:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function BACKOUT_COMMAND
20200210:22:49:16:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function BACKOUT_COMMAND
20200210:22:49:16:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Completed to start segment instance database host2 /home/gpadmin/gpdata/gpdatam/gpseg1
20200210:22:49:16:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Completed to start segment instance database host3 /home/gpadmin/gpdata/gpdatam/gpseg0
20200210:22:49:16:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-Copying data for mirror on host2 using remote copy from primary host3 ...
20200210:22:49:16:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-Copying data for mirror on host3 using remote copy from primary host2 ...
20200210:22:49:16:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function RUN_COMMAND_REMOTE
20200210:22:49:16:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function RUN_COMMAND_REMOTE
20200210:22:49:16:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-Commencing remote /usr/bin/ssh host3 export GPHOME=/home/gpadmin/greenplum-db/.; . /home/gpadmin/greenplum-db/./greenplum_path.sh; /home/gpadmin/greenplum-db/./bin/lib/pysync.py -x pg_log -x postgresql.conf -x postmaster.pid /home/gpadmin/gpdata/gpdatap/gpseg1 \[host2\]:/home/gpadmin/gpdata/gpdatam/gpseg1
20200210:22:49:16:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-Commencing remote /usr/bin/ssh host2 export GPHOME=/home/gpadmin/greenplum-db/.; . /home/gpadmin/greenplum-db/./greenplum_path.sh; /home/gpadmin/greenplum-db/./bin/lib/pysync.py -x pg_log -x postgresql.conf -x postmaster.pid /home/gpadmin/gpdata/gpdatap/gpseg0 \[host3\]:/home/gpadmin/gpdata/gpdatam/gpseg0
[2020-02-10 22:49:14.728098] Processed 4.72 MiB of 93.77 MiB (5%); 4.72 MiB processed at 39.02 MiBps; 81 of 592 files processed
[2020-02-10 22:49:14.818728] Processed 9.48 MiB of 93.77 MiB (10%); 4.76 MiB processed at 52.52 MiBps; 143 of 592 files processed
[2020-02-10 22:49:14.983781] Processed 17.64 MiB of 93.77 MiB (18%); 8.16 MiB processed at 49.47 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.034921] Processed 21.45 MiB of 93.77 MiB (22%); 3.81 MiB processed at 74.39 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.082420] Processed 25.27 MiB of 93.77 MiB (26%); 3.81 MiB processed at 80.31 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.130386] Processed 29.08 MiB of 93.77 MiB (31%); 3.81 MiB processed at 79.53 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.183229] Processed 32.90 MiB of 93.77 MiB (35%); 3.81 MiB processed at 72.20 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.274482] Processed 40.53 MiB of 93.77 MiB (43%); 7.63 MiB processed at 83.61 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.329454] Processed 44.34 MiB of 93.77 MiB (47%); 3.81 MiB processed at 69.40 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.380321] Processed 48.15 MiB of 93.77 MiB (51%); 3.81 MiB processed at 74.97 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.430762] Processed 51.97 MiB of 93.77 MiB (55%); 3.81 MiB processed at 75.63 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.525606] Processed 59.60 MiB of 93.77 MiB (63%); 7.63 MiB processed at 80.44 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.571372] Processed 63.41 MiB of 93.77 MiB (67%); 3.81 MiB processed at 83.35 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.618219] Processed 67.23 MiB of 93.77 MiB (71%); 3.81 MiB processed at 81.43 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.662123] Processed 71.04 MiB of 93.77 MiB (75%); 3.81 MiB processed at 86.88 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.737882] Processed 77.82 MiB of 93.77 MiB (82%); 6.78 MiB processed at 89.50 MiBps; 250 of 592 files processed
[2020-02-10 22:49:15.780964] Processed 79.92 MiB of 93.77 MiB (85%); 2.09 MiB processed at 48.58 MiBps; 279 of 592 files processed
[2020-02-10 22:49:15.894538] Processed 84.54 MiB of 93.77 MiB (90%); 4.63 MiB processed at 40.72 MiBps; 369 of 592 files processed
[2020-02-10 22:49:16.020708] Processed 89.39 MiB of 93.77 MiB (95%); 4.84 MiB processed at 38.44 MiBps; 470 of 592 files processed
[2020-02-10 22:49:16.163211] Processed 93.77 MiB of 93.77 MiB (100%); 4.39 MiB processed at 30.77 MiBps; 591 of 592 files processed
[2020-02-10 22:49:16.186187] Processed 93.77 MiB of 93.77 MiB (100%); 93.77 MiB processed at 59.39 MiBps; 592 of 592 files processed
20200210:22:49:18:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-Completed /usr/bin/ssh host3 export GPHOME=/home/gpadmin/greenplum-db/.; . /home/gpadmin/greenplum-db/./greenplum_path.sh; /home/gpadmin/greenplum-db/./bin/lib/pysync.py -x pg_log -x postgresql.conf -x postmaster.pid /home/gpadmin/gpdata/gpdatap/gpseg1 \[host2\]:/home/gpadmin/gpdata/gpdatam/gpseg1
20200210:22:49:18:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function RUN_COMMAND_REMOTE
20200210:22:49:18:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Completed remote copy of segment data directory from host3 to host2
[2020-02-10 22:49:17.638378] Processed 4.72 MiB of 93.77 MiB (5%); 4.72 MiB processed at 32.78 MiBps; 81 of 592 files processed
[2020-02-10 22:49:17.739673] Processed 9.48 MiB of 93.77 MiB (10%); 4.76 MiB processed at 46.82 MiBps; 143 of 592 files processed
[2020-02-10 22:49:17.912556] Processed 17.64 MiB of 93.77 MiB (18%); 8.16 MiB processed at 47.19 MiBps; 250 of 592 files processed
[2020-02-10 22:49:17.973767] Processed 21.45 MiB of 93.77 MiB (22%); 3.81 MiB processed at 62.32 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.021197] Processed 25.27 MiB of 93.77 MiB (26%); 3.81 MiB processed at 80.42 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.075650] Processed 29.08 MiB of 93.77 MiB (31%); 3.81 MiB processed at 70.06 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.125121] Processed 32.90 MiB of 93.77 MiB (35%); 3.81 MiB processed at 77.11 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.217935] Processed 40.53 MiB of 93.77 MiB (43%); 7.63 MiB processed at 82.21 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.267509] Processed 44.34 MiB of 93.77 MiB (47%); 3.81 MiB processed at 76.94 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.312892] Processed 48.15 MiB of 93.77 MiB (51%); 3.81 MiB processed at 84.06 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.360400] Processed 51.97 MiB of 93.77 MiB (55%); 3.81 MiB processed at 80.32 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.458484] Processed 59.60 MiB of 93.77 MiB (63%); 7.63 MiB processed at 77.77 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.502934] Processed 63.41 MiB of 93.77 MiB (67%); 3.81 MiB processed at 85.82 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.547933] Processed 67.23 MiB of 93.77 MiB (71%); 3.81 MiB processed at 84.77 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.592251] Processed 71.04 MiB of 93.77 MiB (75%); 3.81 MiB processed at 86.07 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.673298] Processed 77.82 MiB of 93.77 MiB (82%); 6.78 MiB processed at 83.68 MiBps; 250 of 592 files processed
[2020-02-10 22:49:18.724986] Processed 79.92 MiB of 93.77 MiB (85%); 2.09 MiB processed at 40.48 MiBps; 279 of 592 files processed
[2020-02-10 22:49:18.842597] Processed 84.54 MiB of 93.77 MiB (90%); 4.63 MiB processed at 39.33 MiBps; 369 of 592 files processed
[2020-02-10 22:49:18.969130] Processed 89.39 MiB of 93.77 MiB (95%); 4.84 MiB processed at 38.28 MiBps; 470 of 592 files processed
[2020-02-10 22:49:19.079900] Processed 93.77 MiB of 93.77 MiB (100%); 4.39 MiB processed at 39.63 MiBps; 591 of 592 files processed
[2020-02-10 22:49:19.085251] Processed 93.77 MiB of 93.77 MiB (100%); 93.77 MiB processed at 58.93 MiBps; 592 of 592 files processed
20200210:22:49:18:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Configuring segment postgresql.conf
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-Completed /usr/bin/ssh host2 export GPHOME=/home/gpadmin/greenplum-db/.; . /home/gpadmin/greenplum-db/./greenplum_path.sh; /home/gpadmin/greenplum-db/./bin/lib/pysync.py -x pg_log -x postgresql.conf -x postmaster.pid /home/gpadmin/gpdata/gpdatap/gpseg0 \[host3\]:/home/gpadmin/gpdata/gpdatam/gpseg0
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function RUN_COMMAND_REMOTE
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Completed remote copy of segment data directory from host2 to host3
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Configuring segment postgresql.conf
20200210:22:49:19:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Completed Update /home/gpadmin/gpdata/gpdatam/gpseg1/postgresql.conf file
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Completed Update /home/gpadmin/gpdata/gpdatam/gpseg0/postgresql.conf file
20200210:22:49:19:013615 gpcreateseg.sh:host1:gpadmin-[INFO][1]:-Completed Update /home/gpadmin/gpdata/gpdatam/gpseg1/postgresql.conf file
20200210:22:49:19:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function ED_PG_CONF
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Completed Update /home/gpadmin/gpdata/gpdatam/gpseg0/postgresql.conf file
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function ED_PG_CONF
20200210:22:49:19:013615 gpcreateseg.sh:host1:gpadmin-[WARN]:-Failed to insert port=43000 in /home/gpadmin/gpdata/gpdatam/gpseg1/postgresql.conf on host2
20200210:22:49:19:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function ED_PG_CONF
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[WARN]:-Failed to insert port=43000 in /home/gpadmin/gpdata/gpdatam/gpseg0/postgresql.conf on host3
20200210:22:49:19:013615 gpcreateseg.sh:host1:gpadmin-[FATAL][1]:-Failed Update port number to 43000
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-End Function ED_PG_CONF
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[FATAL][0]:-Failed Update port number to 43000
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function PARALLEL_WAIT
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function PARALLEL_COUNT
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function PARALLEL_SUMMARY_STATUS_REPORT
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-Parallel process exit status
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total processes marked as completed           = 0
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-Total processes marked as killed              = 0
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[WARN]:-Total processes marked as failed              = 2 <<<<<
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:------------------------------------------------
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function PARALLEL_SUMMARY_STATUS_REPORT
FAILED:host2~43000~/home/gpadmin/gpdata/gpdatam/gpseg1~5~1~44000
FAILED:host3~43000~/home/gpadmin/gpdata/gpdatam/gpseg0~4~0~44000
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function CREATE_QES_MIRROR
INSERT 0 1
20200210:22:49:20:002389 gpinitsystem:host1:gpadmin-[FATAL]:-Errors generated from parallel processes
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-Dumped contents of status file to the log file
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-Building composite backout file
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function ERROR_EXIT
20200210:22:49:21:gpinitsystem:host1:gpadmin-[FATAL]:-Failures detected, see log file /home/gpadmin/gpAdminLogs/gpinitsystem_20200210.log for more detail Script Exiting!
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[WARN]:-Script has left Greenplum Database in an incomplete state
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[WARN]:-Run command /bin/bash /home/gpadmin/gpAdminLogs/backout_gpinitsystem_gpadmin_20200210_224747 to remove these changes
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20200210:22:49:21:002389 gpinitsystem:host1:gpadmin-[INFO]:-End Function BACKOUT_COMMAND

从上面的日志可以看出,报错是从下面这个地方开始

20200210:22:49:19:013615 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function ED_PG_CONF
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO][0]:-Completed Update /home/gpadmin/gpdata/gpdatam/gpseg0/postgresql.conf file
20200210:22:49:19:013538 gpcreateseg.sh:host1:gpadmin-[INFO]:-Start Function ED_PG_CONF
20200210:22:49:19:013615 gpcreateseg.sh:host1:gpadmin-[WARN]:-Failed to insert port=43000 in /home/gpadmin/gpdata/gpdatam/gpseg1/postgresql.conf on host2

解决方法:yum -y install ed (需要root权限,每个节点都要执行)

先把前面产生的数据删除(所有节点下的/home/gpadmin/gpdata的目录gpmaster、gpdatap、gpdatam)杀掉占用5432端口的进程后再次初始化
报错

20200210:23:06:28:019351 gpinitsystem:host1:gpadmin-[WARN]:-Have lock file /tmp/.s.PGSQL.5432.lock but no process running on port 5432
20200210:23:06:28:gpinitsystem:host1:gpadmin-[FATAL]:-Found indication of postmaster process on port 5432 on Master host Script Exiting!

解决办法:rm -f /tmp/.s.PGSQL.5432.lock

初始化

Continue with Greenplum creation Yy/Nn>
Y
20200210:23:13:21:030468 gpinitsystem:host1:gpadmin-[INFO]:-Building the Master instance database, please wait...

启停Gp
gpstart


20200210:23:54:24:001363 gpstart:host1:gpadmin-[INFO]:-Starting gpstart with args: 
20200210:23:54:24:001363 gpstart:host1:gpadmin-[INFO]:-Gathering information and validating the environment...
20200210:23:54:25:001363 gpstart:host1:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.3.6.2 build 1'
20200210:23:54:25:001363 gpstart:host1:gpadmin-[INFO]:-Greenplum Catalog Version: '201310150'
20200210:23:54:25:001363 gpstart:host1:gpadmin-[INFO]:-Starting Master instance in admin mode
20200210:23:54:26:001363 gpstart:host1:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20200210:23:54:26:001363 gpstart:host1:gpadmin-[INFO]:-Obtaining Segment details from master...
20200210:23:54:26:001363 gpstart:host1:gpadmin-[INFO]:-Setting new master era
20200210:23:54:26:001363 gpstart:host1:gpadmin-[INFO]:-Master Started...
20200210:23:54:26:001363 gpstart:host1:gpadmin-[INFO]:-Shutting down master
20200210:23:54:28:001363 gpstart:host1:gpadmin-[WARNING]:-Skipping startup of segment marked down in configuration: on host3 directory /home/gpadmin/gpdata/gpdatam/gpseg0 <<<<<
20200210:23:54:28:001363 gpstart:host1:gpadmin-[WARNING]:-Skipping startup of segment marked down in configuration: on host2 directory /home/gpadmin/gpdata/gpdatam/gpseg1 <<<<<
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:---------------------------
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-Master instance parameters
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:---------------------------
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-Database                 = template1
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-Master Port              = 5432
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-Master directory         = /home/gpadmin/gpdata/gpmaster/gpseg-1
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-Timeout                  = 600 seconds
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-Master standby           = Off 
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:---------------------------------------
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-Segment instances that will be started
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:---------------------------------------
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-   Host    Datadir                               Port    Role
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-   host2   /home/gpadmin/gpdata/gpdatap/gpseg0   33000   Primary
20200210:23:54:28:001363 gpstart:host1:gpadmin-[INFO]:-   host3   /home/gpadmin/gpdata/gpdatap/gpseg1   33000   Primary

Continue with Greenplum instance startup Yy|Nn (default=N):
> Y
20200210:23:54:31:001363 gpstart:host1:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
.... 
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-Process results...
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-----------------------------------------------------
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-   Successful segment starts                                            = 2
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20200210:23:54:35:001363 gpstart:host1:gpadmin-[WARNING]:-Skipped segment starts (segments are marked down in configuration)   = 2   <<<<<<<<
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-----------------------------------------------------
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-Successfully started 2 of 2 segment instances, skipped 2 other segments 
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-----------------------------------------------------
20200210:23:54:35:001363 gpstart:host1:gpadmin-[WARNING]:-****************************************************************************
20200210:23:54:35:001363 gpstart:host1:gpadmin-[WARNING]:-There are 2 segment(s) marked down in the database
20200210:23:54:35:001363 gpstart:host1:gpadmin-[WARNING]:-To recover from this current state, review usage of the gprecoverseg
20200210:23:54:35:001363 gpstart:host1:gpadmin-[WARNING]:-management utility which will recover failed segment instance databases.
20200210:23:54:35:001363 gpstart:host1:gpadmin-[WARNING]:-****************************************************************************
20200210:23:54:35:001363 gpstart:host1:gpadmin-[INFO]:-Starting Master instance host1 directory /home/gpadmin/gpdata/gpmaster/gpseg-1 
20200210:23:54:36:001363 gpstart:host1:gpadmin-[INFO]:-Command pg_ctl reports Master host1 instance active
20200210:23:54:36:001363 gpstart:host1:gpadmin-[INFO]:-No standby master configured.  skipping...
20200210:23:54:36:001363 gpstart:host1:gpadmin-[WARNING]:-Number of segments not attempted to start: 2
20200210:23:54:36:001363 gpstart:host1:gpadmin-[INFO]:-Check status of database with gpstate utility

gpstop


20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-Starting gpstop with args: 
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-Gathering information and validating the environment...
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-Obtaining Segment details from master...
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.6.2 build 1'
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:---------------------------------------------
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-Master instance parameters
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:---------------------------------------------
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   Master Greenplum instance process active PID   = 1423
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   Database                                       = template1
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   Master port                                    = 5432
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   Master directory                               = /home/gpadmin/gpdata/gpmaster/gpseg-1
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   Shutdown mode                                  = smart
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   Timeout                                        = 120
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   Shutdown Master standby host                   = Off
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:---------------------------------------------
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-Segment instances that will be shutdown:
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:---------------------------------------------
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   Host    Datadir                               Port    Status
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   host2   /home/gpadmin/gpdata/gpdatap/gpseg0   33000   u
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   host3   /home/gpadmin/gpdata/gpdatam/gpseg0   43000   d
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   host3   /home/gpadmin/gpdata/gpdatap/gpseg1   33000   u
20200211:00:01:35:001576 gpstop:host1:gpadmin-[INFO]:-   host2   /home/gpadmin/gpdata/gpdatam/gpseg1   43000   d

Continue with Greenplum instance shutdown Yy|Nn (default=N):
> Y
20200211:00:01:41:001576 gpstop:host1:gpadmin-[INFO]:-There are 0 connections to the database
20200211:00:01:41:001576 gpstop:host1:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
20200211:00:01:41:001576 gpstop:host1:gpadmin-[INFO]:-Master host=host1
20200211:00:01:41:001576 gpstop:host1:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=smart
20200211:00:01:41:001576 gpstop:host1:gpadmin-[INFO]:-Master segment instance directory=/home/gpadmin/gpdata/gpmaster/gpseg-1
20200211:00:01:42:001576 gpstop:host1:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20200211:00:01:42:001576 gpstop:host1:gpadmin-[INFO]:-Terminating processes for segment /home/gpadmin/gpdata/gpmaster/gpseg-1
20200211:00:01:42:001576 gpstop:host1:gpadmin-[INFO]:-No standby master host configured
20200211:00:01:42:001576 gpstop:host1:gpadmin-[INFO]:-Commencing parallel primary segment instance shutdown, please wait...
20200211:00:01:42:001576 gpstop:host1:gpadmin-[INFO]:-0.00% of jobs completed
20200211:00:01:52:001576 gpstop:host1:gpadmin-[INFO]:-100.00% of jobs completed
20200211:00:01:52:001576 gpstop:host1:gpadmin-[INFO]:-Commencing parallel mirror segment instance shutdown, please wait...
20200211:00:01:52:001576 gpstop:host1:gpadmin-[INFO]:-0.00% of jobs completed
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-100.00% of jobs completed
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-----------------------------------------------------
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-   Segments stopped successfully                              = 4
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-   Segments with errors during stop                           = 0
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-   
20200211:00:02:02:001576 gpstop:host1:gpadmin-[WARNING]:-Segments that are currently marked down in configuration   = 2   <<<<<<<<
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-            (stop was still attempted on these segments)
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-----------------------------------------------------
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-Successfully shutdown 4 of 4 segment instances 
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-Cleaning up leftover gpmmon process
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-No leftover gpmmon process found
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts
20200211:00:02:02:001576 gpstop:host1:gpadmin-[INFO]:-Cleaning up leftover shared memory

验证
访问数据库
gpstart

psql -d postgres  
psql (8.2.15)
Type "help" for help.

postgres=# select datname,datdba,encoding,datacl from pg_database;
  datname  | datdba | encoding |              datacl              
-----------+--------+----------+----------------------------------
 postgres  |     10 |        6 | 
 template1 |     10 |        6 | {=c/gpadmin,gpadmin=CTc/gpadmin}
 template0 |     10 |       6 | {=c/gpadmin,gpadmin=CTc/gpadmin}
(3 rows)

三、参考

Greenplum-4.3.16.1集群部署,该文章加了一个standby master