首頁 > 系統教程 > Linux > 主體

在CentOS 6.6上安裝Greenplum 4.3.5.2的步驟

WBOY
發布: 2024-01-04 21:48:37
轉載
1212 人瀏覽過

在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用戶的,直接新建

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 存取所有的機子了。

以上是在CentOS 6.6上安裝Greenplum 4.3.5.2的步驟的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:jb51.net
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!