本地Yum軟件源安裝Cloudera Manager 5

本地Yum軟件源安裝Cloudera Manager 5


Cloudera Manager 5(以下簡稱CM)默認採用在線安裝的方式,給不能聯互聯網或者網絡不暢的用戶帶來了不便,由於網絡問題,屢裝屢敗的挫折感,讓初次學習CDH用戶真心體驗到萬事開頭難。本文講解了在CentOS 6環境下搭建本地Yum軟件源,局域網內的用戶在完全不連互聯網的情況下,完成CM的安裝。讓安裝CM的用戶體驗到一路next,然後finish的順暢感,速度是用戶的第一體驗。

一、搭建CM的本地Yum軟件源

CM在線文檔中大致講解了如何搭建本地Yum,參見:Creating and Using a Local Package Repository ,由於兼顧到不同的操作系統和CM版本,描述的不夠細緻,下面就 CentOS6.5 和 CM5.0.2 版本的本地Yum軟件源的搭建步驟進行描述。

1、準備工作

關閉防火牆:

[root@localhost soft]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@localhost soft]# 

永久關閉防火牆,可以使用:chkconfig iptables off

關閉selinux:

修改:/etc/selinux/config
SELINUX=disabled
修改後,重啓機器。

2、安裝Apache httpd web服務器

檢查是否存在httpd服務:

[root@localhost soft]# service httpd status

如果不存在,則用下面的命令安裝:

yum install httpd

CentOS6默認安裝了httpd,啓動:

[root@localhost soft]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                           [  OK  ]
[root@localhost soft]# 

上面的提示信息不用理會。將httpd加入到啓動列表:chkconfig httpd on

httpd常用命令如下,供參考:
  啓動命令:service httpd start
  關閉命令:service httpd stop
  重啓命令:service httpd restart
  查看狀態:service httpd status

3、下載CM資源包

到CM資源頁面:http://archive-primary.cloudera.com/cm5/repo-as-tarball/5.0.2/ 下載資源包,對應CentOS的資源包爲:

	cm5.0.2-centos6.tar.gz	11-Jun-2014 18:12	517M	 

這是壓縮包,解壓後包含CM安裝過程中需要的RPM文件,除了 postgresql 數據庫安裝文件。

4、發佈CM資源文件

解壓資源包:

[root@localhost cloudera]# pwd
/home/soft/cloudera
[root@localhost cloudera]# ll
total 529076
-rw-r--r--. 1 root root 541768507 Jun 14 09:14 cm5.0.2-centos6.tar.gz
[root@localhost cloudera]# tar -zxvf cm5.0.2-centos6.tar.gz 
cm/
cm/cloudera-manager.repo
cm/5
cm/5.0.2/
cm/5.0.2/mirrors
cm/5.0.2/repodata/
cm/5.0.2/repodata/other.xml.gz.asc
cm/5.0.2/repodata/filelists.xml.gz
cm/5.0.2/repodata/primary.xml.gz.asc
cm/5.0.2/repodata/repomd.xml
cm/5.0.2/repodata/other.xml.gz
cm/5.0.2/repodata/repomd.xml.asc
cm/5.0.2/repodata/primary.xml.gz
cm/5.0.2/repodata/filelists.xml.gz.asc
cm/5.0.2/RPMS/
cm/5.0.2/RPMS/x86_64/
cm/5.0.2/RPMS/x86_64/cloudera-manager-daemons-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
cm/5.0.2/RPMS/x86_64/enterprise-debuginfo-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
cm/5.0.2/RPMS/x86_64/cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
cm/5.0.2/RPMS/x86_64/cloudera-manager-server-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
cm/5.0.2/RPMS/x86_64/cloudera-manager-agent-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
cm/5.0.2/RPMS/x86_64/oracle-j2sdk1.7-1.7.0+update45-1.x86_64.rpm
cm/5.0.2/RPMS/x86_64/jdk-6u31-linux-amd64.rpm
cm/5.0.2/RPMS/noarch/
cm/RPM-GPG-KEY-cloudera
[root@localhost cloudera]# ll
total 529080
drwxrwxr-x. 3 1106  592      4096 Jun 11 11:08 cm
-rw-r--r--. 1 root root 541768507 Jun 14 09:14 cm5.0.2-centos6.tar.gz
[root@localhost cloudera]# 

移動解壓後的cm文件夾到Web目錄,並設置權限:
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# mkdir -p cm5/redhat/6/x86_64
[root@localhost html]# cd cm5/redhat/6/x86_64
[root@localhost x86_64]# mv /home/soft/cloudera/cm .
[root@localhost x86_64]# chmod -R ugo+rX cm
訪問http://<hostname>/cm5/redhat/6/x86_64/cm/,測試文件索引頁面是否正常,如果頁面空白或者爲You don't have permission to access,請檢查準備工作中的防火牆和selinux是否關閉。

至此,局域網內的CM資源文件已經發布完成,下面的修改在客戶端進行,也就是安裝CM的機器,當然,存放CM資源文件的機器也可以安裝CM。

二、離線安裝Cloudera Manager 5

1、安裝postgresql

在離線安裝CM時,有時會報如下的錯誤:

Resolving Dependencies
--> Running transaction check
---> Package cloudera-manager-server-db-2.x86_64 0:5.0.2-1.cm502.p0.297.el6 will be installed
--> Processing Dependency: postgresql-server >= 8.4 for package: cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64
--> Finished Dependency Resolution
Error: Package: cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64 (cloudera-manager)
           Requires: postgresql-server >= 8.4
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
這是由於CM依賴postgresql,需要在本機上安裝postgresql,如果是在線安裝,自動以Yum方式安裝,由於是離線,無法自動安裝postgresql。

檢查是否安裝了postgresql:

[root@localhost postgresql84]# rpm -qa|grep postgres
如果已經安裝,但版本小於8.4,則使用rpm -e卸載。

下面以rpm方式安裝postgresql,先到 http://yum.postgresql.org/8.4/redhat/rhel-6-x86_64/repoview/ 上下載postgresql8.4的包,需要下載三個包:

[root@localhost postgresql84]# ll
total 4532
-rw-r--r-- 1 root root  898392 Jun 15 01:10 postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm
-rw-r--r-- 1 root root  180396 Jun 15 01:10 postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm
-rw-r--r-- 1 root root 3552400 Jun 15 01:10 postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm
[root@localhost postgresql84]# 
安裝PostgreSQL,注意安裝順序:
[root@localhost postgresql84]# rpm -ivh postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm
warning: postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing...                ########################################### [100%]
   1:postgresql84-libs      ########################################### [100%]
[root@localhost postgresql84]# rpm -ivh postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm 
warning: postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing...                ########################################### [100%]
   1:postgresql84           ########################################### [100%]
[root@localhost postgresql84]# rpm -ivh postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm 
warning: postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing...                ########################################### [100%]
   1:postgresql84-server    ########################################### [100%]
[root@localhost postgresql84]# 
postgresql包說明,供參考:
postgresql包含許多不同的包,包括第三方類庫,通常安裝最重要的包即可(能滿足大部分應用需求)。這些包如下:
postgresql - 客戶端類庫及二進制文件
postgresql-server - 核心的數據庫服務器
postgresql-contrib - 附加的供應組件
postgresql-devel - 用戶C語言開發的類庫和頭文件
pgadmin3 - 數據庫圖像化管理工具第三版

2、修改客戶端配置,使其可以找到資源文件

在客戶端機器上關閉防火牆和selinux,參見準備工作中的描述。

新建名稱爲 myrepo.repo 的軟件源配置文件,內容如下:

[myrepo]
name=myrepo
baseurl=http://<hostname>/cm5/redhat/6/x86_64/cm/5/
enabled=1
gpgcheck=0
其中<hostname>爲剛纔安裝Web服務器的主機名(或者ip),將 myrepo.repo保存到客戶端機器的 /etc/yum.repos.d/目錄,並刪除這個目錄下的其他*.repo文件,其他庫有可能需要連接互聯網,有可能使安裝失敗。這時  /etc/yum.repos.d 目錄的清單如下:
[root@localhost yum.repos.d]# pwd
/etc/yum.repos.d
[root@localhost yum.repos.d]# ll
total 4
-rw-r--r-- 1 root root 100 Jun 14 21:14 myrepo.repo
[root@localhost yum.repos.d]# 
設置了軟件源還不夠,還會從互聯網上卸載一些配置文件,雖然軟件源中包含了需要的所有文件,修改 /etc/hosts,在最後添加:
<hostname> archive.cloudera.com
其中<hostname>爲剛纔安裝Web服務器的主機名(或者ip)。完成了以上步驟,可以開始安裝CM5了。

3、下載CM5安裝文件

從 http://archive-primary.cloudera.com/cm5/installer/5.0.2.13/ 下載:

cloudera-manager-installer.bin	11-Jun-2014 18:07	499K	 
實際上是安裝引導文件,在安裝過程中動態下載安裝中需要的rpm包。

4、安裝CM5

給 cloudera-manager-installer.bin 添加可執行權限:

[root@localhost cloudera]# chmod +x cloudera-manager-installer.bin

進行安裝:

[root@localhost cloudera]# ./cloudera-manager-installer.bin 
彈出安裝圖形界面,一路next、accept就可以了,最後出現下面的提示框,讓你訪問 http://localhost:7180/,說明已經安裝成功了。

Your browser should now open to http://localhost:7180/. Log in to Cloudera Manager with the username and password set to 'admin' to continue installation.  FROM:http://blog.csdn.net/yangzhaohui168


三、登錄CM管理頁面

使用用戶名和密碼都爲admin登錄  http://localhost:7180/ ,界面如下:

CM login FROM:http://blog.csdn.net/yangzhaohui168


登錄CM管理頁面,進行相關的操作,後文詳細描述Impala, Spark的離線安裝方法。

原創作品,轉載請註明出處:http://blog.csdn.net/yangzhaohui168/article/details/30118175

發佈了33 篇原創文章 · 獲贊 9 · 訪問量 38萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章