基於【CentOS-7+ Ambari 2.7.0 + HDP 3.0】搭建HAWQ數據倉庫——操做系統配置,安裝必備軟件

注意未經說明,全部本文中全部操做都默認須要做爲root用戶進行操做。html

1、安裝zmodem,用於遠程上傳下載文件,安裝gedit,方便重定向到遠程windows上編輯文件(經過xlanuch)java

[root@]# yum install lrzsz -y
[root@]# yum install gedit -y

2、關閉防火牆linux

[root@]# systemctl disable firewalld
[root@]# systemctl stop firewalld

3、關閉SELinuxc++

在系統運行狀態暫時關閉(重啓後失效):apache

setenforce  0

編輯設置文件/etc/sysconfig/selinux,關閉SELinux(重啓生效)vim

備註:已發現,若是不關閉,致使HUE的load-balance服務啓動報權限錯誤!windows

vim   /etc/sysconfig/selinuxcentos

設置SELINUX爲disabled,以下所示:cookie

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

保存退出後複製到各個節點,或者在每一個節點上重複設置。oracle

4、卸載系統中已安裝的openjdk,安裝oracle jdk發行版

1,查詢系統中的openjdk軟件包:

[root@ep-bd01 ~]# rpm -qa|grep openjdk -i
java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.8.el7_5.x86_64

2,根據查詢到的結果,卸載openjdk,軟件包名稱要一致。

[root@ep-bd01 ~]# yum remove java-1.7.0-openjdk-headless-1.7.0.181-2.6.14.8.el7_5.x86_64

3,下載最新 Oracle JDK 8.181 centos,用rpm命令安裝:

[root@ep-bd01 ~]# rpm -ivh jdk-8u181-linux-x64.rpm

5、設置系統運行參數:

1 ,設置swappiness

echo 10 > /proc/sys/vm/swappiness

2, 禁用 透明大頁面壓縮

** 運行時設置:

echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled

 一樣添加上面2行到/etc/rc.local以便重啓是運行

 【注意,爲使/etc/rc.local開機能夠運行,必須給/etc/rc.d/rc.local添加執行權限】

chmod +x /etc/rc.d/rc.local

6、配置用戶免密互訪:

詳細參見:基於【CentOS-7+ Ambari 2.7.0 + HDP 3.0】搭建HAWQ數據倉庫——安裝配置OPEN-SSH,設置主機節點之間免密互訪

7、設置DNS,便於集羣主機互訪。

1,編輯主節點/etc/hosts文件,添加集羣節點地址

192.168.58.11 ep-bd01
192.168.58.12 ep-bd02
192.168.58.13 ep-bd03
192.168.58.14 ep-bd04
192.168.58.15 ep-bd05

2,分發/etc/hosts文件,scp複製到其餘節點或者各個主機節點單獨編輯。

scp /etc/hosts ep-bd02:/etc/.
scp /etc/hosts ep-bd03:/etc/.
scp /etc/hosts ep-bd04:/etc/.
scp /etc/hosts ep-bd05:/etc/.

 

8、HAWQ2.30所需系統環境設置【所有主機節點】:

1, vim /etc/sysctl.conf,編輯以下內容:

kernel.shmmax= 1000000000
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= 0
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= 200000
net.ipv4.conf.all.arp_filter= 1
net.ipv4.ip_local_port_range= 1281 65535
net.core.netdev_max_backlog= 200000
#java程序多時,設成2會致使不少服務不能去啓動! #vm.overcommit_memory= 2
vm.overcommit_memory=0 fs.nr_open= 3000000 kernel.threads-max= 798720 kernel.pid_max= 798720 #increase network net.core.rmem_max=2097152 net.core.wmem_max=2097152

保存退出後,使用命令「sysctl -p」 使之生效:

sysctl -p

2,修改/etc/security/limits.conf,設置打開文件數限制:

vim /etc/security/limits.conf

編輯以下內容:

* soft nofile 2900000
* hard nofile 2900000
* soft nproc 131072
* hard nproc 131072

從新登陸以使配置生效,或者使用命令臨時設置一下:

ulimit -n 10240

3, 添加gpadmin用戶(greeplum admin縮寫),使用/opt/gpadmin做爲主目錄

useradd --home=/opt/gpadmin/ --no-create-home --comment "HAWQ admin" gpadmin 
echo gpadmin | passwd --stdin gpadmin 
mkdir /opt/gpadmin
chown gpadmin:gpadmin /opt/gpadmin

2,添加gpadmin到/etc/sudoers

vim /etc/sudoers 編輯添加以下行

gpadmin ALL=(ALL) NOPASSWD:ALL

3, 配置gpadmin用戶的ssh【免密互訪】

參照上面root用戶的設置進行。

9、 準備HAWQ2.3.0依賴軟件包

1,hawq2.3.0所需必備軟件包以下:

libgsasl is needed by apache-hawq-2.3.0.0-el7.x86_64
protobuf >= 2.5.0 is needed by apache-hawq-2.3.0.0-el7.x86_64
net-snmp-libs is needed by apache-hawq-2.3.0.0-el7.x86_64
thrift >= 0.9.1 is needed by apache-hawq-2.3.0.0-el7.x86_64
boost >= 1.53.0 is needed by apache-hawq-2.3.0.0-el7.x86_64

其中gcc gcc-c++ protobuf net-snmp-libs boots可直接安裝。而安裝libgsasl須要添加一個包含libgsasl庫的源。

2,新建/etc/yum.repos.d/fedora.repo文件,添加以下內容: 

[epel-repo]
name=epel
baseurl=http://dl.fedoraproject.org/pub/epel/6/x86_64/
enabled=1
gpgcheck=0

3,安裝各個軟件包:

yum install gcc gcc-c++ -y
yum install protobuf -y
yum install net-snmp-libs -y
yum install boost -y 
yum install libgsasl-devel -y
yum install libevent -y

4,thrift 0.9.1須要下載安裝包並使用rpm進行安裝

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/t/thrift-0.9.1-15.el7.x86_64.rpm
rpm -ivh thrift-0.9.1-15.el7.x86_64.rpm
相關文章
相關標籤/搜索