标签:
配置 CDH 本地 YUM
1. 解压介质到本地
[root@localhost CDH]# tar zxvf cm5.2.0-centos6.tar.gz
2. 创建软连接
[root@localhost CDH]# mv cm /opt/
[root@localhost opt]# ln -s /opt/cm /var/www/html/cm_yum
3. 验证
启动 http 服务
[root@localhost yum.repos.d]# service httpd start
[root@localhost yum.repos.d]# chkconfig httpd on
[root@localhost yum.repos.d]# chkconfig | grep httpd
httpd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
http://192.168.109.10/cm_yum/能访问即可
4. 创建 repo 文件,索引文件
[root@localhost yum.repos.d]# createrepo -v /opt/cm/
[root@localhost 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
[root@localhost 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
[root@localhost 5.2.0]# rpm -e --nodeps java-1.6.0-openjdk-devel-1.6.0.35-1.13.7.1.el6_6.x86_64
[root@localhost 5.2.0]# rpm -e --nodeps java-1.7.0-openjdk-devel-1.7.0.79-2.5.5.4.el6.x86_64
[root@localhost 5.2.0]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64
[root@localhost 5.2.0]# rpm -e --nodeps java-1.6.0-openjdk-javadoc-1.6.0.35-1.13.7.1.el6_6.x86_64
[root@localhost 5.2.0]# rpm -qa|grep openjdk
java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
[root@localhost 5.2.0]# rpm -e --nodeps java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
[root@localhost 5.2.0]# rpm -qa|grep openjdk
[root@localhost 5.2.0]#
2.安装jdk
[root@localhost 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...
[root@localhost CDH]#
3.配置环境变量
[root@localhost ~]# 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版本
[root@localhost ~]# source /etc/profile
[root@localhost ~]# 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)
[root@localhost ~]#
配置主机信息
1.配置主机名
[root@localhost ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=master
2.配置hosts
[root@localhost ~]# vim /etc/hosts
192.168.109.10 master
192.168.109.11 slave1
192.168.109.12 slave2
[root@localhost ~]# service network restart
正在关闭接口 eth0: [确定]
正在关闭接口 eth1: 设备状态:3 (断开连接)
[确定]
正在关闭接口 eth2: 设备状态:3 (断开连接)
[确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth1: 活跃连接状态:激活的
活跃连接路径:/org/freedesktop/NetworkManager/ActiveConnection/9
[确定]
弹出界面 eth2: 活跃连接状态:激活的
活跃连接路径:/org/freedesktop/NetworkManager/ActiveConnection/10
[确定]
[root@localhost ~]# 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
[root@localhost ~]# hostname
master
[root@localhost ~]#
配置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
标签:
原文地址:http://www.cnblogs.com/xhwangspark/p/5509956.html