在GP官网,看不到关于最新GP在Centos上的对应版本,就使用RedHat的版本就好了。
前言:
GP的安装大致是这样的,选择一台主机作为Master机,其他作为Segment机。由于没那么多机子,就虚拟机开了三个centos6.6,采用1+2模式。
安装时候,记住 GP可以先在Master机上装好,后续通过在Maser机和Segment机间建立互信(gpssh-exkeys)来进行类似远程安装,通过 gpssh 就可以登录到所有机子上,进行你想要的包括建用户,拷贝安装好的GP,等等一系列操作。 当然,在安装前,有的人会配置下 内核参数、限制参数等等,看你需要。因为我虚拟机,硬件基本达不到官网要求,就舍去这步了。
安装前准备(可选)
1、在Master机的 /etc/sysctl.conf 中添加
[html] view plaincopy
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 512000 100 2048
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
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.ip_local_port_range = 1025 65535
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
vm.overcommit_memory = 2
重启下机子或者 sysctl -p 生效
2、在Master机 /etc/security/limits.conf 添加
[html] view plaincopy
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
!!! 注意,对于RedHat 6.x和Centos6.x的机子,在/etc/security/limits.d/90-nproc.conf 的参数会覆盖上述文件参数。如果这两个文件都设置参数,保证参数在90-nproc.conf设置好了。
3、关闭防火墙
chkconfig iptables off ;//永久关闭,重启后不启动
service iptables stop ;//重启后会启动 ,用service iptables status检查状态。
开始GP安装
1、在Master上安装GP,root权限
将下载好的 greenplum-db-4.3.5.2-build-1-RHEL5-x86_64.zip 放到一个目录下,解压(unzip),得到一个ReadMe和.bin文件,默认GP是装到 /usr/local/greenplum下的,其实装哪里都可以,这边我们装到 /opt/greenplum/ 下。
执行 bin文件,解压目录下 ./ greenplum-db-4.3.5.2-build-1-RHEL5-x86_64.bin
一路空格键下去,直到叫你输 yes|no ,打yes
选安装目录,将你要安装的目录输入,这里 /opt/greenplum/greenplum-db-4.3.5.2
再一路yes下去就安装好了,很快。
2、习惯先在Master机上建个 负责GP数据库的用户 gpadmin,后续segment机的用户 gpadmin 再通过 gpssh添加
一般一开始是没gpadmin用户的,直接新建










