centos7单机安装Greenplum6.2.1
一、环境准备:
操作系统:CentOS-7-x86_64-Minimal-1810.iso
数据库:greenplum-db-6.2.1-rhel7-x86_64.rpm
集群配置:1 master,1 primary segment , 1个mirror segment
二、安装linux系统后配置
2.1 基本配置
关闭防火墙: systemctl stop firewalld 禁止防火墙开机启动: systemctl disable firewalld 修改主机名: hostnamectl set-hostname master 配置主机域名:/etc/hosts 192.168.111.111 master 关闭selinux:/etc/selinux/config SELINUX=disabled
2.2 修改内核:/etc/sysctl.conf
net.ipv4.ip_forward = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_max_syn_backlog = 4096 net.ipv4.conf.all.arp_filter = 1 net.ipv4.ip_local_port_range = 1025 65535 net.core.netdev_max_backlog= 10000 net.core.rmem_max = 2097152 net.core.wmem_max = 2097152 net.core.somaxconn = 2048 kernel.sysrq = 1 kernel.core_uses_pid = 1 kernel.msgmni = 2048 kernel.msgmax = 65536 kernel.msgmnb = 65536 kernel.shmmni = 4096 kernel.shmmax = 500000000 kernel.shmall = 4000000000 kernel.sem = 250 64000 100 512 vm.overcommit_memory = 2
2.3 修改文件描述符文件:/etc/security/limits.conf
* soft nofile 65536 * hard nofile 65536 * soft nproc 131072 * hard nproc 131072
三、安装数据库
3.1 安装命令:
rpm -Uvh greenplum-db-6.2.1-rhel7-x86_64.rpm
3.2 创建gpadmin用户并授权:
useradd gpadmin passwd gpadmin
chown -R gpadmin /usr/local/greenplum*
chgrp -R gpadmin /usr/local/greenplum*
3.3 切换到gpadmin用户,并创建数据目录:
mkdir -p /data/gpdata/master mkdir -p /data/gpdata/primary
mkdir -p /data/gpdata/mirror
3.4 设置gpadmin用户的环境变量:.bash_profile和.bashrc
source /usr/local/greenplum-db/greenplum_path.sh export MASTER_DATA_DIRECTORY=/data/gpdata/master/gpseg-1 export PGPORT=5432 export PGUSER=gpadmin export PGDATABASE=gpdb 使环境变量生效: source .bash_profile .bashrc
3.5 添加节点服务器文件(本例是单机,故只需要写一个):/home/gpadmin/seg_hosts
master
3.6 设置ssh免密:
ssh-keygen ssh-copy-id master
gpssh-exkeys -f /home/gpadmin/seg_hosts
四、初始化数据库
4.1 复制配置文件
cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config /home/gpadmin/initGreenplum
4.2 编辑配置文件 /home/gpadmin/gpinit ,修改下面内容:
declare -a DATA_DIRECTORY=(/data/gpdata/primary) MASTER_HOSTNAME=master MASTER_DIRECTORY=/data/gpdata/master MASTER_PORT=5432
MIRROR_PORT_BASE=7000 DATABASE_NAME=gpdb declare -a MIRROR_DATA_DIRECTORY=(/data/gpdata/mirror) MACHINE_LIST_FILE=/home/gpadmin/seg_hosts
4.3 运行初始化命令
gpinitsystem -c /home/gpadmin/initGreenplum