CDH5.2安装 一
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CDH5.2安装 一相关的知识,希望对你有一定的参考价值。
配置 CDH 本地 YUM
1. 解压介质到本地
[[email protected] CDH]# tar zxvf cm5.2.0-centos6.tar.gz
2. 创建软连接
[[email protected] CDH]# mv cm /opt/
[[email protected] opt]# ln -s /opt/cm /var/www/html/cm_yum
3. 验证
启动 http 服务
[[email protected] yum.repos.d]# service httpd start
[[email protected] yum.repos.d]# chkconfig httpd on
[[email protected] yum.repos.d]# chkconfig | grep httpd
httpd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
http://192.168.109.10/cm_yum/能访问即可
4. 创建 repo 文件,索引文件
[[email protected] yum.repos.d]# createrepo -v /opt/cm/
[[email protected] opt]# cd /etc/yum.repos.d/
vim CDH5.2repo
[cloudera-cdh5]
name=cloudera-cdh5.2
baseurl=http://192.168.109.10/cm_yum/5.2.0/
gpgcheck=0
enable=1
配置 java 环境
1.卸载系统自带OPENJDK
[[email protected] 5.2.0]# rpm -qa|grep openjdk
java-1.6.0-openjdk-devel-1.6.0.35-1.13.7.1.el6_6.x86_64
java-1.7.0-openjdk-devel-1.7.0.79-2.5.5.4.el6.x86_64
java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64
java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
java-1.6.0-openjdk-javadoc-1.6.0.35-1.13.7.1.el6_6.x86_64
[[email protected] 5.2.0]# rpm -e --nodeps java-1.6.0-openjdk-devel-1.6.0.35-1.13.7.1.el6_6.x86_64
[[email protected] 5.2.0]# rpm -e --nodeps java-1.7.0-openjdk-devel-1.7.0.79-2.5.5.4.el6.x86_64
[[email protected] 5.2.0]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64
[[email protected] 5.2.0]# rpm -e --nodeps java-1.6.0-openjdk-javadoc-1.6.0.35-1.13.7.1.el6_6.x86_64
[[email protected] 5.2.0]# rpm -qa|grep openjdk
java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
[[email protected] 5.2.0]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
[[email protected] 5.2.0]# rpm -qa|grep openjdk
[[email protected] 5.2.0]#
2.安装jdk
[[email protected] CDH]# rpm -ivh jdk-7u67-linux-x64.rpm
Preparing... ########################################### [100%]
1:jdk ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
jfxrt.jar...
[[email protected] CDH]#
3.配置环境变量
[[email protected] ~]# vim /etc/profile
###############################
## java
##
###############################
JAVA_HOME=/usr/java/jdk1.7.0_67
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/jt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME PATH CLASSPATH
4.使环境变量配置生效,查看java版本
[[email protected] ~]# source /etc/profile
[[email protected] ~]# java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
[[email protected] ~]#
配置主机信息
1.配置主机名
[[email protected] ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=master
2.配置hosts
[[email protected] ~]# vim /etc/hosts
192.168.109.10 master
192.168.109.11 slave1
192.168.109.12 slave2
[[email protected] ~]# service network restart
正在关闭接口 eth0: [确定]
正在关闭接口 eth1: 设备状态:3 (断开连接)
[确定]
正在关闭接口 eth2: 设备状态:3 (断开连接)
[确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth1: 活跃连接状态:激活的
活跃连接路径:/org/freedesktop/NetworkManager/ActiveConnection/9
[确定]
弹出界面 eth2: 活跃连接状态:激活的
活跃连接路径:/org/freedesktop/NetworkManager/ActiveConnection/10
[确定]
[[email protected] ~]# ping master
PING master (192.168.109.10) 56(84) bytes of data.
64 bytes from master (192.168.109.10): icmp_seq=1 ttl=64 time=0.099 ms
64 bytes from master (192.168.109.10): icmp_seq=2 ttl=64 time=0.035 ms
^Z
[1]+ Stopped ping master
[[email protected] ~]# hostname
master
[[email protected] ~]#
配置SSH互信
生成公匙文件
ssh-keygen -t rsa(所有节点)
整合公匙文件(master)
ssh master cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh slave1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh slave2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
分发整合后的公匙文件到各个节点(master)
scp ~/.ssh/authorized_keys slave1:~/.ssh/
scp ~/.ssh/authorized_keys slave2:~/.ssh/
测试互信(所有节点)不需要输入密码即配置成功
ssh master
ssh slave1
ssh slave2
以上是关于CDH5.2安装 一的主要内容,如果未能解决你的问题,请参考以下文章