Cloudera Manager安装之利用parcels方式安装单节点集群(包含最新稳定版本或指定版本的安装)(添加服务)(CentOS6.5)(四)
前期博客
Cloudera Manager安装之Cloudera Manager 5.3.X安装(三)(tar方式、rpm方式和yum方式)
说在前面的话(看清楚就好!!!)
我这篇博客,是两种方式都使用过:(在/etc/yum.repos.d下的)
[hadoop@clouderamanager01 yum.repos.d]$ sudo vi cloudera-manager.repo [hadoop@clouderamanager02 yum.repos.d]$ sudo vi cloudera-manager.repo [hadoop@clouderamanager03 yum.repos.d]$ sudo vi cloudera-manager.repo
即(博主我推荐用这种!!!)(但是不需)
[cloudera-manager] # Packages for Cloudera Manager, Version 5, on RedHat or CentOS 6 x86_64 name=Cloudera Manager baseurl=https://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.3.6/ gpgkey =https://archive.cloudera.com/cm5/redhat/6/x86_64/cm/RPM-GPG-KEY-cloudera gpgcheck = 1
或者(但是,需要自定义存储库)
[cloudera-manager] # Packages for Cloudera Manager, Version 5, on RedHat or CentOS 6 x86_64 name=Cloudera Manager baseurl=https://clouderamanager01/cm5/redhat/6/x86_64/cm/5.3.6/
enabled = 1 gpgcheck = 1
我这里是,使用CM 5.3.x利用parcels方式集群安装CDH 5.3.x单节点集群!(开始开工)
下载CDH离线包
http://archive.cloudera.com/cdh5/parcels/
我这里,是选择5.3.6版本
http://archive.cloudera.com/cdh5/parcels/5.3.6/CDH-5.3.6-1.cdh5.3.6.p0.11-el6.parcel http://archive.cloudera.com/cdh5/parcels/5.3.6/CDH-5.3.6-1.cdh5.3.6.p0.11-el6.parcel.sha1 http://archive.cloudera.com/cdh5/parcels/5.3.6/manifest.json
以下是clouderamanager01这台机器上(主节点)
[hadoop@clouderaManager01 softwares]$ pwd /opt/softwares [hadoop@clouderaManager01 softwares]$ ll total 4 drwxr-xr-x 2 hadoop hadoop 4096 Apr 8 13:49 cm-5.3.6 [hadoop@clouderaManager01 softwares]$ sudo mkdir cdh-5.3.6 [hadoop@clouderaManager01 softwares]$ ll total 8 drwxr-xr-x 2 root root 4096 Apr 8 20:00 cdh-5.3.6 drwxr-xr-x 2 hadoop hadoop 4096 Apr 8 13:49 cm-5.3.6 [hadoop@clouderaManager01 softwares]$ cd cdh-5.3.6/ [hadoop@clouderaManager01 cdh-5.3.6]$ pwd /opt/softwares/cdh-5.3.6 [hadoop@clouderaManager01 cdh-5.3.6]$ ll total 0 [hadoop@clouderaManager01 cdh-5.3.6]$ sudo rz [hadoop@clouderaManager01 cdh-5.3.6]$ sudo rz [hadoop@clouderaManager01 cdh-5.3.6]$ sudo rz [hadoop@clouderaManager01 cdh-5.3.6]$ ll total 1473900 -rw-r--r-- 1 root root 1509217191 Apr 7 19:38 CDH-5.3.6-1.cdh5.3.6.p0.11-el6.parcel.html -rw-r--r-- 1 root root 41 Apr 7 19:24 CDH-5.3.6-1.cdh5.3.6.p0.11-el6.parcel.sha1 -rw-r--r-- 1 root root 42661 Apr 7 19:24 manifest.json [hadoop@clouderaManager01 cdh-5.3.6]$
以下是clouderamanager01这台机器上安装之后,默认产生的(在这里,你看看就好)
[hadoop@clouderaManager01 opt]$ pwd /opt [hadoop@clouderaManager01 opt]$ ll total 16 drwxr-xr-x 4 cloudera-scm cloudera-scm 4096 Apr 8 18:31 cloudera drwxr-xr-x 2 root root 4096 Apr 8 18:13 cloudera-manager drwxr-xr-x. 2 root root 4096 Nov 22 2013 rh drwxr-xr-x 4 hadoop hadoop 4096 Apr 8 20:00 softwares [hadoop@clouderaManager01 opt]$ cd cloudera [hadoop@clouderaManager01 cloudera]$ ll total 8 drwxr-xr-x 2 cloudera-scm cloudera-scm 4096 Jul 30 2015 csd drwxr-xr-x 2 cloudera-scm cloudera-scm 4096 Jul 30 2015 parcel-repo [hadoop@clouderaManager01 cloudera]$ cd parcel-repo/ [hadoop@clouderaManager01 parcel-repo]$ pwd /opt/cloudera/parcel-repo [hadoop@clouderaManager01 parcel-repo]$ ll total 0 [hadoop@clouderaManager01 parcel-repo]$
或者,有时候,安装CM完成后,出现:
以下是clouderamanager01这台机器上安装之后,默认产生的(在这里,你看看就好)
[hadoop@clouderamanager01 opt]$ pwd /opt [hadoop@clouderamanager01 opt]$ ll total 8 drwxr-xr-x 4 cloudera-scm cloudera-scm 4096 Apr 8 22:48 cloudera drwxr-xr-x. 3 hadoop hadoop 4096 Apr 8 11:20 softwares [hadoop@clouderamanager01 opt]$ cd cloudera/ [hadoop@clouderamanager01 cloudera]$ ll total 8 drwxr-xr-x 2 cloudera-scm cloudera-scm 4096 Mar 20 11:24 csd drwxr-xr-x 2 cloudera-scm cloudera-scm 4096 Mar 20 11:24 parcel-repo [hadoop@clouderamanager01 cloudera]$
关于/opt/cloudera/parcel-repo和/opt/cloudera/parcel(必须弄懂,别怕)
192.168.80.148 clouderamanager01 (部署ClouderaManager-server和Mirror server) (部署Agent) (分配1G,我这里只是体验过程,当然你可以分配更多或更小)
192.168.80.149 clouderamanager02 (部署Agent) (分配1G,我这里只是体验过程,当然你可以分配更多或更小)
192.168.80.150 clouderamanager03 (部署Agent)
部署ClouderaManager-server和Mirror server的机器,默认是存储在/opt/cloudera/parcel-repo。
部署Agent的机器,默认是存储在/opt/cloudera/parcel。
即,这也是为什么,我在下面这篇博客里写到。
Cloudera Manager安装之Cloudera Manager 5.3.X安装(三)(tar方式、rpm方式和yum方式)
博客里,提及到的tar方式来安装。
我这篇博文,是安装单节点集群,是在clouderamanager01上。因为,它是安装了ClouderaManager-server和Mirror server的机器。
所以,默认是存在/opt/cloudera/parcel-repo。(因为,我是在这个做主节点的!,也是为了后续的3节点集群准备)
http://clouderamanager01:7180/cmf/home
[hadoop@clouderaManager01 yum.repos.d]$ sudo service cloudera-scm-server status cloudera-scm-server (pid 5533) is running... [hadoop@clouderaManager01 yum.repos.d]$ sudo service cloudera-scm-server restart Stopping cloudera-scm-server: [ OK ] Starting cloudera-scm-server: [ OK ] [hadoop@clouderaManager01 yum.repos.d]$
http://clouderamanager01:7180/cmf/login
选择集群中的主机,这里选择所有主机。
这步选择CDH安装包,进入这个页面是,系统自动识别本地parcel包了。如果不识别,则可以点击上面更多选择里面到对应的目录把正确的本地路径地址和远程url地址路径填上即可。
注意:默认是最新的稳定版本!
http://archive.cloudera.com/cdh5/parcels/latest/
其实呢,在安装过程中,我们可以用默认的。但是,我这里选择用5.3.6。
http://archive.cloudera.com/cdh5/parcels/5.3.6/
同时,注意这两个地方
Parcel 目录,默认是/opt/cloudera/parcels(即clouderaManager02、即clouderaManager03机器)
但是呢。不更改,也可以正常安装!
填入,就是这里的值!
clouderaManager01/cm5/redhat/6/x86_64/cm/5.3.6/
其实啊,这一步的ssh,我之前已经配置过了,这里还是最好再自动配置吧!即勾选上。
在安装过程中,出现如下问题
[hadoop@clouderaManager01 html]$ pwd /var/www/html [hadoop@clouderaManager01 html]$ ll total 4 drwxr-xr-x 3 root root 4096 Apr 8 20:37 cm5 [hadoop@clouderaManager01 html]$ sudo mkdir -p cm5/redhat/6/x86_64/cm/5.3.6/repodata [hadoop@clouderaManager01 html]$ ll total 4 drwxr-xr-x 3 root root 4096 Apr 8 20:37 cm5 [hadoop@clouderaManager01 html]$ cd cm5/redhat/6/x86_64/cm/5.3.6/repodata/ [hadoop@clouderaManager01 repodata]$ pwd /var/www/html/cm5/redhat/6/x86_64/cm/5.3.6/repodata [hadoop@clouderaManager01 repodata]$ ll total 0 [hadoop@clouderaManager01 repodata]$
[hadoop@clouderaManager01 repodata]$ pwd /var/www/html/cm5/redhat/6/x86_64/cm/5.3.6/repodata [hadoop@clouderaManager01 repodata]$ sudo rz [hadoop@clouderaManager01 repodata]$ sudo rz [hadoop@clouderaManager01 repodata]$ sudo rz [hadoop@clouderaManager01 repodata]$ sudo rz [hadoop@clouderaManager01 repodata]$ sudo rz [hadoop@clouderaManager01 repodata]$ sudo rz [hadoop@clouderaManager01 repodata]$ sudo rz [hadoop@clouderaManager01 repodata]$ sudo rz [hadoop@clouderaManager01 repodata]$ ll total 124 -rw-r--r-- 1 root root 91122 Apr 7 22:36 filelists.xml.gz -rw-r--r-- 1 root root 198 Apr 7 22:36 filelists.xml.gz.asc -rw-r--r-- 1 root root 570 Apr 7 22:36 other.xml.gz -rw-r--r-- 1 root root 198 Apr 7 22:36 other.xml.gz.asc -rw-r--r-- 1 root root 4208 Apr 7 22:37 primary.xml.gz -rw-r--r-- 1 root root 198 Apr 7 22:37 primary.xml.gz.asc -rw-r--r-- 1 root root 951 Apr 7 22:37 repomd.xml -rw-r--r-- 1 root root 198 Apr 7 22:37 repomd.xml.asc [hadoop@clouderaManager01 repodata]$
集群安装
因为这里所需要的软件包我们之前都已经安装过了,这一步会很快结束。
如果还是没解决的话,那就换成在线的吧!(哎)
[cloudera-manager] # Packages for Cloudera Manager, Version 5, on RedHat or CentOS 6 x86_64 name=Cloudera Manager baseurl=https://archive.cloudera.com/cm5/redhat/6/x86_64/cm/5.3.6/ gpgkey =https://archive.cloudera.com/cm5/redhat/6/x86_64/cm/RPM-GPG-KEY-cloudera gpgcheck = 1
然后,接着下面
重复,执行上面的过程。这里省略,.....
直至如下界面.....
安装Parcel到所有主机上(我这里是clouderaManager02这台机器上)
因为Parcel文件已经提前下载好了,第一个进度条会直接显示已下载,然后开始分配。这个过程实际上就是将Parcel内的软件解压缩安装到各个主机上的过程。耐心等待,时间会比较长,我安装1台主机(即在clouderaManager02这台,安装单节点集群)大概是需要5分钟时间。(这里看个人的网速和内存有关)
其实啊,这里分配就是解压。
安装完毕后点继续
主机检查
检查就可以了,建议不要跳过。检查结果如下:
这里, 是必须得所有不能出现黄色警告!
安装完成之后,再安装所需的服务(其实,这一步,若你的内存和空间足够,最好选择所有服务)
其实啊,这步是选择集群中要安装的CDH服务,为了将来新增服务麻烦,我们这里选择所有服务。其中有暂时用不到的服务,我们可以在界面中停止服务,这样可以节省内存资源
这里,添加Cloudera Management Service服务
然后,关于安装其他的,如Zookeeper、Hive、HBase和Spakr、Hadoop等。这些。我就不赘述了。
或者,你可以。CDH5提供了你可能需要的各种服务,需要什么启动什么就行了。这里我选择了自定义,添HBase,HDFS,Hive,MapReduce,ZooKeeper,Spark等添加这里大家按照自己的需求选。
换图
角色分配
分配各个节点的角色
数据库设置
我这里,故意先是,选择使用嵌入式数据库,只是做个示范而已。点击测试连接,成功后点继续。
但是,若是实际生产环境中,最好还是用自定义数据库,我这里只是玩玩而已。(记得截图,以便为了看密码)
同时,注意,我的clouderaManager01仅仅只是安装了CM而已,当前要到clouderaManager02上去。
所以,CDH默认内嵌了一个数据库,无法通过。我这里选择需要MySQL或者Oracle请选择使用自定义数据库,
比如Hive, oozie 元数据库配置,使用我们安装的mysql来存放元数据,其中数据库名,用户名和密码需要预先创建好的。这里。请移步
需要之前就创建好,请移步
注意,这里,gaiwei
mysql> GRANT ALL PRIVILEGES ON *.* to 'hive'@'
clouderaManager02
' IDENTIFIED BY 'hive_password' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* to 'oozie'@'clouderaManager02' IDENTIFIED BY 'oozie_password' WITH GRANT OPTION;
如果中间出错误了,则如下这样,删除就好
[hadoop@clouderaManager02 ~]$ sudo rpm -qa|grep mysql mysql-server-5.1.73-8.el6_8.x86_64 mysql-5.1.73-8.el6_8.x86_64 mysql-libs-5.1.73-8.el6_8.x86_64 [hadoop@clouderaManager02 ~]$ sudo rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64 error: package mysql-libs-5.1.71-1.el6.x86_64 is not installed [hadoop@clouderaManager02 ~]$ sudo rpm -e --nodeps mysql-server-5.1.73-8.el6_8.x86_64 warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave [hadoop@clouderaManager02 ~]$ sudo rpm -e --nodeps mysql-5.1.73-8.el6_8.x86_64 [hadoop@clouderaManager02 ~]$ sudo rpm -e --nodeps mysql-libs-5.1.73-8.el6_8.x86_64 [hadoop@clouderaManager02 ~]$ sudo rpm -qa|grep mysql [hadoop@clouderaManager02 ~]$
审核更改
这里全部默认就可以了,直接继续。
安装完成,初始化
到这里集群已经安装部署完成了,CDH会自动对你选择的服务进行初始化设置,你也可以稍后自行开启。
初始化完成后,将进入主页面
常见错误
[hadoop@clouderaManager01 parcel-repo]$ sudo service cloudera-scm-server restart ./cloudera-scm-server: line 109: pstree: command not found Starting cloudera-scm-server: [ OK ]
主要因为没有安装pstree包。
解决办法:
[hadoop@clouderaManager01 parcel-repo]$ sudo yum install epel-release (安装yum 源)
[hadoop@clouderaManager01 parcel-repo]$ sudo yum provides pstree (找到提供pstree命令的包)
[hadoop@clouderaManager01 parcel-repo]$ sudo yum install psmisc (安装对应的包)
然后,
[hadoop@clouderaManager01 parcel-repo]$ sudo service cloudera-scm-server restart
Stopping cloudera-scm-server: [ OK ]
Starting cloudera-scm-server: [ OK ]
Detecting Cloudera Manager Server... Detecting Cloudera Manager Server... BEGIN host -t PTR 192.168.1.198 198.1.168.192.in-addr.arpa domain name pointer localhost. END (0) using localhost as scm server hostname BEGIN which python /usr/bin/python END (0) BEGIN python -c 'import socket; import sys; s = socket.socket(socket.AF_INET); s.settimeout(5.0); s.connect((sys.argv[1], int(sys.argv[2]))); s.close();' localhost 7182 Traceback (most recent call last): File "<string>", line 1, in <module> File "<string>", line 1, in connect socket.error: [Errno 111] Connection refused END (1) could not contact scm server at localhost:7182, giving up waiting for rollback request
解决办法:
在失败的主机上,终端执行
sudo mv /usr/bin/host /usr/bin/host.bak
然后重试。
安装过程一直卡在"正在获取安装锁"状态界面
解决办法:
在卡住的主机上,删除/tmp文件夹中的所有scm_prepare_node.开头的文件,清空yum缓存,然后重启主机。
sudo cd /tmp sudo rm -rf scm_prepare_node.* sudo yum clean all sudo reboot
安装完毕后NameNode格式化失败,报以下错误
IncorrectVersionException: Unexpected version of storage directory /data/dfs
解决办法:
删除NameNode节点的/data/dfs文件夹,重新添加主机。
如何更改节点ip
解决办法:
重新设置每台主机的hosts文件,完成后进入主机界面,点击重新运行升级向导,再走一遍之前的流程即可。
参考链接
http://www.mamicode.com/info-detail-1596233.html
http://www.jianshu.com/p/57179e03795f
http://www.aboutyun.com/thread-20741-1-1.html
若您想搭建多节点集群,请移步
Cloudera Manager安装之利用parcels方式安装3节点集群(包含最新稳定版本或指定版本的安装)(添加服务)