环境准备
3个节点,每个节点8核、32G内存、1TB硬盘
对应ip和角色划分为:
#主master 192.168.31.101 gp1
#从master,4个主segment 4个从segment 192.168.31.102 gp2
#4个主segment 4个从segment 192.168.31.103 gp3
下载GP6
地址:https://github.com/greenplum-db/gpdb/releases
设置host和防火墙
在每个节点上,设置host,并修改hosts文件,执行:
hostnamectl set-hostname gp1
cat >> /etc/hosts <<EOF 192.168.31.101 gp1 192.168.31.102 gp2 192.168.31.103 gp3 EOF
在每个节点上,设置防火墙,执行:
firewall-cmd --permanent --zone=trusted --add-source=192.168.31.101 firewall-cmd --permanent --zone=trusted --add-source=192.168.31.102 firewall-cmd --permanent --zone=trusted --add-source=192.168.31.103
新建gpadmin用户并配置免登录
在每个节点上,执行:
groupadd gpadmin && useradd -g gpadmin gpadmin && echo "gpadmin" | passwd --stdin gpadmin
在gp1节点上,执行:
su gpadmin
ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa ssh-copy-id gp1 ssh-copy-id gp2 ssh-copy-id gp3
修改内核配置
在每个节点上,执行:
cat >> /etc/sysctl.conf << EOF # kernel.shmall = _PHYS_PAGES / 2 # See Shared Memory Pages kernel.shmall = 197951838 # kernel.shmmax = kernel.shmall * PAGE_SIZE kernel.shmmax = 810810728448 kernel.shmmni = 4096 vm.overcommit_memory = 2 # See Segment Host Memory vm.overcommit_ratio = 95 # See Segment Host Memory net.ipv4.ip_local_port_range = 10000 65535 # See Port Settings kernel.sem = 250 2048000 200 8192 kernel.sysrq = 1 kernel.core_uses_pid = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.msgmni = 2048 net.ipv4.tcp_syncookies = 1 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.tcp_max_syn_backlog = 4096 net.ipv4.conf.all.arp_filter = 1 net.ipv4.ipfrag_high_thresh = 41943040 net.ipv4.ipfrag_low_thresh = 31457280 net.ipv4.ipfrag_time = 60 net.core.netdev_max_backlog = 10000 net.core.rmem_max = 2097152 net.core.wmem_max = 2097152 vm.swappiness = 10 vm.zone_reclaim_mode = 0 vm.dirty_expire_centisecs = 500 vm.dirty_writeback_centisecs = 100 vm.dirty_background_ratio = 0 # See System Memory vm.dirty_ratio = 0 vm.dirty_background_bytes = 1610612736 vm.dirty_bytes = 4294967296 EOF
修改kernel.sem
echo "kernel.sem = 50100 128256000 50100 2560" >> /etc/sysctl.conf
修改资源限制
cat >> /etc/security/limits.conf <<EOF * soft nofile 524288 * hard nofile 524288 * soft nproc 131072 * hard nproc 131072 EOF
安装GP6
yum update -y yum install vim tree nload wget curl net-tools -y yum install open-source-greenplum-db-6.22.2-rhel7-x86_64.rpm
新建GP初始化文件
cat > /usr/local/greenplum-db/gpinit_config << EOF ARRAY_NAME="Greenplum Data Platform" SEG_PREFIX=gpseg PORT_BASE=10000 # primary端口起始 ### 三个相同的目录表示在一个Segment机器上创建三个Segment实例 ### declare -a DATA_DIRECTORY=(/data/primary /data/primary /data/primary /data/primary) MASTER_HOSTNAME=gp1 MASTER_DIRECTORY=/data/master MASTER_PORT=5432 ### 监听端口 TRUSTED_SHELL=ssh CHECK_POINT_SEGMENTS=8 ENCODING=UNICODE MIRROR_PORT_BASE=11000 ### mirror端口起始 declare -a MIRROR_DATA_DIRECTORY=(/data/mirror /data/mirror /data/mirror /data/mirror) EOF
标签:source,部署,192.168,节点,CentOS7,--,Greenplum6,gpadmin,ssh From: https://www.cnblogs.com/zhangliuliu/p/16932963.html