Greenplum安装
一、 环境准备
VMWARE6.5虚拟机上
Redhat5(虚拟两个32位的redhatOS)
每个虚拟OS的配置512M内存,8G硬盘容量
二、 LINUX准备过程
1. 查看OS的位数,确定GP的版本
#getconf LONG_BIT
#32
2. 上下载32位的Greenplum安装文件greenplum-db-3[1].3.6.1-build-1-RHEL5-i386.zip,大小44M,解压后也差不多44M,里面包含两个文件:一个是安装文件,一个是安装指导
3. 解压命令:# unzip greenplum-db-3[1].3.6.1-build-1-RHEL5-i386.zip
在各台GP主机上编辑/f文件,替换或新增以下参数,重启:
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 64000 100 512
p_tw_recycle=1
p_max_syn_backlog=4096
dev_max_backlog=10000
vm.overcommit_memory=2           
net.ipv4.ip_local_port_range = 1025 65535  --文档上没有,新增的
在各台主机上同样编辑/etc/f
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
三、 软件安装及准备配置
1. 将master主机改名为local_master,segment主机改名为local_segment;
分别修改/etc/hosts为:
Local_master:
127.0.0.1              localhost.localdomain localhost
192.168.224.128        local_master
Local_segment:
127.0.0.1              localhost.localdomain localhost
192.168.224.131        local_segment
/etc/sysconfig/network为:
Local_master:
NETWORKING=yes
NETWORKING_IPV6=no
#HOSTNAME=localhost.localdomain
HOSTNAME=local_master
Local_segment:
NETWORKING=yes
NETWORKING_IPV6=no
#HOSTNAME=localhost.localdomain
HOSTNAME=local_segment
          改完后生效:#service network restart
          改完后查看:# hostname
2. 在master安装GP软件:
#/bin/bash  greenplum-db-3.3.6.1-build-1-RHEL5-i386.bin
然后lience accept yes,安装GP路径:/opt/ greenplum-db-3.3.6.1
安装好了文件夹greenplum-db-3.3.6.1里面会出现以下文件:
bin  demo  docs  etc  ext  greenplum_path.sh  include  lib  LICENSE  sbin  share
        另外外部还会出现一个软链接:
[root@local_master opt]# ls -l
total 12
lrwxrwxrwx  1 root root  22 Apr 19 18:52 greenplum-db -> ./greenplum-db-3.3.6.1
drwxr-xr-x  11 root root 4096 Apr 19 18:52 greenplum-db-3.3.6.1
四、 Master主机配置
1. 新增Greenplum用户并指定密码,在root用户下执行
# useradd gpadmin
# passwd gpadmin
# New password: gpadmin
# Retype new password: gpadmin
2. 创建用户组,把gpadmin用户放入组gpadmin中
# groupadd gpadmin
# usermod -g gpadmin gpadmin
3. 更改所有者,将创建的Greenplum文件用户更换为gpadmin
  chown -R gpadmin greenplum-db-3.3.6.1
chgrp -R gpadmin greenplum-db-3.3.6.1
chown -R gpadmin greenplum-db
chgrp -R gpadmin greenplum-db
4. 配置环境变量
greenplum_path.sh这个文件是用来配置环境变量和安装路径的,具体内容:
# cat /opt/greenplum-db/greenplum_path.sh
GPHOME=/opt/greenplum-db-3.3.6.1
greenplum数据库# Replace with symlink path if it is present and correct
if [ -h ${GPHOME}/../greenplum-db ]; then
    GPHOME_BY_SYMLINK=`(cd ${GPHOME}/../greenplum-db/ && pwd -P)`
    if [ x"${GPHOME_BY_SYMLINK}" = x"${GPHOME}" ]; then
        GPHOME=`(cd ${GPHOME}/../greenplum-db/ && pwd -L)`/.
    fi
    unset GPHOME_BY_SYMLINK
fi
PATH=$GPHOME/bin:$GPHOME/ext/python/bin:$PATH
LD_LIBRARY_PATH=$GPHOME/lib:$GPHOME/ext/python/lib:$LD_LIBRARY_PATH
PYTHONPATH=$GPHOME/lib/python
PYTHONHOME=$GPHOME/ext/python
export GPHOME
export PATH
export LD_LIBRARY_PATH
export PYTHONPATH
export PYTHONHOME
切换到gpadmin用户下,修改.bash_profile文件为
#su gpadmin
#cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
GPHOME=/opt/Greenplum
# Replace with symlink path if it is present and correct
if [ -h ${GPHOME}/../greenplum-db ]; then
    GPHOME_BY_SYMLINK=`(cd ${GPHOME}/../greenplum-db/ && pwd -P)`
    if [ x"${GPHOME_BY_SYMLINK}" = x"${GPHOME}" ]; then
        GPHOME=`(cd ${GPHOME}/../greenplum-db/ && pwd -L)`/.
    fi
    unset GPHOME_BY_SYMLINK
fi
PATH=$GPHOME/bin:$GPHOME/ext/python/bin:$PATH
LD_LIBRARY_PATH=$GPHOME/lib:$GPHOME/ext/python/lib:$LD_LIBRARY_PATH
PYTHONPATH=$GPHOME/lib/python
PYTHONHOME=$GPHOME/ext/python
export GPHOME
export PATH
export LD_LIBRARY_PATH
export PYTHONPATH
export PYTHONHOME
初始化(gpadmin下)
source ./bash_profile
5. 创建master数据文件
以root用户创建master的数据存放路径,该目录只存放系统数据,不会存放其他用户数据,并更改所有者
#mkdir /opt/master_database
#chown  gpadmin  /opt/ master_database
#chgrp  gpadmin  /opt/ master_database
五、 Segment主机配置
1. 建立主机文件阵列
以root用户先在master上建立一个包含所有(master,segment,backup master)主机名的文件
如下:
[root@local_master ~]# cat /etc/all_hosts
local_master
local_segment
2. 修改master的hosts文件
    分别查看虚拟机OS的ip地址,并加入master(选其中的一台)
#ifconfig  -a
inet addr:192.168.224.128    --master
inet addr:192.168.224.131    --segment
以128作为master,修改/etc/hosts文件为
# Do not remove the following line, or various programs

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。