Centos6.5安装配置Cloudera Manager CDH5.6.0 Hadoop
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos6.5安装配置Cloudera Manager CDH5.6.0 Hadoop相关的知识,希望对你有一定的参考价值。
环境规划
操作系统版本:CentOS-6.5-x86_64-minimal.iso
192.168.253.241 master 虚拟机4G内存
192.168.253.242 slave1 虚拟机2G内存
192.168.253.243 slave2 虚拟机2G内存
一、环境初始化
1、修改主机名(每台机器都执行)
192.168.253.241 master 192.168.253.242 slave1 192.168.253.243 slave2
2、主机名解析(每台机器都执行)
echo ‘‘‘ 192.168.253.241 master 192.168.253.242 slave1 192.168.253.243 slave2 ‘‘‘ >>/etc/hosts
3、ssh无密码登录
#主机:master执行命令
[[email protected] ~]# ssh-keygen -t rsa [[email protected] ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] [[email protected] ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] [[email protected] ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
4、关闭iptables规则(每台机器都执行)
[[email protected] opt]#service iptables stop && chkconfig iptables off
5、安装jdk软件及配置jdk环境(每台机器都执行)
[[email protected] soft]# cd /root/soft/ #JDK下载:http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u80-oth-JPR/jdk-7u80-linux-x64.rpm [[email protected] soft]# rpm -ihv jdk-7u80-linux-x64.rpm [[email protected] soft]# vim /etc/profile #文件末尾增加下面内容 export JAVA_HOME=/usr/java/default export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/bin #刷新环境变量 [[email protected] soft]# source /etc/profile && java -version
6、修改内核参数(每台机器都执行)
echo 0 > /proc/sys/vm/swappiness
7、master节点安装mysql(master上执行)
[[email protected] soft]# yum install -y http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm [[email protected] soft]# yum install -y Percona-Server-shared-compat [[email protected] soft]# yum install -y Percona-Server-server-55 Percona-Server-client-55 [[email protected] soft]# service mysql start [[email protected] soft]# mysql -u root -p mysql> grant all on *.* to [email protected]‘localhost‘ identified by ‘123456‘; Query OK, 0 rows affected (0.00 sec) mysql> grant all on *.* to [email protected]‘127.0.0.1‘ identified by ‘123456‘; Query OK, 0 rows affected (0.00 sec) mysql> delete from user where password=‘‘; Query OK, 4 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
二、正式开始安装
1、cloudera manager默认的目录是在/opt下,解压到/opt目录下。 (master上执行)
[[email protected] soft]# cd /root/soft/ [[email protected] soft]# wget http://archive-primary.cloudera.com/cm5/cm/5/cloudera-manager-el6-cm5.6.0_x86_64.tar.gz [[email protected] soft]# tar zxvf cloudera-manager-el6-cm5.6.0_x86_64.tar.gz -C /opt/ [[email protected] opt]# ll total 8 drwxr-xr-x 4 1106 592 4096 Feb 12 12:05 cloudera drwx------ 5 root root 4096 Mar 1 14:09 cm-5.6.0
#安装mysql-connector-java
[[email protected] soft]# yum -y install mysql-connector-java [[email protected] soft]# rpm -e java-1.5.0-gcj --nodeps #卸载java老版本
2、初始化数据库
[[email protected] opt]# /opt/cm-5.6.0/share/cmf/schema/scm_prepare_database.sh mysql cm -hlocalhost -uroot -p123456 --scm-host localhost scm scm scm [[email protected] opt]# mysql -uroot -p123456 -e "show databases;" #查看下cm数据库是否创建成功
#修改配置文件server_host为master节点的主机名
[[email protected] soft]# sed -i ‘s/server_host=localhost/server_host=master/g‘ /opt/cm-5.6.0/etc/cloudera-scm-agent/config.ini [[email protected] soft]# scp -rp /opt/cm-5.6.0 slave1:/opt/ [[email protected] soft]# scp -rp /opt/cm-5.6.0 slave2:/opt/
#每台服务器执行创建系统用户(以master为例)
[[email protected] soft]# useradd --system --home=/opt/cm-5.6.0/run/cloudera-scm-server --no-create-home --shell=/bin/false --comment "cloudera scm user" cloudera-scm
3、数据库的配置
[[email protected] soft]# mysql -u root -p123456 #hive create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci; #active monitor create database amon DEFAULT CHARSET utf8 COLLATE utf8_general_ci; #授权master主机 grant all on *.* to ‘root‘@‘master‘ identified by ‘PASSWD‘;
4、准备parcels安装包到/opt/cloudera/parcel-repo/
#CDH 5.6.0下载: [[email protected] parcel-repo]#wget http://archive-primary.cloudera.com/cdh5/parcels/5.6.0/CDH-5.6.0-1.cdh5.6.0.p0.45-el6.parcel [[email protected] parcel-repo]#wget http://archive-primary.cloudera.com/cdh5/parcels/5.6.0/CDH-5.6.0-1.cdh5.6.0.p0.45-el6.parcel.sha1 [[email protected] parcel-repo]#wget http://archive-primary.cloudera.com/cdh5/parcels/5.6.0/manifest.json [[email protected] parcel-repo]#mv CDH-5.6.0-1.cdh5.6.0.p0.45-el6.parcel.sha1 CDH-5.6.0-1.cdh5.6.0.p0.45-el6.parcel.sha
5、启动服务
#启动master节点的server和agent脚本
/opt/cm-5.6.0/etc/init.d/cloudera-scm-agent start /opt/cm-5.6.0/etc/init.d/cloudera-scm-server start
#启动客户端节点的agent脚本
/opt/cm-5.6.0/etc/init.d/cloudera-scm-agent start
#server端口启动较慢,一定要检查7180和7182端口起来好才算ok
[[email protected] parcel-repo]# netstat -tunlp|grep java tcp 0 0 0.0.0.0:7180 0.0.0.0:* LISTEN 14644/java tcp 0 0 0.0.0.0:7182 0.0.0.0:* LISTEN 14644/java
三、CDH5安装配置
1. 访问192.168.253.241:7180开始安装(登陆名:admin 密码:admin)
2.同意协议
3.选择一个版本进行安装,此处选择第一个免费版。
4. 感谢您选择 Cloudera Manager 和 CDH。
5.为CDH群集安装指定主机
6. 群集安装
7.正在安装选定Parcel
8. 检查主机正确性
9. 选择您要在群集上安装的CDH5服务
10.自定义角色分配
窗体顶端您可在此处自定义新群集的角色分配,但如果分配不正确(例如,分配到某个主机上的角色太多)会影响服务性能。除非您有特殊需求,如已为特定角色预先选择特定主机,否则 Cloudera 不建议改变分配情况。
11. 数据库设置
12. 审核更改
13. 首次运行
14.完成后的登陆界面
备注:以前部署Hadoop集群都是源码编译的,安装配置不是很方便,在了解Cloudera Manager CDH以后,感觉CM管理很方便。不过在安装过程中,也遇到了不少问题,也问了很多朋友,最终终于搞定了。为了让新手能够更快地上手学习Hadoop,所以我在这里写上了详细的安装配置文档,供大家学习,相互进步。
本文出自 “成都@阿状” 博客,请务必保留此出处http://azhuang.blog.51cto.com/9176790/1748432
以上是关于Centos6.5安装配置Cloudera Manager CDH5.6.0 Hadoop的主要内容,如果未能解决你的问题,请参考以下文章