采用伪分布模式安装和设置CDH,前提是已经安装了Java和SSH。

1. 下载hadoop-2.6.0-cdh5.9.0,复制到/opt/下,再解压;

2. 进入/opt/hadoop-2.6.0-cdh5.9.0/etc/hadoop/,在hadoop-env.sh中添加:

export JAVA_HOME=/opt/jdk1.8.0_121
export HADOOP_HOME=/opt/hadoop-2.6.0-cdh5.9.0

修改配置文件core-tite.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
--> <!-- Put site-specific property overrides in this file. --> <configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/tmp</value>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://192.168.1.104:9000</value>
</property>
</configuration>

其中hadoop.tmp.dir最好自己设置,不要采用默认的设置,因为默认的设置是在/tmp/下面,机器重启以后会被删除掉,造成Hadoop不能运行,要再次格式化NameNode才能运行。

hdfs-site.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
--> <!-- Put site-specific property overrides in this file. --> <configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.name.dir</name>
<value>/opt/hdfs/name</value>
</property>
<property>
<name>dfs.data.dir</name>
<value>/opt/hdfs/data</value>
</property>
<property>
<name>dfs.tmp.dir</name>
<value>/opt/hdfs/tmp</value>
</property>
</configuration>

mapred-site.xml:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
--> <!-- Put site-specific property overrides in this file. --> <configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapred.job.tracker</name>
<value>hdfs://192.168.1.104:9001</value>
</property>
</configuration>

3. 在/etc/profile后面加上:

export HADOOP_HOME=/opt/hadoop-2.6.0-cdh5.9.0
export PATH=$PATH:$HADOOP_HOME/bin

并且输入命令:

source /etc/profile

使设置生效。

4. 输入命令:

hadoop namenode -format

格式化NameNode,如果结果提示Successful表明格式化成功。

5. 进入/opt/hadoop-2.6.0-cdh5.9.0/etc/hadoop/sbin,输入命令:

./start-all.sh

启动Hadoop。为了检验是否启动成功,输入命令:

jps

如果结果包含了以下几个进程,则表明启动成功:

也可以在浏览器里面输入地址http://localhost:50070,检验是否启动成功:

CDH的安装和设置的更多相关文章

  1. CentOS7安装CDH 第五章:CDH的安装和部署-CDH5.7.0

    相关文章链接 CentOS7安装CDH 第一章:CentOS7系统安装 CentOS7安装CDH 第二章:CentOS7各个软件安装和启动 CentOS7安装CDH 第三章:CDH中的问题和解决方法 ...

  2. Hadoop的安装与设置(1)

    在Ubuntu下安装与设置Hadoop的主要过程. 1. 创建Hadoop用户 创建一个用户,用户名为hadoop,在home下创建该用户的主目录,就不详细介绍了. 2. 安装Java环境 下载Lin ...

  3. linux下MySQL安装及设置

    转自:http://www.entage.net/1/viewspace-25420 1. 关于本文    本文将以MySQL 5.0.51为例,以CentOS 5为平台,讲述MySQL数据库的安装和 ...

  4. Coudera-Manager/CDH的安装和部署

    由于之前部署的集群采用的是用apache hadoop的方式来实现,但是考虑到运维的成本问题,下面将apache hadoop转换成cloudera cdh.下面主要讲解一下cloudera cdh的 ...

  5. 在Ubuntu 12.04安装和设置Samba实现网上邻居共享

    转载:http://www.startos.com/ubuntu/tips/2012031333097.html          有微小改动. Samba 是一款功能强大的共享工具,可以实现与win ...

  6. RESTheart安装与设置

    作者:Maurizio Turatti, 最后在Feb 25, 2016时被 Andrea Di Cesare更新 安装与设置 1. 快速开始 Docker Vagrant Bare metal 2. ...

  7. cdh 上安装spark on yarn

    在cdh 上安装spark on yarn 还是比较简单的,不需要独立安装什么模块或者组件. 安装服务 选择on yarn 模式:上面 Spark 在spark 服务中添加 在yarn 服务中添加 g ...

  8. 安装、设置与启动MySql绿色版的方法

    原文:安装.设置与启动MySql绿色版的方法 1.解压 mysql-noinstall-5.1.30-win32.zip(下载地址http://dev.mysql.com/downloads/mysq ...

  9. ubuntu显卡驱动安装及设置

    转自: Ubuntu 14.04 Nvidia显卡驱动安装及设置   更换主板修复grub 引导后,无法从Nvidia进入系统(光标闪烁), 可能是显卡驱动出了问题. 1. 进入BIOS设置, 从集成 ...

随机推荐

  1. WordPress主题开发:加载脚本和样式

    如果只引入style.css,我把这个放头顶就可以了 <link rel="stylesheet" href="<?php echo get_styleshe ...

  2. sendto 和 recvfrom 函数

    sendto recvfrom

  3. HTML5学习笔记简明版(8):新增的全局属性

    contenteditable属性 不论什么元素使用contenteditable属性的话,代表该元素是一个可编辑的区域. 用户能够改变元素的内容以及操作标记.比如: <p contentedi ...

  4. IP视频通信中的"丢包恢复技术”(LPR)

    转自:http://blog.csdn.net/blade2001/article/details/9094709 在IP视频通话中,即使是在丢包率很小的情况下也会对使用效果造成较为明显的影响.正是由 ...

  5. algid parse error, not a sequence错误

    主要使用由于没有对使用openssl生成的公私密钥对进行pkcs8编码,导致程序无法识别参考支付宝.项目用用到RSA加密用openssl生成了一个公私密钥对,在对加密字符串进行数字签名的时候,程序一直 ...

  6. 通过pycharm使用git

    前言 使用git+pycharm有一段时间了,算是稍有点心得,这边整理一下,可能有的方法不是最优,欢迎交流,可能还是习惯敲命令去使用git,不过其实pycharm已经帮忙做了很多了,我们可以不用记住那 ...

  7. Reloading Java Classes 301: Classloaders in Web Development — Tomcat, GlassFish, OSGi, Tapestry 5 and so on Translation

    The Original link : http://zeroturnaround.com/rebellabs/rjc301/ Copyright reserved by Rebel Inc In t ...

  8. RSA加密解密及RSA签名和验证及证书

    RSA加密解密及RSA签名和验证及证书 公钥是给别人的 发送密文使用公钥加密 验证签名使用公钥验证 私钥是自己保留的 接受密文使用私钥解密 发送签名使用私钥签名 上述过程逆转是不行的,比如使用私钥加密 ...

  9. 一种开源的分布式消息系统Nats

    一种开源的分布式消息系统Nats 作者:chszs.未经博主同意不得转载.经许可的转载需注明作者和博客主页:http://blog.csdn.net/chszs 1.NATS介绍 NATS是一个开源的 ...

  10. 解析eml文件

    之前使用lumisoft解析eml,总是会出现很奇怪的问题,所以改使用微软自家的com库,确实厉害兼容性更好,代码 string file = emailPath; CDO.Message oMsg ...