安装Cloudera Manager 5

谁借莪1个温暖的怀抱¢ 2022-09-23 03:56 253阅读 0赞

Cloudera Manager 5(以下简称CM)默认采用在线安装的方式,给不能联互联网或者网络不畅的用户带来了不便,由于网络问题,屡装屡败的挫折感,让初次学习CDH用户真心体验到万事开头难。本文讲解了在CentOS 6环境下搭建本地Yum软件源,局域网内的用户在完全不连互联网的情况下,完成CM的安装。让安装CM的用户体验到一路next,然后finish的顺畅感,速度是用户的第一体验。

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

CM在线文档中大致讲解了如何搭建本地Yum,参见:Creating and Using a Local Package Repository ,由于兼顾到不同的操作系统和CM版本,描述的不够细致,下面就 CentOS-6.5-x86_64 和 CM5.0.2 版本的本地Yum软件源的搭建步骤进行描述。

1、准备工作

关闭防火墙:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [root@localhost soft]# service iptables stop
  2. iptables: Setting chains to policy ACCEPT: filter [ OK ]
  3. iptables: Flushing firewall rules: [ OK ]
  4. iptables: Unloading modules: [ OK ]
  5. [root@localhost soft]#

永久关闭防火墙,可以使用:chkconfig iptables off

关闭selinux:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. 修改:/etc/selinux/config
  2. SELINUX=disabled
  3. 修改后,重启机器。

2、安装Apache httpd web服务器

检查是否存在httpd服务:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [root@localhost soft]# service httpd status

如果不存在,则用下面的命令安装:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. yum install httpd

CentOS6默认安装了httpd,启动:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

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

上面的提示信息不用理会。将httpd加入到启动列表:chkconfig httpd on

httpd常用命令如下,供参考:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. 启动命令:service httpd start
  2. 关闭命令:service httpd stop
  3. 重启命令:service httpd restart
  4. 查看状态:service httpd status

3、下载CM资源包

到CM资源页面:http://archive-primary.cloudera.com/cm5/repo-as-tarball/5.0.2/ 下载资源包,对应CentOS的资源包为:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

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

这是压缩包,解压后包含CM安装过程中需要的RPM文件,除了 postgresql 数据库安装文件。

4、发布CM资源文件

解压资源包:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [root@localhost cloudera]# pwd
  2. /home/soft/cloudera
  3. [root@localhost cloudera]# ll
  4. total 529076
  5. -rw-r—r—. 1 root root 541768507 Jun 14 09:14 cm5.0.2-centos6.tar.gz
  6. [root@localhost cloudera]# tar -zxvf cm5.0.2-centos6.tar.gz
  7. cm/
  8. cm/cloudera-manager.repo
  9. cm/5
  10. cm/5.0.2/
  11. cm/5.0.2/mirrors
  12. cm/5.0.2/repodata/
  13. cm/5.0.2/repodata/other.xml.gz.asc
  14. cm/5.0.2/repodata/filelists.xml.gz
  15. cm/5.0.2/repodata/primary.xml.gz.asc
  16. cm/5.0.2/repodata/repomd.xml
  17. cm/5.0.2/repodata/other.xml.gz
  18. cm/5.0.2/repodata/repomd.xml.asc
  19. cm/5.0.2/repodata/primary.xml.gz
  20. cm/5.0.2/repodata/filelists.xml.gz.asc
  21. cm/5.0.2/RPMS/
  22. cm/5.0.2/RPMS/x86_64/
  23. cm/5.0.2/RPMS/x86_64/cloudera-manager-daemons-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
  24. cm/5.0.2/RPMS/x86_64/enterprise-debuginfo-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
  25. cm/5.0.2/RPMS/x86_64/cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
  26. cm/5.0.2/RPMS/x86_64/cloudera-manager-server-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
  27. cm/5.0.2/RPMS/x86_64/cloudera-manager-agent-5.0.2-1.cm502.p0.297.el6.x86_64.rpm
  28. cm/5.0.2/RPMS/x86_64/oracle-j2sdk1.7-1.7.0+update45-1.x86_64.rpm
  29. cm/5.0.2/RPMS/x86_64/jdk-6u31-linux-amd64.rpm
  30. cm/5.0.2/RPMS/noarch/
  31. cm/RPM-GPG-KEY-cloudera
  32. [root@localhost cloudera]# ll
  33. total 529080
  34. drwxrwxr-x. 3 1106 592 4096 Jun 11 11:08 cm
  35. -rw-r—r—. 1 root root 541768507 Jun 14 09:14 cm5.0.2-centos6.tar.gz
  36. [root@localhost cloudera]#

移动解压后的cm文件夹到Web目录,并设置权限:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [root@localhost html]# pwd
  2. /var/www/html
  3. [root@localhost html]# mkdir -p cm5/redhat/6/x86_64
  4. [root@localhost html]# cd cm5/redhat/6/x86_64
  5. [root@localhost x86_64]# mv /home/soft/cloudera/cm .
  6. [root@localhost x86_64]# chmod -R ugo+rX cm

