centos6.6下安装GreenPlum4.3.5.2
发布时间:2023-02-18 09:26:51 所属栏目:CentOS 来源:互联网
导读:在GP官网,看不到关于最新GP在Centos上的对应版本,就使用RedHat的版本就好了。 前言: GP的安装大致是这样的,选择一台主机作为Master机,其他作为Segment机。由于没那么多机子,就虚拟机开了三个centos6.6,采用1+2模式。 安装时候,记住 GP可以先在Master
在GP官网,看不到关于最新GP在Centos上的对应版本,就使用RedHat的版本就好了。 前言: GP的安装大致是这样的,选择一台主机作为Master机,其他作为Segment机。由于没那么多机子,就虚拟机开了三个centos6.6,采用1+2模式。 安装时候,记住 GP可以先在Master机上装好,后续通过在Maser机和Segment机间建立互信(gpssh-exkeys)来进行类似远程安装,通过 gpssh 就可以登录到所有机子上,进行你想要的包括建用户,拷贝安装好的GP,等等一系列操作。 当然,在安装前,有的人会配置下 内核参数、限制参数等等,看你需要。因为我虚拟机,硬件基本达不到官网要求,就舍去这步了。 安装前准备(可选) 1、在Master机的 /etc/sysctl.conf 中添加 kernel.shmmax=500000000 kernel.shmmni=4096 kernel.shmall=4000000000 kernel.sem=2505120001002048 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=102565535 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 添加 *softnofile65536 *hardnofile65536 *softnproc131072 *hardnproc131072 !!! 注意,对于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用户的,直接新建 groupadd -g 530 gpadmin useradd -g 530 -u 530 -m -d /home/gpadmin -s /bin/bash gpadmin passwd gpadmin ;添加密码 对GP安装文件夹修改权限 chown -R gpadmin:gpadmin /home/gpadmin chown -R gpadmin:gpadmin /opt/greenplum 将GP安装目录下的一个环境变量文件添加到用户中。 source /opt/greenplum/greenplum-db/greenplum_path.sh ;/opt/greenplum/greenplum-db是/opt/greenplum/greenplum-db-4.3.5.2的链接,没有就自己链接一个 ln -s/opt/greenplum/greenplum-db-4.3.5.2 /opt/greenplum/greenplum-db 3、建立主机间的互信 首先,在Master机上,编辑 /etc/hosts文件, 将Master机和segment机的Ip,hostname输入。 如 # /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.127.136 mdw #master机 192.168.127.137 sdw1 #segment机 192.168.127.138 sdw2 #segment机 其次,在某个目录下 如 /var 下建一个保护所有主机hostname的文件hostlists(名字随便取)和含segment机hostname的seg_hosts。 /var/hostlists: mdw sdw1 sdw2 /var/seg_hosts sdw1 sdw2 开始建立互信 gpssh-exkeys -f /var/hostlists [root@localhost ~]$ gpssh-exkeys -f /var/hostlists [STEP 1 of 5] create local ID and authorize on local host ... /home/root/.ssh/id_rsa file exists ... key generation skipped [STEP 2 of 5] keyscan all hosts and update kNown_hosts file [STEP 3 of 5] authorize current user on remote hosts ... send to mdw ... send to sdw1 *** *** Enter password for sdw1: [STEP 4 of 5] determine common authentication file content [STEP 5 of 5] copy authentication files to all remote hosts ... finished key exchange with mdw ... finished key exchange with sdw1 [INFO] completed successfully 注意:如果提示 没有秘钥就 ssh-keygen -t rsa ; ssh-add /root/.ssh/id_rsa 。 就可以得到秘钥。 如果执行 ssd-add 出现,Could not open a connection to your authentication agent ,则执行 ssh-agent bash. 即可。 建立互信后,就可以通过 gpssh -f /var/seg_hosts 访问所有的机子了。 (编辑:甘南站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |