gpssh -f hostfile_mshosts
=>sudo mkdir /data/greenplum_data/gpmaster
=>sudo chown -R gpadmin.gpadmin /data
=>exit
创建及赋权Segments主机数据存储目录
gpssh -f hostfile_segments
=>sudo mkdir /data/greenplum_data/{primary,mirror}
=>sudo chown -R gpadmin.gpadmin /data
=>exit
批量安装软件(GP)
cd /home/gpadmin/ source /usr/local/greenplum-db/greenplum_path.sh gpseginstall -f hostfile_allhosts -u gpadmin -p gpadmin
设置NTP同步
Yum下载安装NTP服务器,已安装的可以略过
sudo yum install ntp -y
若出现如下报错,可看下一步解决方法
There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.7.13 (r266:84292, Jan 22 2014, 09:37:14) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq
View Code解决方法:
unset PYTHONHOME unset PYTHONPATH unset LD_LIBRARY_PATH
再进行yum安装之后,再修改回来,使得GP能正常使用
source /usr/local/greenplum-db/greenplum_path.sh
注:报错原因:在安装GP集群之后,会在master节点中的环境变量中会增加 PYTHONHOME,PYTHONPATH,LD_LIBRARY_PATH几项,并且会修改原本的path。
补充:LD_LIBRARY_PATH 该环境变量主要用于指定查找共享库(动态链接库)时除了默认路径之外的其他路径。
在每个Segment主机,编辑/etc/ntp.conf文件。设置第一个server参数指向Master主机,第二个server参数指向Standby主机。如下面:
sudo vim /etc/ntp.conf
server gp-master prefer server gp-standby
在Standby主机,编辑/etc/ntp.conf文件。设置第一个server参数指向Master主机,第二个参数指向数据中心的时间服务器。
sudo vim /etc/ntp.conf
server gp-master prefer
在Master主机,使用NTP守护进程同步所有Segment主机的系统时钟。例如,使用gpssh来完成:
gpssh -f hostfile_allhosts -v -e 'ntpd'
输出如下代表成功: