CDH5.7.0安裝實(shí)踐
規(guī)劃:
ip1 master
ip2 slave
ip3 slave
ip4 slave? (add node && yum repo)--ip4作為后備的添加結(jié)點(diǎn)和yum源
一.基礎(chǔ)配置(每臺(tái)機(jī)器都要操作)
1.更改hostname
vi /etc/sysconfig/network? ? 然后service network restart使之生效
2.更改ip與hostname的對(duì)應(yīng)關(guān)系
vi /etc/hosts? ? ? ? ? ? ? ? 使用uname -a查看是否生效
3.關(guān)閉防火墻
service iptables stop? ? ? ? ? 關(guān)閉防火墻
service iptables status? ? ? ? 查看防火墻是否正在運(yùn)行
chkconfig iptables off? ? ? ? ? 關(guān)閉防火墻的開(kāi)機(jī)自動(dòng)運(yùn)行
4.關(guān)閉SELinux
修改/etc/selinux/config和/etc/sysconfig/selinux的SELINUX=disabled
機(jī)器重啟后生效
通過(guò)sestatus驗(yàn)證
5.ntp(用于時(shí)間同步服務(wù))
5.1安裝配置ntp服務(wù)
5.2crontab腳本用于時(shí)間同步
01 * * * *? /bin/bash /home/adminscripts/ntpd_sync.sh
二.創(chuàng)建本地yum源
注:由于CDH5.7.0使用的是https協(xié)議,所以要配置https可訪問(wèn)的httpd
A.準(zhǔn)備yum源文件
1.mkdir -p /var/www/html/cm5/redhat/6/x86_64
下載 http://archive.cloudera.com/cm5/repo-as-tarball/5.7.0/cm5.7.0-centos6.tar.gz
解壓后 mv cm /var/www/html/cm5/redhat/6/x86_64/
2.mkdir -p /var/www/html/cdh5/parcels/5.7.0/
下載 http://archive.cloudera.com/cdh5/parcels/5.7.0/CDH-5.7.0-1.cdh5.7.0.p0.45-el6.parcel
下載 http://archive.cloudera.com/cdh5/parcels/5.7.0/CDH-5.7.0-1.cdh5.7.0.p0.45-el6.parcel.sha1并改名為CDH-5.7.0-1.cdh5.7.0.p0.45-el6.parcel.sha
mv CDH-5.7.0-1.cdh5.7.0.p0.45-el6.parcel*? /var/www/html/cdh5/parcels/5.7.0/
3.mkdir -p /var/www/html/cdh5/redhat/6/x86_64/
下載 http://archive.cloudera.com/cdh5/repo-as-tarball/5.7.0/cdh5.7.0-centos6.tar.gz
解壓后 mv cdh /var/www/html/cdh5/redhat/6/x86_64/
4.mkdir -p /var/www/html/redhat/cdh/
下載 http://archive.cloudera.com/redhat/cdh/RPM-GPG-KEY-cloudera
然后mv RPM-GPG-KEY-cloudera? /var/www/html/redhat/cdh/
B.ip4配置https訪問(wèn)的yum源
1.安裝ssl
2.編譯安裝httpd
2.1編譯安裝httpd所需要的依賴(參考http://xtony.blog.51cto.com/3964396/836508)
2.2下載httpd-2.4.20.tar.gz并解壓(參考http://cwind.blog.51cto.com/62582/1061168)
編譯安裝: cd httpd-2.4.20
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre --enable-ssl --enable-so
make && make install
2.3生成證書(shū)
mkdir -p /usr/local/apache2/conf/ssl.key
cd /usr/local/apache2/conf/ssl.key
//生成服務(wù)器私鑰:
openssl genrsa -des3 -out server.key 1024
//生成服務(wù)器證書(shū)請(qǐng)求双霍,并按要求填些相關(guān)證書(shū)信息:
openssl req -new -key server.key -out server.csr
//簽證:
openssl x509 -req -days 700 -in server.csr -signkey server.key -out server.crt
2.4修改httpd.conf文件
①打開(kāi)LoadModule ssl_module modules/mod_ssl.so和LoadModule rewrite_module modules/mod_rewrite.so
②加入代碼:
Listen 443
NameVirtualHost *:443
NameVirtualHost *:80
ServerName ip4
DocumentRoot /var/www/html
ErrorLog /usr/local/apache2/logs/error.log
CustomLog /usr/local/apache2/logs/access.log combined
ServerName ip4
DocumentRoot /var/www/html
ErrorLog /usr/local/apache2/logs/error.log
CustomLog /usr/local/apache2/logs/access.log combined
SSLEngine on
SSLCertificateFile /usr/local/apache2/conf/ssl.key/server.crt
SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key
SSLEngine off
③修改為
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
RewriteEngine on
RewriteCond? %{HTTPS} !=on
RewriteRule? ^(.*)? https://%{SERVER_NAME} [L,R]
2.5啟動(dòng)
/usr/local/apache2/bin/apachectl start
2.6訪問(wèn):https://ip4 (訪問(wèn)http也會(huì)自動(dòng)跳轉(zhuǎn)到https)
2.7去掉校驗(yàn)
在/etc/yum.conf中添加sslverify=false
三.安裝Cloudera Manager
1.cm安裝使用的http服務(wù)风钻,所以安裝節(jié)點(diǎn)需要是可以訪問(wèn)的http協(xié)議yum源
2.下載
下載 http://archive-primary.cloudera.com/cm5/installer/5.3.0/cloudera-manager-installer.bin ?
chmod +x cloudera-manager-installer.bin
./cloudera-manager-installer.bin
3.界面一直next 和 yes操作
四.安裝CDH parcel
1.打開(kāi)http://ip1:7180的操作頁(yè)面進(jìn)行安裝
2.注意如果出現(xiàn):未在已配置的存儲(chǔ)庫(kù)中找到任何 parcel
在"更多選項(xiàng)里"將"遠(yuǎn)程parcel存儲(chǔ)庫(kù)url"更改為"https://ip4/cdh5/parcels/5.7.0/"即可找到parcel
3.修改swappiness分區(qū)
cat /proc/sys/vm/swappiness
sudo sysctl vm.swappiness=0
五.添加節(jié)點(diǎn)
CM管理頁(yè)面操作
六.添加服務(wù)
cluster1——添加服務(wù)