Greenplum6.x安装

服务器环境配置完成后,进行安装操作。

一. 安装Greenplum

1. 上传软件包

root用户登录master机器192.168.0.110

将下载的greenplum-db-6.18.2-rhel7-x86_64.rpm安装包上传到/opt目录下
然后赋可执行权限

 cd /opt
 chmod +x greenplum-db-6.18.2-rhel7-x86_64.rpm 

2.安装依赖包

[root@mdw opt]#  yum install apr apr-util bash bzip2 curl krb5 libcurl  libevent libxml2 libyaml zlib openldap openssh openssl openssl-libs perl readline rsync R sed tar zip

Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

There are no enabled repos.
 Run "yum repolist all" to see the repos you have.
 To enable Red Hat Subscription Management repositories:
     subscription-manager repos --enable <repo>
 To enable custom repositories:
     yum-config-manager --enable <repo>
[root@mdw opt]#

配置本地yum源(忽略)

root用户登录所有服务器

挂载镜像

[root@mdw opt]# mount /dev/cdrom /mnt/
mount: no medium found on /dev/sr0

若报错则执行如下操作

由于当前虚拟机方式,这里设置共享目录,虚拟机–设置–选项–共享文件夹。每台服务器都设置
在这里插入图片描述
镜像文件从/mnt/hgfs/redhat7.9访问

# 执行挂载
[root@mdw redhat7.9]# mount -o loop /mnt/hgfs/redhat7.9/rhel-server-7.9-x86_64-dvd.iso /mnt/
mount: /dev/loop0 is write-protected, mounting read-only

# 开机自启动
chmod +x /etc/rc.d/rc.local
vi /etc/rc.d/rc.local
# 在结尾添加
/bin/mount -o loop /mnt/hgfs/redhat7.9/rhel-server-7.9-x86_64-dvd.iso /mnt/
vi /etc/yum.repos.d/local_iso.repo

#添加内容

[local]
name=redhat_local
baseurl=file:///mnt/
enable=1
gpgckeck=0

保存退出

#执行yum repolist 可以正常使用
[root@mdw redhat7.9]# yum repolist
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
local                                                                                                                                                                              | 2.8 kB  00:00:00
(1/2): local/group                                                                                                                                                                 | 628 kB  00:00:00
(2/2): local/primary                                                                                                                                                               | 2.1 MB  00:00:00
local                                                                                                                                                                                           5230/5230
repo id                                                                                        repo name                                                                                            status
local                                                                                          redhat_local                                                                                         5,230
repolist: 5,230
You have new mail in /var/spool/mail/root

3. 创建目录

root用户登录所有服务器

mkdir -p /greenplum
# 赋权限
chown -R gpadmin:gpadmin /greenplum

4. 安装

root用户登录master机器

1. 执行安装

root用户在主机上操作

#安装到指定目录下
[root@mdw opt]# rpm -Uvi greenplum-db-6.18.2-rhel7-x86_64.rpm --prefix=/greenplum
Preparing packages...
greenplum-db-6-6.18.2-1.el7.x86_64
You have new mail in /var/spool/mail/root

#赋权限给gpadmin用户
chown -R gpadmin:gpadmin /greenplum

2. 新建包含机器名称的配置文件

切换到gpadmin用户

su - gpadmin
#1.新建所有机器文件hostlist(含master,segment,standby)
vi /tmp/hostlist
#里面内容为所有机器信息,无多余的换行和空格
mdw
smdw
sdw1
sdw2
保存退出

#2.新建只有segment机器配置文件seg_hosts,无多余的换行和空格
vi /tmp/seg_hosts
#里面内容为
sdw1
sdw2
报错退出

3. 启用无密码 SSH

gpadmin用户登录

1. 使用 gpssh-exkeys 打通所有服务器 (Master)
[gpadmin@mdw ~]$ source /greenplum/greenplum-db/greenplum_path.sh
[gpadmin@mdw ~]$ gpssh-exkeys -f /tmp/hostlist

[ERROR]: Failed to ssh to smdw. No ECDSA host key is known for smdw and you have requested strict checking.
Host key verification failed.

[ERROR]: Expected passwordless ssh to host smdw

报错则执行如下操作

2. Enabling Passwordless SSH (免密登录)并创建配置

每个 Greenplum 主机上的gpadmin用户必须能够从集群中的任何主机 SSH 到集群中的任何其他主机,而无需输入密码或密码(称为“无密码 SSH”)

需要切换到gpadmin用户,在所有机器都执行

  • 创建公私钥对 (所有节点)

提示直接敲回车

[root@sdw1 mnt]# su - gpadmi
[gpadmin@mdw ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/gpadmin/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/gpadmin/.ssh/id_rsa.
Your public key has been saved in /home/gpadmin/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:AOhjBL0oiQXlxboc44KB0f79QZuVf80RsA6ll15ue2E gpadmin@mdw
The key's randomart image is:
+---[RSA 2048]----+
|o*.oo        o.  |
|..*...      o o. |
|oO.o  .    + + ..|
|B X    .. o = o. |
|o= * . .S+ . o E.|
|o + . . +   . + =|
| .     . .   . ..|
|        .       .|
|                 |
+----[SHA256]-----+
[gpadmin@mdw ~]$


  • 在集群的每一台使用 ssh-copy-id 命令,把 gpadmin 的 public key 拷到 known_hosts。

例如master机器执行如下,提示需要密码:输入gpadmin用户的密码

cd  ~
ssh-copy-id smdw
ssh-copy-id sdw1
ssh-copy-id sdw2

在这里插入图片描述

例如standby master机器执行如下

ssh-copy-id mdw
ssh-copy-id sdw1
ssh-copy-id sdw2

同理segment机器,输入方式类似,注意主机名非自己即可。

#segment1机器输入
ssh-copy-id mdw
ssh-copy-id smdw
ssh-copy-id sdw2

#segment2机器输入
ssh-copy-id mdw
ssh-copy-id smdw
ssh-copy-id sdw1

最后查看master机器上的/home/gpadmin/.ssh/know_hosts文件内容如下
在这里插入图片描述

3. 验证

gpadmin用户操作,每次连接完成后退出

# 在主机执行
ssh 'smdw'
exit

ssh 'sdw1'
exit

4. gpssh-exkeys打通服务器

切换到gpadmin用户操作

# 执行如下
[gpadmin@mdw ~]$ source /greenplum/greenplum-db/greenplum_path.sh
[gpadmin@mdw ~]$ gpssh-exkeys -f /tmp/hostlist

[STEP 1 of 5] create local ID and authorize on local host
  ... /home/gpadmin/.ssh/id_rsa file exists ... key generation skipped

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

[STEP 3 of 5] retrieving credentials from remote hosts
  ... send to smdw
  ... send to sdw1
  ... send to sdw2

[STEP 4 of 5] determine common authentication file content

[STEP 5 of 5] copy authentication files to all remote hosts
  ... finished key exchange with smdw
  ... finished key exchange with sdw1
  ... finished key exchange with sdw2

[INFO] completed successfully
[gpadmin@mdw ~]$

5. 测试连通性

切换到gpadmin用户,输入命令后,输入pwd

[gpadmin@mdw ~]$ gpssh -f /tmp/hostlist
=>  pwd
[smdw] /home/gpadmin
[sdw2] /home/gpadmin
[sdw1] /home/gpadmin
[ mdw] /home/gpadmin
=> exit

[gpadmin@mdw ~]$

4. 分发安装包到其他服务器

gpadmin用户,仅在master机器操作

# 打包
[gpadmin@mdw greenplum]$ cd /greenplum
[gpadmin@mdw greenplum]$ tar -cf gp6.tar greenplum-db-6.18.2/
[gpadmin@mdw greenplum]$

#分发,等待一会
[gpadmin@mdw greenplum]$ tar -cf gp6.tar greenplum-db-6.18.2/
[gpadmin@mdw greenplum]$ gpscp -f /tmp/hostlist gp6.tar =:/greenplum/
[gpadmin@mdw greenplum]$

#解压安装包,等待一会,建立软连接
# 核心步骤如下
# gpssh -f /tmp/hostlist
# cd /greenplum
# tar -xf gp6.tar
# tar -xf gp6.tar
# ln -s /greenplum/greenplum-db-6.18.2 greenplum-db
# rm gp6.tar

# 执行记录
[gpadmin@mdw greenplum]$ gpssh -f /tmp/hostlist
=> cd /greenplum
[sdw1]
[smdw]
[sdw2]
[ mdw]
=> ls
[sdw1] gp6.tar
[smdw] gp6.tar
[sdw2] gp6.tar
[ mdw] gp6.tar  greenplum-db  greenplum-db-6.18.2
=>  tar -xf gp6.tar
[sdw1]
[smdw]
[sdw2]
[ mdw]
=> ls
[sdw1] gp6.tar  greenplum-db-6.18.2
[smdw] gp6.tar  greenplum-db-6.18.2
[sdw2] gp6.tar  greenplum-db-6.18.2
[ mdw] gp6.tar  greenplum-db  greenplum-db-6.18.2

### 注意此处是绝对路径,否则其他节点的GPHOME路径不对
=>
=> ln -s /greenplum/greenplum-db-6.18.2 greenplum-db
[sdw1]
[smdw]
[sdw2]
[ mdw]
=> ll
[sdw1] total 506272
[sdw1] -rw-rw-r--  1 gpadmin gpadmin 518420480 Jul  2 18:36 gp6.tar
[sdw1] lrwxrwxrwx  1 gpadmin gpadmin        21 Jul  2 18:42 greenplum-db -> ./greenplum-db-6.18.2
[sdw1] drwxr-xr-x 12 gpadmin gpadmin       310 Jul  2 17:00 greenplum-db-6.18.2
[smdw] total 506272
[smdw] -rw-rw-r--  1 gpadmin gpadmin 518420480 Jul  2 18:36 gp6.tar
[smdw] lrwxrwxrwx  1 gpadmin gpadmin        21 Jul  2 18:42 greenplum-db -> ./greenplum-db-6.18.2
[smdw] drwxr-xr-x 12 gpadmin gpadmin       310 Jul  2 17:00 greenplum-db-6.18.2
[sdw2] total 506272
[sdw2] -rw-rw-r--  1 gpadmin gpadmin 518420480 Jul  2 18:36 gp6.tar
[sdw2] lrwxrwxrwx  1 gpadmin gpadmin        21 Jul  2 18:42 greenplum-db -> ./greenplum-db-6.18.2
[sdw2] drwxr-xr-x 12 gpadmin gpadmin       310 Jul  2 17:00 greenplum-db-6.18.2
[ mdw] total 506276
[ mdw] -rw-rw-r--  1 gpadmin gpadmin 518420480 Jul  2 18:35 gp6.tar
[ mdw] lrwxrwxrwx  1 gpadmin gpadmin        30 Jul  2 17:00 greenplum-db -> /greenplum/greenplum-db-6.18.2
[ mdw] drwxr-xr-x 12 gpadmin gpadmin      4096 Jul  2 18:42 greenplum-db-6.18.2
=>
=> rm gp6.tar
[sdw1]
[smdw]
[sdw2]
[ mdw]
=> ll
[sdw1] total 0
[sdw1] lrwxrwxrwx  1 gpadmin gpadmin  21 Jul  2 18:42 greenplum-db -> ./greenplum-db-6.18.2
[sdw1] drwxr-xr-x 12 gpadmin gpadmin 310 Jul  2 17:00 greenplum-db-6.18.2
[smdw] total 0
[smdw] lrwxrwxrwx  1 gpadmin gpadmin  21 Jul  2 18:42 greenplum-db -> ./greenplum-db-6.18.2
[smdw] drwxr-xr-x 12 gpadmin gpadmin 310 Jul  2 17:00 greenplum-db-6.18.2
[sdw2] total 0
[sdw2] lrwxrwxrwx  1 gpadmin gpadmin  21 Jul  2 18:42 greenplum-db -> ./greenplum-db-6.18.2
[sdw2] drwxr-xr-x 12 gpadmin gpadmin 310 Jul  2 17:00 greenplum-db-6.18.2
[ mdw] total 4
[ mdw] lrwxrwxrwx  1 gpadmin gpadmin   30 Jul  2 17:00 greenplum-db -> /greenplum/greenplum-db-6.18.2
[ mdw] drwxr-xr-x 12 gpadmin gpadmin 4096 Jul  2 18:42 greenplum-db-6.18.2
=>
=> exit

[gpadmin@mdw greenplum]$

5. 创建数据存储空间

gpadmin用户,仅在master机器操作

Master 不存储 user data,仅有 system catalog tables 和 system metadata,在Master 创建一个目录。

创建目录,之前已经创建过data目录

# 仅在master节点操作,创建master的目录
[gpadmin@mdw greenplum]$ mkdir -p /data/master
[gpadmin@mdw greenplum]$ chown gpadmin:gpadmin /data/master
# 仅在master节点操作,创建备机上的目录,无目录时初始化会失败
[gpadmin@mdw ~]$ source /greenplum/greenplum-db/greenplum_path.sh
[gpadmin@mdw ~]$ gpssh -h smdw -e 'mkdir -p /data/master'
[smdw] mkdir -p /data/master
[gpadmin@mdw ~]$ gpssh -h smdw -e 'chown gpadmin:gpadmin /data/master'
[smdw] chown gpadmin:gpadmin /data/master
[gpadmin@mdw ~]$
 
# 创建segment机器的目录
[gpadmin@mdw ~]$ gpssh -f /tmp/seg_hosts
=> cd /data
[sdw1]
[sdw2]
=> mkdir -p /data/primary
[sdw1]
[sdw2]
=> mkdir -p /data/mirror
[sdw1]
[sdw2]
=>
=> ll
[sdw1] total 0
[sdw1] drwxrwxr-x 2 gpadmin gpadmin 6 Jul  2 19:32 mirror
[sdw1] drwxrwxr-x 2 gpadmin gpadmin 6 Jul  2 19:24 primary
[sdw2] total 0
[sdw2] drwxrwxr-x 2 gpadmin gpadmin 6 Jul  2 19:32 mirror
[sdw2] drwxrwxr-x 2 gpadmin gpadmin 6 Jul  2 19:24 primary
=>
=> exit

[gpadmin@mdw greenplum]$

  • 或者其他segment创建目录方式,可以使用如下方式(segment目录方式二选一)
# gpadmin用户在master机器上操作

# source /greenplum/greenplum-db/greenplum_path.sh 
# gpssh -f /tmp/seg_hosts -e 'mkdir -p /data/primary'
# gpssh -f /tmp/seg_hosts -e 'mkdir -p /data/mirror'
# gpssh -f /tmp/seg_hosts -e 'chown -R gpadmin /data/*'

6. 创建环境变量配置文件

gpadmin用户,登录每台机器操作

[gpadmin@mdw greenplum]$ cd ~
[gpadmin@mdw ~]$ vi .bash_profile
# 结尾添加如下几行内容

source /greenplum/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/data/master/gpseg-1
export PGPORT=5432
export PGDATABASE=gpdb

保存退出

# 生效环境变量
[gpadmin@mdw ~]$ source .bash_profile

# 若想开机生效,配置到.bashrc中
[gpadmin@mdw ~]$ vi .bashrc
#末尾添加如下内容
source /greenplum/greenplum-db/greenplum_path.sh

# 生效
source .bashrc

.bash_profile
在这里插入图片描述
.bashrc
在这里插入图片描述

7. 初始化配置文件

gpadmin用户仅在master机器操作

模板文件位置:$GPHOME/docs/cli_help/gpconfigs/gpinitsystem_config
拷贝过来修改

[gpadmin@mdw ~]$ cp $GPHOME/docs/cli_help/gpconfigs/gpinitsystem_config /tmp
[gpadmin@mdw ~]$ cd /tmp
[gpadmin@mdw ~]$ vi gpinitsystem_config 

#修改内容如下
ARRAY_NAME="Greenplum"
SEG_PREFIX=gpseg
PORT_BASE=36000
declare -a DATA_DIRECTORY=(/data/primary /data/primary /data/primary /data/primary)

MASTER_HOSTNAME=mdw
MASTER_DIRECTORY=/data/master
MASTER_PORT=5432
TRUSTED_SHELL=ssh
CHECK_POINT_SEGMENTS=8
ENCODING=UNICODE
MIRROR_PORT_BASE=37000
declare -a MIRROR_DATA_DIRECTORY=(/data/mirror /data/mirror /data/mirror /data/mirror)
MACHINE_LIST_FILE=/tmp/seg_hosts

8. 验证系统性能

source /greenplum/greenplum-db/greenplum_path.sh
gpcheckperf -f /tmp/seg_hosts -r N -d /tmp > subnet1.out

9. 数据库初始化

gpadmin用户仅在master机器上执行

在这里插入图片描述

1. 先记录模板,便于后续查问题
[gpadmin@mdw tmp]$ gpinitsystem -c /tmp/gpinitsystem_config -s smdw -S /data/master/ -O /tmp/initcfg_tmplate
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
20220702:22:38:32:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20220702:22:38:32:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Reading Greenplum configuration file /tmp/gpinitsystem_config
20220702:22:38:32:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Locale has not been set in /tmp/gpinitsystem_config, will set to default value
20220702:22:38:32:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Locale set to en_US.utf8
20220702:22:38:32:034286 gpinitsystem:mdw:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20220702:22:38:32:034286 gpinitsystem:mdw:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250
20220702:22:38:32:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, Completed
20220702:22:38:33:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
..
20220702:22:38:33:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Configuring build for standard array
20220702:22:38:33:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, Completed
20220702:22:38:33:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Building primary segment instance array, please wait...
........
20220702:22:38:36:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Building group mirror array type , please wait...
........
20220702:22:38:39:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Checking Master host
20220702:22:38:39:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, please wait...
................
20220702:22:38:51:034286 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, Completed
2. 执行初始化
cd ~
# segment主机,gpinitsystem_config 里面有seg机器信息,无需-h参数
[gpadmin@mdw ~]$ gpinitsystem -c /tmp/gpinitsystem_config -s smdw 
# 提示输入y,开始初始化
Continue with Greenplum creation Yy|Nn (default=N):
> y

在这里插入图片描述
在这里插入图片描述

注意:产生初始化的日志都在/home/gpadmin/gpAdminLogs目录下,出现错误可以查看分析 gpinitsystem_xxxxxxxxx.log

standby 失败或者使用该命令: gpinitstandby -s smdw(未尝试)

3. 环境变量分发

之前已经添加过:source /greenplum/greenplum-db/greenplum_path.sh
下面添加其他内容

su - gpadmin
# 添加到.bash_profile和.bashrc
.bash_profile已经配置过
cat >> /home/gpadmin/.bash_profile << EOF

export LD_PRELOAD=/lib64/libz.so.1 ps
EOF
#添加到.bashrc
cat >> /home/gpadmin/.bashrc << EOF
export MASTER_DATA_DIRECTORY=/data/master/gpseg-1
export PGPORT=5432
export PGDATABASE=gpdb
export LD_PRELOAD=/lib64/libz.so.1 ps
EOF

# 分发到其他机器
cd ~
#scp .bashrc smdw:/home/gpadmin

gpscp -f /tmp/seg_hosts/home/gpadmin/.bash_profile  gpadmin@=:/home/gpadmin/.bash_profile
gpscp -f /tmp/seg_hosts /home/gpadmin/.bashrc gpadmin@=:/home/gpadmin/.bashrc
gpssh -f /tmp/hostlist -e 'source /home/gpadmin/.bash_profile;source /home/gpadmin/.bashrc;'

在这里插入图片描述

10. 库表创建测试

[gpadmin@mdw ~]$ psql -d postgres
#创建库
gpdb=# create database gpdb encoding='UTF8';
CREATE DATABASE
gpdb=# \q

# 输入psql,直接进入gpdb
[gpadmin@mdw ~]$ psql

gpdb=# create table testa(id int,name character varying(10));
NOTICE:  Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'id' as the Greenplum Database data distribution key for this table.
HINT:  The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE
gpdb=# insert into testa values(1,'哈哈哈哈');
INSERT 0 1
gpdb=# select * from testa;
 id |   name
----+----------
  1 | 哈哈哈哈
(1 row)

gpdb=# \l
                               List of databases
   Name    |  Owner  | Encoding |  Collate   |   Ctype    |  Access privileges
-----------+---------+----------+------------+------------+---------------------
 gpdb      | gpadmin | UTF8     | en_US.utf8 | en_US.utf8 |
 postgres  | gpadmin | UTF8     | en_US.utf8 | en_US.utf8 |
 template0 | gpadmin | UTF8     | en_US.utf8 | en_US.utf8 | =c/gpadmin         +
           |         |          |            |            | gpadmin=CTc/gpadmin
 template1 | gpadmin | UTF8     | en_US.utf8 | en_US.utf8 | =c/gpadmin         +
           |         |          |            |            | gpadmin=CTc/gpadmin
(4 rows)

gpdb=#

扩展,若需要修改编码:

update pg_database set encoding = pg_char_to_encoding('UTF8') where datname ='dbname'

11.允许外部工具登录

gpadmin用户操作master服务器

1.修改gpadmin密码
[gpadmin@mdw ~]$ psql -d postgres
psql (9.4.24)
Type "help" for help.

postgres=#  alter role gpadmin with password 'gpadmin';
ALTER ROLE
postgres=#

2.修改pg_hba.conf
[gpadmin@mdw ~]$ vi /data/master/gpseg-1/pg_hba.conf
#添加如下内容
host all gpadmin 0.0.0.0/0 md5

未添加前参数如下
在这里插入图片描述
添加后
在这里插入图片描述

3.修改postgresql.conf
vi /data/master/gpseg-1/postgresql.conf
#修改内容listen_addresses = '*' ,gp6默认为*
gpconfig -c
4.配置文件生效
[gpadmin@mdw ~]$ gpstop -u
20220703:01:54:00:128862 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -u
20220703:01:54:00:128862 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
20220703:01:54:00:128862 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20220703:01:54:00:128862 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20220703:01:54:00:128862 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.18.2 build commit:1242aadf0137d3b26ee42c80e579e78bd7a805c7'
20220703:01:54:00:128862 gpstop:mdw:gpadmin-[INFO]:-Signalling all postmaster processes to reload
..

12. 设置Greenplum数据库时区

gpadmin用户操作master服务器

[gpadmin@mdw ~]$  gpconfig -s TimeZone
[gpadmin@mdw ~]$  gpconfig -c TimeZone -v 'Asia/Shanghai'

# 更改时区后必须重新启动 Greenplum 数据库。该命令gpstop -ra重新启动 Greenplum 数据库。
[gpadmin@mdw ~]$  gpstop -ra

记录
[gpadmin@mdw ~]$  gpconfig -s TimeZone
Values on all segments are consistent
GUC          : TimeZone
Master  value: PRC
Segment value: PRC
[gpadmin@mdw ~]$

[gpadmin@mdw ~]$ gpconfig -c TimeZone -v 'Asia/Shanghai'
20220703:01:55:20:129424 gpconfig:mdw:gpadmin-[INFO]:-completed successfully with parameters '-c TimeZone -v Asia/Shanghai'
[gpadmin@mdw ~]$  gpconfig -s TimeZone
Values on all segments are consistent
GUC          : TimeZone
Master  value: PRC
Segment value: PRC
[gpadmin@mdw ~]$

[gpadmin@mdw ~]$ gpstop -ra
20220703:02:02:01:001604 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -ra
20220703:02:02:01:001604 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
20220703:02:02:01:001604 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20220703:02:02:01:001604 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20220703:02:02:01:001604 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.18.2 build commit:1242aadf0137d3b26ee42c80e579e78bd7a805c7'
20220703:02:02:01:001604 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
20220703:02:02:01:001604 gpstop:mdw:gpadmin-[INFO]:-Master segment instance directory=/data/master/gpseg-1
20220703:02:02:01:001604 gpstop:mdw:gpadmin-[INFO]:-Stopping master segment and waiting for user connections to finish ...
server shutting down
20220703:02:02:02:001604 gpstop:mdw:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20220703:02:02:02:001604 gpstop:mdw:gpadmin-[INFO]:-Terminating processes for segment /data/master/gpseg-1
20220703:02:02:02:001604 gpstop:mdw:gpadmin-[INFO]:-Stopping master standby host smdw mode=fast
20220703:02:02:03:001604 gpstop:mdw:gpadmin-[INFO]:-Successfully shutdown standby process on smdw
20220703:02:02:03:001604 gpstop:mdw:gpadmin-[INFO]:-Targeting dbid [2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15, 8, 16, 9, 17] for shutdown
20220703:02:02:03:001604 gpstop:mdw:gpadmin-[INFO]:-Commencing parallel primary segment instance shutdown, please wait...
20220703:02:02:03:001604 gpstop:mdw:gpadmin-[INFO]:-0.00% of jobs completed
20220703:02:02:08:001604 gpstop:mdw:gpadmin-[INFO]:-100.00% of jobs completed
20220703:02:02:08:001604 gpstop:mdw:gpadmin-[INFO]:-Commencing parallel mirror segment instance shutdown, please wait...
20220703:02:02:08:001604 gpstop:mdw:gpadmin-[INFO]:-0.00% of jobs completed
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-100.00% of jobs completed
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-   Segments stopped successfully      = 16
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-   Segments with errors during stop   = 0
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-Successfully shutdown 16 of 16 segment instances
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover gpmmon process
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-No leftover gpmmon process found
20220703:02:02:09:001604 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes
20220703:02:02:10:001604 gpstop:mdw:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts
20220703:02:02:10:001604 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover shared memory
20220703:02:02:11:001604 gpstop:mdw:gpadmin-[INFO]:-Restarting System...
[gpadmin@mdw ~]$

二. 安装日志

初始化安装日志

注意-S参数的坑,standby情况
/data/master目录命令初始化操作描述
gpinitsystem -c /tmp/gpinitsystem_config -s smdw初始化成功
gpinitsystem -c /tmp/gpinitsystem_config -s smdw -S失败,无法执行
gpinitsystem -c /tmp/gpinitsystem_config -S -s smdw成功,但是无standy
gpinitsystem -c /tmp/gpinitsystem_config -s smdw -S /data/master开始成功,输入y之后提示目录已存在无法初始化
gpinitsystem -c /tmp/gpinitsystem_config -s smdw -S /data/master失败,提示无/data/master目录
初始化日志
[gpadmin@mdw tmp]$ gpinitsystem -c /tmp/gpinitsystem_config -s smdw
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
20220702:23:05:38:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20220702:23:05:38:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Reading Greenplum configuration file /tmp/gpinitsystem_config
20220702:23:05:38:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Locale has not been set in /tmp/gpinitsystem_config, will set to default value
20220702:23:05:38:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Locale set to en_US.utf8
20220702:23:05:38:056479 gpinitsystem:mdw:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20220702:23:05:38:056479 gpinitsystem:mdw:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250
20220702:23:05:39:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, Completed
20220702:23:05:39:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
..
20220702:23:05:39:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Configuring build for standard array
20220702:23:05:39:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, Completed
20220702:23:05:39:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Building primary segment instance array, please wait...
........
20220702:23:05:42:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Building group mirror array type , please wait...
........
20220702:23:05:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Checking Master host
20220702:23:05:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, please wait...
................
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, Completed
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database Creation Parameters
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master Configuration
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master instance name       = Greenplum
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master hostname            = mdw
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master port                = 5432
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master instance dir        = /data/master/gpseg-1
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master LOCALE              = en_US.utf8
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum segment prefix   = gpseg
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master Database            =
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master connections         = 250
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master buffers             = 128000kB
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Segment connections        = 750
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Segment buffers            = 128000kB
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Checkpoint segments        = 8
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Encoding                   = UNICODE
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Postgres param file        = Off
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Initdb to be used          = /greenplum/greenplum-db-6.18.2/bin/initdb
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-GP_LIBRARY_PATH is         = /greenplum/greenplum-db-6.18.2/lib
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-HEAP_CHECKSUM is           = on
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-HBA_HOSTNAMES is           = 0
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Ulimit check               = Passed
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Array host connect type    = Single hostname per node
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [1]      = ::1
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [2]      = 192.168.0.110
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [3]      = fe80::20c:29ff:fe90:bf83
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Standby Master             = smdw
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Number of primary segments = 4
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Standby IP address         = ::1
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Standby IP address         = 192.168.0.113
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Standby IP address         = fe80::20c:29ff:feab:1f84
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Total Database segments    = 8
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Trusted shell              = ssh
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Number segment hosts       = 2
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Mirror port base           = 37000
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Number of mirror segments  = 4
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring config           = ON
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring type             = Group
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:----------------------------------------
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Primary Segment Configuration
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:----------------------------------------
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  36000   sdw1    /data/primary/gpseg0    2
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  36001   sdw1    /data/primary/gpseg1    3
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  36002   sdw1    /data/primary/gpseg2    4
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  36003   sdw1    /data/primary/gpseg3    5
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  36000   sdw2    /data/primary/gpseg4    6
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  36001   sdw2    /data/primary/gpseg5    7
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  36002   sdw2    /data/primary/gpseg6    8
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  36003   sdw2    /data/primary/gpseg7    9
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Mirror Segment Configuration
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  37000   sdw2    /data/mirror/gpseg0     10
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  37001   sdw2    /data/mirror/gpseg1     11
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  37002   sdw2    /data/mirror/gpseg2     12
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  37003   sdw2    /data/mirror/gpseg3     13
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  37000   sdw1    /data/mirror/gpseg4     14
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  37001   sdw1    /data/mirror/gpseg5     15
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  37002   sdw1    /data/mirror/gpseg6     16
20220702:23:05:57:056479 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  37003   sdw1    /data/mirror/gpseg7     17


安装过程中,输入y后的日志
Continue with Greenplum creation Yy|Nn (default=N):
> y
20220702:23:06:19:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Building the Master instance database, please wait...
20220702:23:06:24:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Starting the Master in admin mode
20220702:23:06:25:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing parallel build of primary segment instances
20220702:23:06:25:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
........
20220702:23:06:25:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
...................................
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Parallel process exit status
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as completed           = 8
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as killed              = 0
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as failed              = 0
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Removing back out file
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:-No errors generated from parallel processes
20220702:23:07:02:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Restarting the Greenplum instance in production mode
20220702:23:07:02:061761 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -a -l /home/gpadmin/gpAdminLogs -m -d /data/master/gpseg-1
20220702:23:07:02:061761 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
20220702:23:07:02:061761 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20220702:23:07:02:061761 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20220702:23:07:02:061761 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.18.2 build commit:1242aadf0137d3b26ee42c80e579e78bd7a805c7'
20220702:23:07:02:061761 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
20220702:23:07:02:061761 gpstop:mdw:gpadmin-[INFO]:-Master segment instance directory=/data/master/gpseg-1
20220702:23:07:02:061761 gpstop:mdw:gpadmin-[INFO]:-Stopping master segment and waiting for user connections to finish ...
server shutting down
20220702:23:07:03:061761 gpstop:mdw:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20220702:23:07:03:061761 gpstop:mdw:gpadmin-[INFO]:-Terminating processes for segment /data/master/gpseg-1
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -a -l /home/gpadmin/gpAdminLogs -d /data/master/gpseg-1
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.18.2 build commit:1242aadf0137d3b26ee42c80e579e78bd7a805c7'
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232'
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance in admin mode
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Setting new master era
20220702:23:07:03:061785 gpstart:mdw:gpadmin-[INFO]:-Master Started...
20220702:23:07:04:061785 gpstart:mdw:gpadmin-[INFO]:-Shutting down master
20220702:23:07:04:061785 gpstart:mdw:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
.
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-Process results...
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-   Successful segment starts                                            = 8
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-Successfully started 8 of 8 segment instances
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:23:07:05:061785 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /data/master/gpseg-1
20220702:23:07:06:061785 gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
20220702:23:07:06:061785 gpstart:mdw:gpadmin-[INFO]:-Connecting to dbname='template1' connect_timeout=15
20220702:23:07:06:061785 gpstart:mdw:gpadmin-[INFO]:-No standby master configured.  skipping...
20220702:23:07:06:061785 gpstart:mdw:gpadmin-[INFO]:-Database successfully started
20220702:23:07:06:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Completed restart of Greenplum instance in production mode
20220702:23:07:06:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances
20220702:23:07:06:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
........
20220702:23:07:06:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
.....................................
20220702:23:07:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:23:07:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Parallel process exit status
20220702:23:07:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:23:07:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as completed           = 8
20220702:23:07:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as killed              = 0
20220702:23:07:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as failed              = 0
20220702:23:07:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:23:07:45:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Starting initialization of standby master smdw
20220702:23:07:45:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Validating environment and parameters for standby initialization...
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Checking for data directory /data/master/gpseg-1 on smdw
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:------------------------------------------------------
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Greenplum standby master initialization parameters
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:------------------------------------------------------
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Greenplum master hostname               = mdw
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Greenplum master data directory         = /data/master/gpseg-1
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Greenplum master port                   = 5432
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Greenplum standby master hostname       = smdw
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Greenplum standby master port           = 5432
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Greenplum standby master data directory = /data/master/gpseg-1
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Greenplum update system catalog         = On
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Syncing Greenplum Database extensions to standby
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-The packages on smdw are consistent.
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Adding standby master to catalog...
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Database catalog updated successfully.
20220702:23:07:46:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Updating pg_hba.conf file...
20220702:23:07:50:063699 gpinitstandby:mdw:gpadmin-[INFO]:-pg_hba.conf files updated successfully.
20220702:23:08:00:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Starting standby master
20220702:23:08:00:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Checking if standby master is running on host: smdw  in directory: /data/master/gpseg-1
20220702:23:08:04:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Cleaning up pg_hba.conf backup files...
20220702:23:08:05:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Backup files of pg_hba.conf cleaned up successfully.
20220702:23:08:05:063699 gpinitstandby:mdw:gpadmin-[INFO]:-Successfully created standby master on smdw
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Successfully completed standby master initialization
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Scanning utility log file for any warning messages
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[WARN]:-*******************************************************
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[WARN]:-Scan of log file indicates that some warnings or errors
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[WARN]:-were generated during the array creation
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Please review contents of log file
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-/home/gpadmin/gpAdminLogs/gpinitsystem_20220702.log
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-To determine level of criticality
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-These messages could be from a previous run of the utility
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-that was called today!
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[WARN]:-*******************************************************
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database instance successfully created
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-To complete the environment configuration, please
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-update gpadmin .bashrc file with the following
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-1. Ensure that the greenplum_path.sh file is sourced
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-2. Add "export MASTER_DATA_DIRECTORY=/data/master/gpseg-1"
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-   to access the Greenplum scripts for this instance:
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-   or, use -d /data/master/gpseg-1 option for the Greenplum scripts
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-   Example gpstate -d /data/master/gpseg-1
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Script log file = /home/gpadmin/gpAdminLogs/gpinitsystem_20220702.log
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-To remove instance, run gpdeletesystem utility
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Standby Master smdw has been configured
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-To activate the Standby Master Segment in the event of Master
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-failure review options for gpactivatestandby
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-The Master /data/master/gpseg-1/pg_hba.conf post gpinitsystem
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-has been configured to allow all hosts within this new
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-array to intercommunicate. Any hosts external to this
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-new array must be explicitly added to this file
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-Refer to the Greenplum Admin support guide which is
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-located in the /greenplum/greenplum-db-6.18.2/docs directory
20220702:23:08:05:056479 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------

三. 补充

失败回退

bash /home/greenplum/gpAdminLogs/backout_gpinitsystem_gpadmin_* 

清理

pg_ctl -D /greenplum/data/master/gpseg-1 stop
rm -f /tmp/.s.PGSQL.5432 /tmp/.s.PGSQL.5432.lock
rm -Rf /greenplum/data/master/gpseg-1

#删除segment所有的primary/mirror下的目录

gpssh -f /tmp/tmp/seg_hosts

cd /data/primary
rm -r gp*
cd /data/mirror
rm -r gp*

exit

检查

cat /home/gpadmin/gpAdminLogs/gpinitsystem_xxxx.log|grep -E -i 'WARN|ERROR]'

四. 问题记录,初始化standby 未启动

该条命令执行报错
gpinitsystem -c /tmp/gpinitsystem_config -s smdw -S

该条命令执行成功但是日志如下,standy未启动。
gpinitsystem -c /tmp/gpinitsystem_config -S -s smdw 
错误的安装日志,无standby
[gpadmin@mdw tmp]$ gpinitsystem -c /tmp/gpinitsystem_config -S -s smdw
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Reading Greenplum configuration file /tmp/gpinitsystem_config
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Locale has not been set in /tmp/gpinitsystem_config, will set to default value
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Locale set to en_US.utf8
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, Completed
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
..
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Configuring build for standard array
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, Completed
20220702:21:03:34:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Building primary segment instance array, please wait...
........
20220702:21:03:37:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Building group mirror array type , please wait...
........
20220702:21:03:41:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Checking Master host
20220702:21:03:41:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, please wait...
................
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, Completed
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database Creation Parameters
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master Configuration
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master instance name       = Greenplum
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master hostname            = mdw
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master port                = 5432
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master instance dir        = /data/master/gpseg-1
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master LOCALE              = en_US.utf8
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum segment prefix   = gpseg
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master Database            =
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master connections         = 250
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master buffers             = 128000kB
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Segment connections        = 750
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Segment buffers            = 128000kB
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Checkpoint segments        = 8
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Encoding                   = UNICODE
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Postgres param file        = Off
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Initdb to be used          = /greenplum/greenplum-db-6.18.2/bin/initdb
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-GP_LIBRARY_PATH is         = /greenplum/greenplum-db-6.18.2/lib
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-HEAP_CHECKSUM is           = on
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-HBA_HOSTNAMES is           = 0
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Ulimit check               = Passed
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Array host connect type    = Single hostname per node
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [1]      = ::1
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [2]      = 192.168.0.110
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [3]      = fe80::20c:29ff:fe90:bf83
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Standby Master             = Not Configured
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Number of primary segments = 4
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Total Database segments    = 8
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Trusted shell              = ssh
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Number segment hosts       = 2
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Mirror port base           = 37000
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Number of mirror segments  = 4
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring config           = ON
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring type             = Group
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:----------------------------------------
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Primary Segment Configuration
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:----------------------------------------
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  36000   sdw1    /data/primary/gpseg0    2
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  36001   sdw1    /data/primary/gpseg1    3
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  36002   sdw1    /data/primary/gpseg2    4
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  36003   sdw1    /data/primary/gpseg3    5
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  36000   sdw2    /data/primary/gpseg4    6
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  36001   sdw2    /data/primary/gpseg5    7
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  36002   sdw2    /data/primary/gpseg6    8
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  36003   sdw2    /data/primary/gpseg7    9
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Mirror Segment Configuration
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  37000   sdw2    /data/mirror/gpseg0     10
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  37001   sdw2    /data/mirror/gpseg1     11
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  37002   sdw2    /data/mirror/gpseg2     12
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  37003   sdw2    /data/mirror/gpseg3     13
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  37000   sdw1    /data/mirror/gpseg4     14
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  37001   sdw1    /data/mirror/gpseg5     15
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  37002   sdw1    /data/mirror/gpseg6     16
20220702:21:03:52:114421 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  37003   sdw1    /data/mirror/gpseg7     17

Continue with Greenplum creation Yy|Nn (default=N):
> y
20220702:21:10:32:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Building the Master instance database, please wait...
20220702:21:10:38:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Starting the Master in admin mode
20220702:21:10:39:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing parallel build of primary segment instances
20220702:21:10:39:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
........
20220702:21:10:40:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
.................................................
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Parallel process exit status
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as completed           = 8
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as killed              = 0
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as failed              = 0
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Removing back out file
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:-No errors generated from parallel processes
20220702:21:11:30:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Restarting the Greenplum instance in production mode
20220702:21:11:30:121909 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -a -l /home/gpadmin/gpAdminLogs -m -d /data/master/gpseg-1
20220702:21:11:30:121909 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
20220702:21:11:30:121909 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20220702:21:11:30:121909 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20220702:21:11:30:121909 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.18.2 build commit:1242aadf0137d3b26ee42c80e579e78bd7a805c7'
20220702:21:11:30:121909 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
20220702:21:11:30:121909 gpstop:mdw:gpadmin-[INFO]:-Master segment instance directory=/data/master/gpseg-1
20220702:21:11:30:121909 gpstop:mdw:gpadmin-[INFO]:-Stopping master segment and waiting for user connections to finish ...
server shutting down
20220702:21:11:32:121909 gpstop:mdw:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20220702:21:11:32:121909 gpstop:mdw:gpadmin-[INFO]:-Terminating processes for segment /data/master/gpseg-1
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -a -l /home/gpadmin/gpAdminLogs -d /data/master/gpseg-1
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.18.2 build commit:1242aadf0137d3b26ee42c80e579e78bd7a805c7'
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232'
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance in admin mode
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Setting new master era
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Master Started...
20220702:21:11:32:121938 gpstart:mdw:gpadmin-[INFO]:-Shutting down master
20220702:21:11:33:121938 gpstart:mdw:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
...
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-Process results...
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-   Successful segment starts                                            = 8
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-Successfully started 8 of 8 segment instances
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /data/master/gpseg-1
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-Connecting to dbname='template1' connect_timeout=15
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-No standby master configured.  skipping...
20220702:21:11:37:121938 gpstart:mdw:gpadmin-[INFO]:-Database successfully started
20220702:21:11:37:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Completed restart of Greenplum instance in production mode
20220702:21:11:37:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances
20220702:21:11:37:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
........
20220702:21:11:38:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
find: ‘/greenplum/greenplum-db-6.18.2/greenplum-db-6.18.2’: Too many levels of symbolic links
........................................
20220702:21:12:19:114421 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:21:12:19:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Parallel process exit status
20220702:21:12:19:114421 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:21:12:19:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as completed           = 8
20220702:21:12:19:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as killed              = 0
20220702:21:12:19:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as failed              = 0
20220702:21:12:19:114421 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Scanning utility log file for any warning messages
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Log file scan check passed
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database instance successfully created
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-To complete the environment configuration, please
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-update gpadmin .bashrc file with the following
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-1. Ensure that the greenplum_path.sh file is sourced
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-2. Add "export MASTER_DATA_DIRECTORY=/data/master/gpseg-1"
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-   to access the Greenplum scripts for this instance:
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-   or, use -d /data/master/gpseg-1 option for the Greenplum scripts
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-   Example gpstate -d /data/master/gpseg-1
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Script log file = /home/gpadmin/gpAdminLogs/gpinitsystem_20220702.log
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-To remove instance, run gpdeletesystem utility
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-To initialize a Standby Master Segment for this Greenplum instance
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Review options for gpinitstandby
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-The Master /data/master/gpseg-1/pg_hba.conf post gpinitsystem
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-has been configured to allow all hosts within this new
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-array to intercommunicate. Any hosts external to this
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-new array must be explicitly added to this file
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-Refer to the Greenplum Admin support guide which is
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-located in the /greenplum/greenplum-db-6.18.2/docs directory
20220702:21:12:20:114421 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
[gpadmin@mdw tmp]$
错误信息
................
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, Completed
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database Creation Parameters
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master Configuration
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master instance name       = Greenplum
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master hostname            = mdw
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master port                = 5432
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master instance dir        = /data/master/gpseg-1
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master LOCALE              = en_US.utf8
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum segment prefix   = gpseg
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master Database            =
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master connections         = 250
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master buffers             = 128000kB
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Segment connections        = 750
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Segment buffers            = 128000kB
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Checkpoint segments        = 8
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Encoding                   = UNICODE
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Postgres param file        = Off
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Initdb to be used          = /greenplum/greenplum-db-6.18.2/bin/initdb
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-GP_LIBRARY_PATH is         = /greenplum/greenplum-db-6.18.2/lib
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-HEAP_CHECKSUM is           = on
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-HBA_HOSTNAMES is           = 0
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Ulimit check               = Passed
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Array host connect type    = Single hostname per node
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [1]      = ::1
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [2]      = 192.168.0.110
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [3]      = fe80::20c:29ff:fe90:bf83
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Standby Master             = Not Configured
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Number of primary segments = 4
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Total Database segments    = 8
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Trusted shell              = ssh
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Number segment hosts       = 2
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Mirror port base           = 37000
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Number of mirror segments  = 4
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring config           = ON
20220702:22:30:45:029305 gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring type             = Group

错误安装状态信息
[gpadmin@mdw tmp]$ gpstate -a
20220702:21:34:06:001098 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -a
20220702:21:34:06:001098 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 6.18.2 build commit:1242aadf0137d3b26ee42c80e579e78bd7a805c7'
20220702:21:34:06:001098 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 9.4.24 (Greenplum Database 6.18.2 build commit:1242aadf0137d3b26ee42c80e579e78bd7a805c7) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Nov 10 2021 00:05:30'
20220702:21:34:06:001098 gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20220702:21:34:06:001098 gpstate:mdw:gpadmin-[INFO]:-Gathering data from segments...
................
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-Greenplum instance status summary
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Master instance                                           = Active
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Master standby                                            = No master standby configured
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total segment instance count from metadata                = 16
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Primary Segment Status
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total primary segments                                    = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total primary segment valid (at master)                   = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total primary segment failures (at master)                = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid files missing              = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid files found                = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs missing               = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs found                 = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of /tmp lock files missing                   = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of /tmp lock files found                     = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number postmaster processes missing                 = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number postmaster processes found                   = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Mirror Segment Status
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total mirror segments                                     = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total mirror segment valid (at master)                    = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total mirror segment failures (at master)                 = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid files missing              = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid files found                = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs missing               = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of postmaster.pid PIDs found                 = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of /tmp lock files missing                   = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number of /tmp lock files found                     = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number postmaster processes missing                 = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number postmaster processes found                   = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number mirror segments acting as primary segments   = 0
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-   Total number mirror segments acting as mirror segments    = 8
20220702:21:34:23:001098 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
[gpadmin@mdw tmp]$

五. 集群信息查看

#查看mirror的状态
gpstate -e
#查看standby master的状态
gpstate -f
#查看整个GP群集的状态
gpstate -s
#查看GP的版本 
gpstate -i
#帮助文档
gpstate --help

六. 集群重新安装

强制清除master,segment所有的数据目录

gpdeletesystem -d /data/master/gpseg-1 -f
 $ gpdeletesystem -f
 gpdeletesystem:dw1:gpadmin-[INFO]:-Option -d or --master-data-directory not set. Checking environment variable MASTER_DATA_DIRECTORY
 gpdeletesystem:dw1:gpadmin-[INFO]:-Checking for database dump files...
 gpdeletesystem:dw1:gpadmin-[INFO]:-Getting segment information...
 gpdeletesystem:dw1:gpadmin-[INFO]:-Greenplum Instance Deletion Parameters
 gpdeletesystem:dw1:gpadmin-[INFO]:---------------------------------------
 gpdeletesystem:dw1:gpadmin-[INFO]:-Greenplum Master hostname                  = localhost
 gpdeletesystem:dw1:gpadmin-[INFO]:-Greenplum Master data directory            = /data/master/gpseg-1
 gpdeletesystem:dw1:gpadmin-[INFO]:-Greenplum Master port                      = 5432
 gpdeletesystem:dw1:gpadmin-[INFO]:-Greenplum Force delete of dump files       = ON
 gpdeletesystem:dw1:gpadmin-[INFO]:-Batch size                                 = 32
 gpdeletesystem:dw1:gpadmin-[INFO]:---------------------------------------
 gpdeletesystem:dw1:gpadmin-[INFO]:- Segment Instance List 
 gpdeletesystem:dw1:gpadmin-[INFO]:---------------------------------------
 gpdeletesystem:dw1:gpadmin-[INFO]:-Host:Datadir:Port
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw1:/data/master/gpseg-1:5432
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw2:/data/primary/gpseg0:36000
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw3:/data/mirror/gpseg0:37000
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw2:/data/primary/gpseg1:36001
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw3:/data/mirror/gpseg1:37001
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw3:/data/primary/gpseg2:36000
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw2:/data/mirror/gpseg2:37000
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw3:/data/primary/gpseg3:36001
 gpdeletesystem:dw1:gpadmin-[INFO]:-dw2:/data/mirror/gpseg3:37001


Continue with Greenplum instance deletion? Yy|Nn (default=N):
> y
 gpdeletesystem:dw1:gpadmin-[INFO]:-FINAL WARNING, you are about to delete the Greenplum instance
 gpdeletesystem:dw1:gpadmin-[INFO]:-on master host localhost.

删完修改配置信息

vi /tmp/gpinitsystem_config
gpinitsystem -c /tmp/gpinitsystem_config -D

#重新修改配置
vi /data/master/gpseg-1/pg_hba.conf
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