centos|centos 7.x 单机版安装greenplum 6.0
centos 7.x 单机版安装greenplum 6.0
1、部署方式
单机版安装一个master节点,两个segment。
2、服务器信息
VirtualBox 虚拟机
内存:4G
cup核数:2
3、程序包
1) greenplum-db-6.0.0-beta.1-rhel7-x86_64.rpm
2)CentOS-7-x86_64-DVD-1804.ISO
greenplum 6.0下载
https://network.pivotal.io/products/pivotal-gpdb/#/releases/326063/file_groups/1521
文章图片
4、安装过程
1)root用户,关闭防火墙
chkconfig iptables off
systemctl stop firewalld.service
systemctl disable firewalld.service
2)root用户,关闭SELINUX
vim /etc/selinux/config
改为:SELINUX=disabled
3)root用户,修改机器名
hostnamectl set-hostname mdw
4)root用户,修改host
vim /etc/hosts
127.0.0.1mdw localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.8 mdw mdw
192.168.56.8 sdw1 sdw1
192.168.56.8 sdw2 sdw2
5)root用户,创建组和用户
groupadd -g 530 gpadmin
mkdir /home/gpdata
useradd -u 3030 gpadmin -g gpadmin -d /home/gpdata
passwd gpadmin
6)root用户,配置内核
vi /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
vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
7)root用户,上传程序包
chomd +x greenplum-db-6.0.0-beta.1-rhel7-x86_64.rpm
rpm -Uvh greenplum-db-6.0.0-beta.1-rhel7-x86_64.rpm
#默认安装到/usr/local,授权给gpadmin
chown -R gpadmin /usr/local/greenplum*
chgrp -R gpadmin /usr/local/greenplum*
#设置环境变量
source /usr/local/greenplum-db-6.0.0-beta.1/greenplum_path.sh
8)gpadmin用户, 创建目录
su -l gpadmin
mkdir -p /home/gpdata
mkdir -p /home/gpdata/master
mkdir -p /home/gpdata/gp1
mkdir -p /home/gpdata/gp2
9) gpadmin用户,创建all_host和seg_host文件
cd /home/gpadmin
mkdir gpconfigs
cd gpconfigs
vim all_hosts--包含master和segment的全部主机名称
mdw
sdw1
sdw2
vi all_segs--只包含segment的主机名称
sdw1
sdw2
10)gpadmin用户,设置安装用户的环境变量
cd
vim .bash_profile
【centos|centos 7.x 单机版安装greenplum 6.0】source /usr/local/greenplum-db-6.0.0-beta.1/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.0.0-beta.1/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
11)gpadmin用户,为安装用户设置各个节点的SSH连接
gpssh-exkeys -f /home/gpadmin/gpconfigs/all_hosts
[gpadmin@mdw gpconfigs]$ gpssh -h mdw
=> echo $HOSTNAME
[mdw] mdw
=> exit
[gpadmin@mdw gpconfigs]$ gpssh -h sdw1
=> echo $HOSTNAME
[sdw1] mdw
=> exit
[gpadmin@mdw gpconfigs]$ gpssh -h sdw2
=> echo $HOSTNAME
[sdw2] mdw
=> exit
12)gpadmin用户, 编辑安装配置文件gpinitsystem_config
将/data/greenplum-db-4.2.2.0/docs/cli_help/gpconfigs/gpinitsystem_config
复制到/home/gpadmin/gpconfigs
cp /usr/local/greenplum-db-6.0.0-beta.1/docs/cli_help/gpconfigs/gpinitsystem_config
/home/gpadmin/gpconfigs
#修改为下面这行
declare -a DATA_DIRECTORY=(/home/gpdata/gp1 /home/gpdata/gp1)
#### OS-configured hostname or IP address of the master host.
MASTER_HOSTNAME=mdw
#### File system location where the master data directory
#### will be created.
MASTER_DIRECTORY=/data/master
#### Port number for the master instance.
MASTER_PORT=5432
#### Create a database of this name after initialization.
#DATABASE_NAME=name_of_database
#增加,完成greenplum初始化后创建库hdw
DATABASE_NAME=hdw
#### Specify the location of the host address file here instead of
#### with the the -h option of gpinitsystem.
#MACHINE_LIST_FILE=/home/gpadmin/gpconfigs/hostfile_gpinitsystem
#增加
MACHINE_LIST_FILE=/home/gpadmin/gpconfigs/all_segs
13)root用户,修改ssh_config
用root用户修改192.168.153.190上 /etc/ssh/ssh_config
编辑 GSSAPIAuthentication 为no
用gpadin用户,执行初始化greenplum系统的配置文件
[gpadmin@mdw gpconfigs]$ gpinitsystem -c /home/gpadmin/gpconfigs/gpinitsystem_config
安装过程执行。
14)gpadmin用户,安装完成,验证
[gpadmin@mdw gpconfigs]$ psql -d hdw
15)启停命令
gpstart #正常启动
gpstop #正常关闭
gpstop -M fast #快速关闭
gpstop –r #重启
5、问题处理
1) centos自定义安装,GP安装过程中报错,krb5-devel is needed by greenplum-db...
缺少依赖,使用root账号安装依赖项:
sudo yum install -y epel-release
sudo yum install -y apr-devel bison bzip2-devel cmake3 flex gcc gcc-c++ krb5-devel libcurl-devel libevent-devel libkadm5 libyaml-devel libxml2-devel perl-ExtUtils-Embed Python-devel python-paramiko python-pip python-psutil python-setuptools readline-devel xerces-c-devel zlib-devel
推荐阅读
- CentOS7 阿里云镜像配置方法
- Centos6源码编译安装2.4版本http服务步骤
- linux|linux centos7服务器时间同步
- 【每日知识】虚拟机|【每日知识】虚拟机 和 CentOS的安装 & go语言的简单知识2018-06-08
- centos7|centos7 redis安装/集群部署/slots迁移
- CentOS|CentOS 7.2搭建FastDFS 分布式文件系统,实现高可用集群
- CentOS7部署Django项目操作步骤三(uWSGI安装)
- es7.x(6)—minimum_should_match最低匹配度
- CentOS下的Memcahed安装
- nginx简易安装和配置