在每台服务器上均创建软件的安装目录:
mkdir /opt/greenplum
chown -R gpadmin:gpadmin /opt/greenplum
将从官网下载的二进制安装包上传到master节点的/opt/greenplum上,执行如下指令进行安装:
chmod +x greenplum-db-5.8.0-rhel7-x86_64.bin
./greenplum-db-5.8.0-rhel7-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-5.8.0
********************************************************************************
出现上述内容输入:/opt/greenplum/greenplum-db-5.8.0
********************************************************************************
Install Greenplum Database into /opt/greenplum/greenplum-db-5.8.0? [yes|no]
********************************************************************************
出现上述内容输入:yes
********************************************************************************
/opt/greenplum/greenplum-db-5.8.0 does not exist.
Create /opt/greenplum/greenplum-db-5.8.0 ? [yes|no]
(Selecting no will exit the installer)
********************************************************************************
出现上述内容输入:yes
安装成功以后会出现如下内容
[gpadmin@kylin-203-140 greenplum]$ ll
total 176060
lrwxrwxrwx. 1 gpadmin gpadmin 20 Dec 20 13:57 greenplum-db -> ./greenplum-db-5.8.0
drwxrwxr-x. 11 gpadmin gpadmin 4096 Dec 20 13:57 greenplum-db-5.8.0
-rwxr-xr-x. 1 gpadmin gpadmin 180280345 Jun 6 2018 greenplum-db-5.8.0-rhel7-x86_64.bin
创建一个hostlist文件,包含gp集群的所有节点,在/opt/greenplum目录下编辑hostlist文件,添加如下内容:
kylin-203-140
kylin-203-117
kylin-203-122
kylin-203-130
执行如下指令进行配置免密登入:
source /opt/greenplum/greenplum-db/greenplum_path.sh
gpssh-exkeys -f /opt/greenplum/hostlist
看到[INFO] completed successfully内容,就表示配置成功了,测试成不成功也可以通过ssh kylin-203-117进行验证各个服务器之间是否可以实现免密登入。或者使用gp自带的命令进行尝试。
测试免密是否配置成功
[gpadmin@kylin-203-140 greenplum]$ gpssh -f /opt/greenplum/hostlist
=> pwd
[kylin-203-140] /home/gpadmin
[kylin-203-117] /home/gpadmin
[kylin-203-130] /home/gpadmin
[kylin-203-122] /home/gpadmin
=>
创建一个子节点主机列表文件,包含除去master节点外的其他节点的主机列表,放置在/opt/greenplum目录下,编辑文件other_hosts,添加如下内容:
kylin-203-117
kylin-203-122
kylin-203-130
在其他服务器安装gp服务可以通过打包拷贝的方式进行安装部署,而不需要重新执行二进制安装包进行安装,数据拷贝可以通过gpscp命令进行批量拷贝,具体操作如下:
cd /opt/greenplum
tar -cvf gp.5.8.0.tar greenplum-db-5.8.0
gpscp -f /opt/greenplum/other_hosts gp.5.8.0.tar =:/opt/greenplum/
通过执行gpssh命令,可以批量的进行统一处理子节点
[gpadmin@kylin-203-140 greenplum]$ gpssh -f /opt/greenplum/other_hosts
=> cd /opt/greenplum
[kylin-203-130]
[kylin-203-122]
[kylin-203-117]
=> tar -xvf gp.5.8.0.tar
...
=> ln -s ./greenplum-db-5.8.0 greenplum-db
[kylin-203-130]
[kylin-203-117]
[kylin-203-122]
=> ll
[kylin-203-130] total 516264
[kylin-203-130] -rw-rw-r--. 1 gpadmin gpadmin 528650240 Dec 20 14:17 gp.5.8.0.tar
[kylin-203-130] lrwxrwxrwx. 1 gpadmin gpadmin 20 Dec 20 14:24 greenplum-db -> ./greenplum-db-5.8.0
[kylin-203-130] drwxrwxr-x. 11 gpadmin gpadmin 4096 Dec 20 13:57 greenplum-db-5.8.0
[kylin-203-117] total 692328
[kylin-203-117] -rw-rw-r--. 1 gpadmin gpadmin 528650240 Dec 20 14:17 gp.5.8.0.tar
[kylin-203-117] lrwxrwxrwx. 1 gpadmin gpadmin 20 Dec 20 14:24 greenplum-db -> ./greenplum-db-5.8.0
[kylin-203-117] drwxrwxr-x. 11 gpadmin gpadmin 4096 Dec 20 13:57 greenplum-db-5.8.0
[kylin-203-117] -rw-r--r--. 1 gpadmin gpadmin 180280345 Jun 6 2018 greenplum-db-5.8.0-rhel7-x86_64.bin
[kylin-203-122] total 516268
[kylin-203-122] -rw-rw-r--. 1 gpadmin gpadmin 528650240 Dec 20 14:17 gp.5.8.0.tar
[kylin-203-122] lrwxrwxrwx. 1 gpadmin gpadmin 20 Dec 20 14:24 greenplum-db -> ./greenplum-db-5.8.0
[kylin-203-122] drwxrwxr-x. 11 gpadmin gpadmin 4096 Dec 20 13:57 greenplum-db-5.8.0
=> exit
gpssh -f /opt/greenplum/hostlist -v date
gpcheck -f /opt/greenplum/hostlist
#测试整个集群所以服务器的网络io
gpcheckperf -f /opt/greenplum/hostlist -r N -d /tmp
#测试两台服务器之间的网络io
gpcheckperf -r N -h kylin-203-122 -h kylin-203-117 -d /tmp/
测试结果如下显示:
[gpadmin@kylin-203-140 greenplum]$ gpcheckperf -f /opt/greenplum/hostlist -r N -d /tmp
Netperf bisection bandwidth test
kylin-203-140 -> kylin-203-117 = 732.380000
kylin-203-122 -> kylin-203-130 = 714.870000
kylin-203-117 -> kylin-203-140 = 733.890000
kylin-203-130 -> kylin-203-122 = 705.260000
Summary:
sum = 2886.40 MB/sec
min = 705.26 MB/sec
max = 733.89 MB/sec
avg = 721.60 MB/sec
median = 732.38 MB/sec
gpcheckperf -f /opt/greenplum/seg_hosts -d /tmp –v