GreenPlum数据库安装系列第二篇:非mirror模式Segment节点软件安装
Jan122016
上一篇文章记录了GreenPlum数据库的Master在非Mirror模式的安装过程(详见GreenPlum数据库安装系列第一篇:非mirror模式Master软件安装),本文简要记录NO Mirror模式GreenPlum的Segment节点软件安装过程,不涉及数据库初始化内容。本实验操作系统为OEL 6.5,GPDB版本为4.3.6.2。
1.系统设置
1.1编辑节点信息文件(仅Master节点)
为了管理方便,在app目录下创建config文件夹,将节点信息文件存放在该目录下。需要创建两个文件,其中一个文件(hostlist)存放所有节点信息,seg_host文件只存放segment节点信息。
[gpadmin@mdw app]$ mkdir config [gpadmin@mdw app]$ cd config/ [gpadmin@mdw config]$ vi hostlist mdw sdw1 sdw2 sdw3 [gpadmin@mdw config]$ vi seg_host sdw1 sdw2 sdw3
1.2打通所有节点直接的互信(仅Master节点)
GreenPlum数据库提供gpssh-exkeys工具来打开所有节点直接的互信关系,非常方便。
[gpadmin@mdw config]$ gpssh-exkeys -f 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] authorize current user on remote hosts ... send to sdw1 *** *** Enter password for sdw1: --此处需要输入sdw1节点的gpadmin用户的密码,如果所有节点密码一致,输入一次即可。 ... send to sdw2 ... send to sdw3 [STEP 4 of 5] determine common authentication file content [STEP 5 of 5] copy authentication files to all remote hosts ... finished key exchange with sdw1 ... finished key exchange with sdw2 ... finished key exchange with sdw3 [INFO] completed successfully
互信配置完成后,可以通过gpssh工具来验证互信是否成功配置,-e参数后面的是远程登录节点后执行的命令。通过gpssh工具可以在所有节点运行同一命令,非常方便(后续会用到)。
[gpadmin@mdw config]$ gpssh -f hostlist -e pwd [sdw2] pwd [sdw2] /home/gpadmin [sdw1] pwd [sdw1] /home/gpadmin [ mdw] pwd [ mdw] /home/gpadmin [sdw3] pwd [sdw3] /home/gpadmin
2.Segment节点安装GreenPlum软件(仅Master节点)
通过gpseginstall命令安装segment软件,使用-u参数指定安装用户,-p参数指定安装用户的密码,这样将不再需要交互式输入密码。
[gpadmin@mdw config]$ gpseginstall -f hostlist -u gpadmin -p padmin 20160113:09:58:32:025688 gpseginstall:mdw:gpadmin-[INFO]:-Installation Info: link_name greenplum-db binary_path /gpdb/app binary_dir_location /gpdb binary_dir_name app 20160113:09:58:32:025688 gpseginstall:mdw:gpadmin-[INFO]:-check cluster password access 20160113:09:58:33:025688 gpseginstall:mdw:gpadmin-[INFO]:-de-duplicate hostnames 20160113:09:58:33:025688 gpseginstall:mdw:gpadmin-[INFO]:-master hostname: mdw 20160113:09:58:34:025688 gpseginstall:mdw:gpadmin-[INFO]:-rm -f /gpdb/app.tar; rm -f /gpdb/app.tar.gz 20160113:09:58:34:025688 gpseginstall:mdw:gpadmin-[INFO]:-cd /gpdb; tar cf app.tar app 20160113:09:58:35:025688 gpseginstall:mdw:gpadmin-[INFO]:-gzip /gpdb/app.tar 20160113:09:58:55:025688 gpseginstall:mdw:gpadmin-[INFO]:-remote command: mkdir -p /gpdb 20160113:09:58:56:025688 gpseginstall:mdw:gpadmin-[INFO]:-remote command: rm -rf /gpdb/app 20160113:09:58:56:025688 gpseginstall:mdw:gpadmin-[INFO]:-scp software to remote location 20160113:09:58:58:025688 gpseginstall:mdw:gpadmin-[INFO]:-remote command: gzip -f -d /gpdb/app.tar.gz 20160113:09:59:06:025688 gpseginstall:mdw:gpadmin-[INFO]:-md5 check on remote location 20160113:09:59:07:025688 gpseginstall:mdw:gpadmin-[INFO]:-remote command: cd /gpdb; tar xf app.tar 20160113:09:59:12:025688 gpseginstall:mdw:gpadmin-[INFO]:-remote command: rm -f /gpdb/app.tar 20160113:09:59:26:025688 gpseginstall:mdw:gpadmin-[INFO]:-remote command: cd /gpdb; rm -f greenplum-db; ln -fs app greenplum-db 20160113:09:59:27:025688 gpseginstall:mdw:gpadmin-[INFO]:-rm -f /gpdb/app.tar.gz 20160113:09:59:27:025688 gpseginstall:mdw:gpadmin-[INFO]:-version string on master: gpssh version 4.3.6.2 build 1 20160113:09:59:27:025688 gpseginstall:mdw:gpadmin-[INFO]:-remote command: . /gpdb/greenplum-db/./greenplum_path.sh; /gpdb/greenplum- db/./bin/gpssh --version 20160113:09:59:27:025688 gpseginstall:mdw:gpadmin-[INFO]:-remote command: . /gpdb/app/greenplum_path.sh; /gpdb/app/bin/gpssh --version 20160113:09:59:33:025688 gpseginstall:mdw:gpadmin-[INFO]:-SUCCESS -- Requested commands completed
Segment节点会根据Master节点的安装路径安装GreenPlum软件,目录结构和Master一模一样。
3.Segment节点配置环境变量(所有Segment节点)
[gpadmin@sdw1 app]$ vi /home/gpadmin/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH source /gpdb/app/greenplum_path.sh
通过下面的命令使之生效。
[gpadmin@sdw1 app]$ . /home/gpadmin/.bash_profile
至此Segment节点的GreenPlum软件安装完成。