[root@hzayq-helf-xxx ~]# chkconfig iptables off 关闭防火墙
[root@hzayq-helf-xxx ~]# chkconfig --list iptables 查看防火墙
[root@hzayq-helf-xxx ~]# echo "MaxStartups 300:30:1000" >> /etc/ssh/sshd_config 提高ssh并发
[root@hzayq-helf-xxx ~]# service sshd restart
[root@hzayq-helf-xxx ~]# vi /etc/sysctl.conf 增加(不是覆盖)以下参数
kernel.sysrq = 1
xfs_mount_options = rw,noatime,inode64,allocsize=16m
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
[root@hzayq-helf-xxx ~]# sysctl -p 生效
[root@hzayq-helf-xxx ~]# vi /etc/security/limits.conf 增加以下参数
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
[root@hzayq-helf-xxx ~]# yum install unzip
[root@hzayq-helf-xxx ~]# ./greenplum-db-4.3.11.1-build-1-rhel5-x86_64.bin
[root@hzayq-helf-xxx ~]# useradd -d /home/gpadmin gpadmin
[root@hzayq-helf-xxx ~]# su - gpadmin
[gpadmin@hzayq-helf-xxx ~]# ssh-keygen -t rsa -P ''
[gpadmin@hzayq-helf-xxx ~]# hostname 获取主机名
[gpadmin@hzayq-helf-xxx ~]# exit 切换回root
[root@hzayq-helf-xxx ~]# vi /etc/hosts 添加ip和主机名的映射
比如:
10.171.160.142 hzayq-helf-xxx
10.171.160.143 hzayq-helf-yyy
[gpadmin@hzayq-helf-xxx ~]# cat .ssh/id_rsa.pub 查看公钥
... ... 切换到其他的主机
[gpadmin@hzayq-helf-yyy ~]# vi .ssh/authorized_keys 创建认证文件,并把所有主机的公钥粘贴进去,记住把自己的公钥也贴进去哦
[gpadmin@hzayq-helf-yyy ~]# chmod 600 .ssh/authorized_keys 修改认证文件权限属性
... ... 切换回原来的机器
[gpadmin@hzayq-helf-xxx ~]# ssh hzayq-helf-yyy 验证免密登陆是否OK
[gpadmin@hzayq-helf-xxx ~]# mkdir -p gp/data/master 创建master目录
[gpadmin@hzayq-helf-xxx ~]# mkdir -p gp/data/primary1 创建第1个primary目录
[gpadmin@hzayq-helf-xxx ~]# mkdir -p gp/data/primary2 创建第2个primary目录
[gpadmin@hzayq-helf-xxx ~]# mkdir -p gp/data/mirror1 创建第1个mirror目录
[gpadmin@hzayq-helf-xxx ~]# mkdir -p gp/data/mirror2 创建第2个mirror目录
3.9编辑环境变量:
[gpadmin@hzayq-helf-xxx ~]# echo "source /usr/local/greenplum-db/greenplum_path.sh" >> .bashrc
[gpadmin@hzayq-helf-xxx ~]# source .bashrc
[gpadmin@hzayq-helf-xxx ~]# gpinitsystem -c gpinitsystem_config -h hostfile_gpinitsystem -s hzayq-helf-yyy
一路Y即可安装成功!
[gpadmin@hzayq-helf-xxx ~]# vi ~/.bashrc 增加以下两个环境变量
export MASTER_DATA_DIRECTORY=/home/gpadmin/gp/data/master/gpseg-1
export PGPORT=5432
[gpadmin@hzayq-helf-xxx ~]# source ~/.bashrc
[gpadmin@hzayq-helf-xxx ~]# psql -d template1
本文来自网易实践者社区,经作者何李夫授权发布。