greenplum4.2集群手把手安装配置文档
1 安装配置1.1.1 软件环境Window Xp 中vm server2.0下创建三个redhat 5.4虚拟机,共享虚拟网卡ip=192.168.66.1181.1.2 硬件资源1.1.3 环境配置操作系统:1.1.4 虚拟机配置类别主机名ip内存硬盘主要目录注释
1 安装配置
1.1.1 软件环境
Window
共享虚拟网卡ip=192.168.66.118
1.1.2 硬件资源
1.1.3 环境配置
操作系统:
1.1.4 虚拟机配置
类别 | 主机名 | ip | 内存 | 硬盘 | 主要目录 | 注释 |
Master | gpmaster | 192.168.66.110 | 256M | 4G | /usr/local | 安装 |
/data/master | 数据 | |||||
segments | gpnode1 | 192.168.66.111 | 256M | 4G | /usr/local | 安装 |
/data/data1/data | 数据 | |||||
segments | gpnode2 | 192.168.66.112 | 256M | 4G | /usr/local | 安装 |
/data/data1/data | 数据 |
1.2 系统参数配置
修改gpmaster和所有gpnode节点,三个节点均进行相同操作
1.2.1 修改内核参数
修改/etc/sysctl.conf ,添加内容
vi
1.2.2 不重启内核参数生效
[root@gpmaster sys]# sysctl -p
kernel.sem = 250 64000 100 512
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.all.arp_filter = 1
net.ipv4.conf.default.arp_filter = 1
net.core.netdev_max_backlog = 10000
vm.overcommit_memory = 2
[root@gpmaster sys]#
1.2.3 设置安全限制参数
在/etc/security/limits.conf中设置
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
1.3 修改主机名和hosts文件
修改完毕后,分别重启生效
1.3.1 修改三个节点/tec/hosts,
u 三个节点内容相同,如下:
Vi
192.168.66.110gpmaster
192.168.66.111gpnode1
192.168.66.112gpnode2
1.3.2 修改主机名
修改192.168.66.110 主机名为gpmaster
vi/etc/sysconfig/network
[root@gpmaster ~]# vi/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=gpmaster
~修改192.168.66.111主机名为gpnode1
vi/etc/sysconfig/network
[root@gpnode1 ~]# vi/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=gpnode1
修改192.168.66.112 主机名为gpmaster
vi/etc/sysconfig/network
[root@gpnode2 ~]# vi/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=gpnode2
修改完毕后,分别重启生效
1.4 三个节点添加用户和组
[root@gpmaster ~]# useradd -ggpadmin gpadmin
[root@gpmaster ~]# passwd gpadmin
Changing password for usergpadmin.
New UNIX password:
BAD PASSWORD: it does notcontain enough DIFFERENT characters
Retype new UNIXpassword:
passwd: all authenticationtokens updated successfully.
[root@gpmaster ~]# passwdgpadmin
Changing password for usergpadmin.
Retype new UNIXpassword:
passwd: all authenticationtokens updated successfully.
[root@gpmaster ~]#
1.5 创建目录
u 三个节点分别创建对应的目录
gpmaster 创建
mkdir –p /data/master
chown -R gpadmin:gpadmin /data
gpnode1 创建
mkdir -p /data/data1/data
mkdir -p /data/data1/mdata
mkdir -p /data/data2/data
mkdir -p /data/data2/mdata
chown -R gpadmin:gpadmin /data
gpnode2 创建
mkdir -p /data/data1/data
mkdir -p /data/data1/mdata
mkdir -p /data/data2/data
mkdir -p /data/data2/mdata
chown -R gpadmin:gpadmin /data
具体过程为:
uGpmaster 创建目录
[root@gpmaster ~]# mkdir /data
[root@gpmaster ~]# cd /data
[root@gpmaster data]# mkdir master
master
[root@gpmaster data]# chown -R gpadmin:gpadmin/data
[root@gpmaster data]# ls -altr
total 16
drwxr-xr-x 25 root
drwxr-xr-x
drwxr-xr-x
[root@gpmaster data]#
uGpnode1创建目录
[root@gpnode1 /]# mkdir /data
[root@gpnode1 /]# cd /data
[root@gpnode1 data]# mkdir ./data
[root@gpnode1 data]# mkdir ./mdata
[root@gpnode1 data]# ls -altr
total 20
drwxr-xr-x 25 root root 4096 Aug 15 14:31 ..
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
[root@gpnode1 data]# chown -R gpadmin:gpadmin/data
[root@gpnode1 data]# ls -altr
total 20
drwxr-xr-x 25 root
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
[root@gpnode1 data]#
uGpnode2创建目录
[root@gpnode2 local]# mkdir /data
[root@gpnode2 local]# cd data
-bash: cd: data: No such file or directory
[root@gpnode2 local]# cd /data
[root@gpnode2 data]# mkdir ./data
[root@gpnode2 data]# mkdir ./mdata
[root@gpnode2 data]# ls
data
[root@gpnode2 data]# ls
data
[root@gpnode2 data]# ls -al
total 20
drwxr-xr-x
drwxr-xr-x 25 root root 4096 Aug 15 14:32 ..
drwxr-xr-x
drwxr-xr-x
[root@gpnode2 data]# chown -R gpadmin:gpadmin/data
1.6 greenplum安装
root用户登录gpmaster进行安装
1.6.1 Master节点解压
将介质上传至/usr/local目录,解压
[root@gpmaster data]# cd /usr/local
[root@gpmaster local]# ls
bin
[root@gpmaster local]# unzipgreenplum-db-4.2.2.4-build-1-CE-RHEL5-i386.zip
Archive:
[root@gpmaster local]#
1.6.2 Master节点安装
[root@gpmaster local]# ls
bin
etc
[root@gpmaster local]# ls -altr
total 84272
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
-rwxr-xr-x
-r--r--r--
drwxr-xr-x
drwxr-xr-x 14 root root
-rw-r--r--
drwxr-xr-x 11 root root
[root@gpmaster local]# bash./greenplum-db-4.2.2.4-build-1-CE-RHEL5-i386.bin
***************************************************************************
You must read and accept the Greenplum Database licenseagreement
before installing
***************************************************************************
EMC GREENPLUM COMMUNITY EDITION
Software License Agreement
IMPORTANT -- PLEASE READ CAREFULLY
This EMC Greenplum Community Edition Software LicenseAgreement (the
"Agreement") is a legal agreement between EMC Corporation,with a principal
office at 176 South Street, Hopkinton, MA 01748 USA ("EMC")and you and the
organization on whose behalf you are accessing this Agreement(the
"Customer") and governs Customer's access to, downloading of,and use of
any and all components, associated media, printed materials,documentation,
and programming accessed via the EMC Greenplum CommunityEdition software
(the "Software").
By clicking on the "Agree" button set forth below, ordownloading,
installing, or using the Software, you are representing toEMC that (i) you
are authorized to legally bind the Customer, and (ii) you areagreeing on
behalf of the Customer that the terms of this Agreement shallgovern the
relationship of the parties with regard to theSoftware.
u
***************************************************************************
Do you accept the Greenplum Database license agreement?[yes|no]
***************************************************************************
yes
If you do not have authority to agree to the terms of thisAgreement, or do
not accept the terms of this Agreement, click on the "Cancel"button or
discontinue your efforts to download the Software, and theregistration,
download and/or installation process will not continue. Insuch event, no
access to, or authorization to download or use the Software,is granted by
EMC.
EMC and Customer enter into this Agreement and this Agreementshall become
effective on the date on which Customer clicks on the "Agree"button
described above or downloads, installs or uses the Software,whichever
occurs first (the "Effective Date").
***************************************************************************
Provide the installation path for Greenplum Database or pressENTER to
accept the default installation path:/usr/local/greenplum-db-4.2.2.4
***************************************************************************
u
u
u
***********************************************************************
[Optional] Provide the path to a previous installation ofGreenplum Database,
or press ENTER to skip this step. e.g./usr/local/greenplum-db-4.1.1.3
This installation step will migrate any Greenplum Databaseextensions from the
provided path to the version currently being installed. Thisstep is optional
and can be run later with:
gppkg --migrate /usr/local/greenplum-db-4.2.2.4
***********************************************************************
Extracting product to/usr/local/greenplum-db-4.2.2.4
Skipping migration of Greenplum Databaseextensions...
***************************************************************************
Installation complete.
Greenplum Database is installed in/usr/local/greenplum-db-4.2.2.4
Greenplum Database documentation is available fordownload
at http://powerlink.emc.com.
***************************************************************************
[root@gpmaster local]# ls
bin
etc
games
[root@gpmaster local]# ls -altr
total 84276
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
-rwxr-xr-x
-r--r--r--
drwxr-xr-x
drwxr-xr-x 14 root root
-rw-r--r--
drwxr-xr-x 11 root root
lrwxrwxrwx
drwxr-xr-x 12 root root
[root@gpmaster local]#
安装完毕后,发现自动创建阮链接greenplum-db,指向greenplum-db-4.2.2.4
1.6.3 将安装目录上传另两个节点
压缩
[root@gpmaster local]# tar
[root@gpmaster local]# ls
bin
etc
[root@gpmaster local]#
分别复制到gpnode1和gpnode2/usr/local目录下
[root@gpmaster local]# scp gp.targpnode1:/usr/local/
gp.tar
[root@gpmaster local]# scp gp.targpnode2:/usr/local/
gp.tar
[root@gpmaster local]#
在gpnode1和gpnode2分别解压,建立软链接
[root@gpnode1 local]# tar -xvf gp.tar
………………….
./greenplum-db-4.2.2.4/share/postgresql/README.gpsnmpd
./greenplum-db-4.2.2.4/greenplum_path.sh
[root@gpnode1 local]# ls
bin
etc
[root@gpnode1 local]# ls -altr
total 166864
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x 14 root root
-rw-r--r--
-rw-r--r--
drwxr-xr-x 11 root root
lrwxrwxrwx
drwxr-xr-x 12 root root
[root@gpmastergpadmin]# cd /usr/local
[root@gpmasterlocal]# ls -altr
total209524
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
-rwxr-xr-x
-r--r--r--
drwxr-xr-x
drwxr-xr-x 14 rootroot
-rw-r--r--
drwxr-xr-x 11 rootroot
lrwxrwxrwx
drwxr-xr-x 12 rootroot
-rw-r--r--
[root@gpmasterlocal]# chown -R gpadmin:gpadmin ./greenplum-db
[root@gpmasterlocal]# ls -altr
total209524
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
-rwxr-xr-x
-r--r--r--
drwxr-xr-x
drwxr-xr-x 14root
-rw-r--r--
drwxr-xr-x 11root
lrwxrwxrwx
drwxr-xr-x 12root
-rw-r--r--
[root@gpmasterlocal]# chown -R gpadmin:gpadmin./greenplum-db-4.2.2.4
[root@gpmasterlocal]# ls -altr
total209524
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
drwxr-xr-x
-rwxr-xr-x
-r--r--r--
drwxr-xr-x
drwxr-xr-x 14root
-rw-r--r--
drwxr-xr-x 11gpadmin gpadmin
lrwxrwxrwx
drwxr-xr-x 12root
-rw-r--r--
[root@gpmasterlocal]#
1.7 节点配置
1.7.1 创建master节点配置文件
Master机:gpadmin登录
vi/home/gpadmin/all_host_file添加以下内容
gpmaster
gpnode1
gpnode2
vi /home/gpadmin/all_segs
gpnode1
gpnode2
1.7.2 设置master节点gpadmin用户环境变量
编辑gpadmin用户的启动文件,在末尾加入greenplum工具路径
vi .bash_profile
source/usr/local/greenplum-db-4.2.2.4/greenplum_path.sh
执行一下:
source/usr/local/greenplum-db-4.2.2.4/greenplum_path.sh
编辑/home/gpadmin/.bashrc
添加 exportMASTER_DATA_DIRECTORY=/data/master/gpseg-1
vi
exportMASTER_DATA_DIRECTORY=/data/master/gpseg-1
然后执行source /home/gpadmin/.bashrc
1.7.3 为安装用户设置各个节点的SSH连接
用greenplum的gpssh-exkeys工具为所有master和segment创建gpadmin用户无需输入密码的信任连接。
[gpadmin@localhost ~]$ gpssh-exkeys -f/home/gpadmin/all_host_file
[STEP 1 of 5] create local ID and authorize on localhost
[STEP 2 of 5] keyscan all hosts and update known_hostsfile
[STEP 3 of 5] authorize current user on remotehosts
[ERROR gpnode2] bad password
[ERROR gpnode2] bad password
[STEP 4 of 5] determine common authentication filecontent
[STEP 5 of 5] copy authentication files to all remotehosts
[INFO] completed successfully
[gpadmin@localhost ~]$
测试各个节点是否畅通
[gpadmin@gpmaster ~]$ls
all_host_file
[gpadmin@gpmaster ~]$ gpssh -f./all_host_file
=> echo$HOSTNAME
[ gpnode1] gpnode1
[ gpnode2] gpnode2
[gpmaster] gpmaster
=>
也可以分别测试
gpssh -h gpmaster
gpssh -h gpnode1
gpssh -h gpnode2
1.7.4 编辑安装配置文件gpinitsystem_config
将/usr/local/greenplum-db-4.2.2.4/docs/cli_help/gpconfigs/gpinitsystem_config
复制到/home/gpadmin下
cp
[gpadmin@gpmaster ~]$ vi gpinitsystem_config
#### Shell utility used to connect to remotehosts.
TRUSTED_SHELL=ssh
#### Maximum log file segments between automatic WALcheckpoints.
CHECK_POINT_SEGMENTS=8
#### Default server-side character set encoding.
ENCODING=UNICODE
################################################
#### OPTIONAL MIRROR PARAMETERS
################################################
#### Base number by which mirror segment portnumbers
#### are calculated.
#MIRROR_PORT_BASE=50000
#### Base number by which primary file replicationport
#### numbers are calculated.
#REPLICATION_PORT_BASE=41000
#### Base number by which mirror file replicationport
#### numbers are calculated.
#MIRROR_REPLICATION_PORT_BASE=51000
#### File system location(s) where mirror segment datadirectories
#### will be created. The number of mirror locations mustequal the
#### number of primary locations as specified inthe
#### DATA_DIRECTORY parameter.
declare - DATA_DIRECTORY=(/data1/data
#declare -a MIRROR_DATA_DIRECTORY=(/data1/mirror/data1/mirror /data1/mirror /data2/mirror /data2/mirror/data2/mirror)
################################################
#### OTHER OPTIONAL PARAMETERS
################################################
#### Create a database of this name afterinitialization.
DATABASE_NAME=gpsun
#### Specify the location of the host address file hereinstead of
#### with the the -h option of gpinitsystem.
#MACHINE_LIST_FILE=/home/gpadmin/gpconfigs/hostfile_gpinitsystem
MACHINE_LIST_FILE=/home/gpadmin/all_segs
"gpinitsystem_config" [readonly] 78L, 2670
1.7.5 同步时钟
[gpadmin@gpmaster ~]$ gpssh -fall_host_file -v -e 'ntpd'
[Reset ...]
[INFO] login gpnode1
[INFO] login gpnode2
[INFO] logingpmaster
[ gpnode1] ntpd
[ gpnode1] bash: ntpd: commandnot found
[ gpnode2] ntpd
[ gpnode2] bash: ntpd: commandnot found
[gpmaster] ntpd
[gpmaster] bash: ntpd: commandnot found
[INFO] completedsuccessfully
[Cleanup...]
[gpadmin@gpmaster~]$
1.7.6 检查下OS配置是否满足需求
[gpadmin@gpmaster ~]$ gpcheckos -fall_host_file
1.7.7 关闭防火墙
三个节点均进行
service iptables stop
chkconfig iptables off
========================================================================================
==本博所有内容均由数据库男本人实际工作环境或模拟操作过程,如有编辑错误或其他问题请和本==
==人留言或联系。发扬互联网精神,一起学习,共同努力,完成由专注到卓越的飞跃。?!?
==QQ:77113981
========================================================================================
更多推荐
所有评论(0)