本地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





相关内容