Greenplum 安装部署 单机版安装(Linux)


1. 安装准备

greenplum 安装包: 官网选择版本下载即可
greenplum-db-6.1.0-rhel7-x86_64.rpm

将安装包放入到安装环境

2. 环境配置

.防火墙,selinux 都已关闭

修改/etc/sysctl.conf
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

 

.修改/etc/security/limits.conf

* soft nofile 524288
* hard nofile 524288
* soft nproc 131072
* hard nproc 131072


.添加用户

# groupadd gpadmin
# useradd gpadmin -r -m -g gpadmin


3. 安装

rpm  -ivh  greenplum-db-6.1.0-rhel7-x86_64.rpm

#默认安装到/usr/local,进行授权操作

chown -R gpadmin:gpadmin /usr/local/greenplum*

#设置变量
source /usr/local/greenplum-db-6.1.0/greenplum_path.sh

创建目录,并授权gpadmin

mkdir /home/gpdata
mkdir /home/gpdata/master
mkdir /home/gpdata/gp1
mkdir /home/gpdata/gp2

chown -R gpadmin:gpadmin /home/gpdata/

创建目录,并授权gpadmin

mkdir  /home/gpadmin/gpconfigs

cd /home/gpadmin/gpconfigs

vim all_hosts
hostname #安装机器的名称

保存

vim all_segs
hostname #安装机器的名称


保存

4. 修改环境变量 (gpadmin )

cd 
vim .bash_profile

添加
source /usr/local/greenplum-db-6.1.0/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/home/gpdata/master/gpseg-1
export PGPORT=5432
export PGUSER=gpadmin
export PGDATABASE=hdw

保存后执行 source /home/gpadmin/.bash_profile

vim .bashrc
添加:
source /usr/local/greenplum-db-6.1.0/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/home/gpdata/master/gpseg-1
export PGPORT=5432
export PGUSER=gpadmin
export PGDATABASE=hdw

保存后执行 source /home/gpadmin/.bashrc

执行:

gpssh-exkeys -f /home/gpadmin/gpconfigs/all_hosts

复制配置文件:
cp /usr/local/greenplum-db-6.1.0/docs/cli_help/gpconfigs/gpinitsystem_config  /home/gpadmin/gpconfigs

vim /home/gpadmin/gpconfigs/gpinitsystem_config

declare -a DATA_DIRECTORY=(/home/gpdata/gp1 /home/gpdata/gp2)
MASTER_HOSTNAME=pear-edge-03
MASTER_DIRECTORY=/data/master
MASTER_PORT=5432
DATABASE_NAME=hdw
MACHINE_LIST_FILE=/home/gpadmin/gpconfigs/all_segs

修改后保存

5. 运行
gpinitsystem -c /home/gpadmin/gpconfigs/gpinitsystem_config

系统开始初始化,之后会看到如下提示:

Continue with Greenplum creation Yy/Nn>

输入 Y ,按回车,系统会初始化完成

登录:
psql -d hdw

相关命令:

gpstart #正常启动

gpstop #正常关闭

gpstop -M fast #快速关闭

gpstop –r #重启

你可能感兴趣的:(Greenplum 安装部署 单机版安装(Linux))