Greenplum详细安装

2026/4/29 11:44:46

杭州斯凯网络科技有限公司

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主机上编辑/etc/sysctl.conf文件,替换或新增以下参数,重启: kernel.shmmax = 500000000 kernel.shmmni = 4096 kernel.shmall = 4000000000 kernel.sem = 250 64000 100 512 net.ipv4.tcp_tw_recycle=1

net.ipv4.tcp_max_syn_backlog=4096 net.core.netdev_max_backlog=10000 vm.overcommit_memory=2

net.ipv4.ip_local_port_range = 1025 65535 --文档上没有,新增的

在各台主机上同样编辑/etc/security/limits.conf

* 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

# 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=`(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=`(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. 建立主机文件阵列

2.

3. 交流

以root用户先在master上建立一个包含所有(master,segment,backup master)主机名的文件如下:

[root@local_master ~]# cat /etc/all_hosts local_master local_segment

修改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 # that require network functionality will fail.

127.0.0.1 localhost.localdomain localhost 192.168.224.128 local_master 192.168.224.131 local_segment

建立信任的主机环境,在master上以root用户登录,初始化参数 # source /opt/greenplum-db-3.3.6.1/greenplum_path.sh

测试master与segment的连接,采用Gp自带的包,测试过程如下: [root@local_master ~]# gpssh-exkeys -f /etc/all_hosts

[STEP 1 of 5] create local ID and authorize on local host ... /root/.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 local_segment ***

*** Enter password for local_segment:

[STEP 4 of 5] determine common authentication file content [STEP 5 of 5] copy authentication files to all remote hosts ... finished key exchange with local_segment [INFO] completed successfully

期间会要求输入segment端root用户的密码,该过程主要是check远程的segment主机以及验证两个主机间的通信顺畅。

在mastert主机上创建segment主机名文件,在远程segment主机上上创建

gpadmin用户,以root身份

[root@local_segment etc]# cat /etc/all_segment_hosts


Greenplum详细安装.doc 将本文的Word文档下载到电脑
搜索更多关于: Greenplum详细安装 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219