本篇將向大家介紹如何快捷的安裝部署GreenPlum測試集群,大家可以跟着我一塊兒實踐一把^_^
1.主機資源
申請2台網易雲主機,操作系統必須是RedHat或者CentOS,配置盡量高一點。如果是sa統一初始化的物理機,這里不再描述,因為中間有很多操作(比如關閉puppet服務等等)
2.下載安裝包
下載鏈接:
https://network.pivotal.io/products/pivotal-gpdb,需要先注冊才能下載,建議用非163郵箱注冊;(下載困難可以泡泡找我)
3.開始安裝
以下操作如果沒有特殊說明,則需要在2台主機上同時操作!
3.1修改系統參數:
為簡化操作,部分參數不再這里描述。
[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
3.2安裝unzip:
[root@hzayq-helf-xxx ~]# yum install unzip
3.3安裝GreenPlum:
[root@hzayq-helf-xxx ~]# ./greenplum-db-4.3.11.1-build-1-rhel5-x86_64.bin
3.4創建普通用戶:
[root@hzayq-helf-xxx ~]# useradd -d /home/gpadmin gpadmin
3.5生成普通用戶的公私鑰:
[root@hzayq-helf-xxx ~]# su - gpadmin
[gpadmin@hzayq-helf-xxx ~]# ssh-keygen -t rsa -P ''
3.6配置/etc/hosts:
[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
3.7設置免密登陸:
[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
3.8創建數據目錄:
[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
3.10初始化GreenPlum系統:
任選1台主機做master,1台做standby master,使用
附件中的2個配置文件,
需要修改下gpinitsystem_config中MASTER_HOSTNAME字段為master節點
[gpadmin@hzayq-helf-xxx ~]# gpinitsystem -c gpinitsystem_config -h hostfile_gpinitsystem -s hzayq-helf-yyy
一路Y即可安裝成功!
3.11最后,再編輯下環境變量:
[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
3.12使用psql接入:
[gpadmin@hzayq-helf-xxx ~]# psql -d template1
附件
歡迎來到GreenPlum的世界!^_^
看這里:
本文來自網易雲社區,經作者何李夫授權發布。
原文地址:【大數據之數據倉庫】安裝部署GreenPlum集群
更多網易研發、產品、運營經驗分享請訪問網易雲社區。