访问http:///cm5/redhat/6/x86_64/cm/,测试文件索引页面是否正常,如果页面空白或者为You don’t have permission to access,请检查准备工作中的防火墙和selinux是否关闭。

至此,局域网内的CM资源文件已经发布完成,下面的修改在客户端进行,也就是安装CM的机器,当然,存放CM资源文件的机器也可以安装CM。

二、离线安装Cloudera Manager 5

1、安装postgresql

在离线安装CM时,有时会报如下的错误:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. Resolving Dependencies
  2. --> Running transaction check
  3. -—> Package cloudera-manager-server-db-2.x86_64 0:5.0.2-1.cm502.p0.297.el6 will be installed
  4. --> Processing Dependency: postgresql-server >= 8.4 for package: cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64
  5. --> Finished Dependency Resolution
  6. Error: Package: cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64 (cloudera-manager)
  7. Requires: postgresql-server >= 8.4
  8. You could try using —skip-broken to work around the problem
  9. You could try running: rpm -Va —nofiles —nodigest

这是由于CM依赖postgresql,需要在本机上安装postgresql,如果是在线安装,自动以Yum方式安装,由于是离线,无法自动安装postgresql。

检查是否安装了postgresql:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [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的包,需要下载三个包:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [root@localhost postgresql84]# ll
  2. total 4532
  3. -rw-r—r— 1 root root 898392 Jun 15 01:10 postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm
  4. -rw-r—r— 1 root root 180396 Jun 15 01:10 postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm
  5. -rw-r—r— 1 root root 3552400 Jun 15 01:10 postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm
  6. [root@localhost postgresql84]#

安装PostgreSQL,注意安装顺序:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [root@localhost postgresql84]# rpm -ivh postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm
  2. warning: postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
  3. Preparing… ########################################### [100%]
  4. 1:postgresql84-libs ########################################### [100%]
  5. [root@localhost postgresql84]# rpm -ivh postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm
  6. warning: postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
  7. Preparing… ########################################### [100%]
  8. 1:postgresql84 ########################################### [100%]
  9. [root@localhost postgresql84]# rpm -ivh postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm
  10. warning: postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
  11. Preparing… ########################################### [100%]
  12. 1:postgresql84-server ########################################### [100%]
  13. [root@localhost postgresql84]#

postgresql包说明,供参考:
postgresql包含许多不同的包,包括第三方类库,通常安装最重要的包即可(能满足大部分应用需求)。这些包如下:
postgresql - 客户端类库及二进制文件
postgresql-server - 核心的数据库服务器
postgresql-contrib - 附加的供应组件
postgresql-devel - 用户C语言开发的类库和头文件
pgadmin3 - 数据库图像化管理工具第三版

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

在客户端机器上关闭防火墙和selinux,参见准备工作中的描述。

新建名称为 myrepo.repo 的软件源配置文件,内容如下:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [myrepo]
  2. name=myrepo
  3. baseurl=http:///cm5/redhat/6/x86_64/cm/5/
  4. enabled=1
  5. gpgcheck=0

其中为刚才安装Web服务器的主机名(或者ip),将 myrepo.repo保存到客户端机器的 /etc/yum.repos.d/目录,并删除这个目录下的其他*.repo文件,其他库有可能需要连接互联网,有可能使安装失败。这时 /etc/yum.repos.d 目录的清单如下:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [root@localhost yum.repos.d]# pwd
  2. /etc/yum.repos.d
  3. [root@localhost yum.repos.d]# ll
  4. total 4
  5. -rw-r—r— 1 root root 100 Jun 14 21:14 myrepo.repo
  6. [root@localhost yum.repos.d]#

设置了软件源还不够,还会从互联网上卸载一些配置文件,虽然软件源中包含了需要的所有文件,修改 /etc/hosts,在最后添加:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. archive.cloudera.com

其中为刚才安装Web服务器的主机名(或者ip)。完成了以上步骤,可以开始安装CM5了。

3、下载CM5安装文件

从 http://archive-primary.cloudera.com/cm5/installer/5.0.2.13/ 下载:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. cloudera-manager-installer.bin 11-Jun-2014 18:07 499K

实际上是安装引导文件,在安装过程中动态下载安装中需要的rpm包。

4、安装CM5

给 cloudera-manager-installer.bin 添加可执行权限:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

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

进行安装:

[javascript] view plain copy

在CODE上查看代码片 派生到我的代码片

  1. [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<img src=//blog.csdn.net/yangzhaohui168">

三、登录CM管理页面

使用用户名和密码都为admin登录 http://localhost:7180/ ,界面如下:

CM login FROM<img src=//blog.csdn.net/yangzhaohui168">

登录CM管理页面,进行相关的操作,后文详细描述Impala, Spark的离线安装方法。

原创作品,转载请注明出处:http://blog.csdn.net/yangzhaohui168/article/details/30118175

发表评论

表情:
评论列表 (有 0 条评论,253人围观)

还没有评论,来说两句吧...

相关阅读

    相关 安装Cloudera Manager

    cloudera manager有四大功能: (1)管理:对集群进行管理,如添加、删除节点等操作。 (2)监控:监控集群的健康情况,对设置的各种指标和系统运行