1. 环境信息如下:

ubuntu:14.10

jdk:openjdk-1.7.0

hadoop:2.6.0

2. 下载hadoop2.6.0, http://apache.fayea.com/hadoop/common/hadoop-2.6.0/hadoop-2.6.0.tar.gz

本文的$HADOOP_HOME为:/media/GoldenResources/localSoft/hadoop-2.6.0。

在 ~/.bashrc文件中添加环境变量,如下:

export HADOOP_HOME=/media/GoldenResources/localSoft/hadoop-2.6.0
export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

然后使配置生效,命令如下:

source ~/.bashrc

3. 安装JDK,并设置JAVA_HOME环境变量。在/etc/profile文件最后添加如下内容

export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386   //根据自己Java安装目录而定
export PATH=$JAVA_HOME/bin:$PATH

输入以下命令使配置生效

source /etc/profile

4. 配置SSH。首先生成秘钥,命令如下,然后一路回车确认,不需要任何输入。

ssh-keygen -t rsa

然后把公钥写入authorized_keys文件中,命令如下:

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

最后,输入下述命令,按提示输入 yes 即可,验证无密码访问是否成功。

ssh localhost

5. 修改Hadoop配置文件,进入${HADOOP_HOME}/etc/hadoop/目录。
1)修改core-site.xml,添加如下内容。

<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>

2)修改hdfs-site.xml,添加以下内容。

<property>
<name>dfs.repliacation</name>
<value>1</value>
</property>

3)将mapred-site.xml.template重命名为mapred-site.xml,并添加如下内容。

<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>

4)修改yarn-site.xml,添加以下内容。

<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>

6. 格式化HDFS,命令如下:

bin/hdfs namenode -format 注释:bin/hadoop namenode -format命令已过时

默认情况下,格式化成功会在/tmp/hadoop-${user.name}目录下创建dfs文件夹。

7.启动HDFS,命令如下:

sbin/start-dfs.sh

出现以下错误:

$sbin/start-dfs.sh
15/03/16 21:36:00 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [OpenJDK Server VM warning: You have loaded library /media/GoldenResources/localSoft/hadoop-2.6.0/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
localhost]
sed: -e 表达式 #1, 字符 8: “s”的未知选项↵
Server: ssh: Could not resolve hostname server: Name or service not known
-c: Unknown cipher type 'cd'
disabled: ssh: Could not resolve hostname disabled: Name or service not known
or: ssh: Could not resolve hostname or: Name or service not known
which: ssh: Could not resolve hostname which: Name or service not known
now.: ssh: Could not resolve hostname now.: Name or service not known
will: ssh: Could not resolve hostname will: Name or service not known
fix: ssh: Could not resolve hostname fix: Name or service not known
with: ssh: Could not resolve hostname with: Name or service not known
with: ssh: Could not resolve hostname with: Name or service not known
'execstack: ssh: Could not resolve hostname 'execstack: Name or service not known
recommended: ssh: Could not resolve hostname recommended: Name or service not known
that: ssh: Could not resolve hostname that: Name or service not known
OpenJDK: ssh: Could not resolve hostname openjdk: Name or service not known
noexecstack'.: ssh: Could not resolve hostname noexecstack'.: Name or service not known
'-z: ssh: Could not resolve hostname '-z: Name or service not known
It's: ssh: Could not resolve hostname it's: Name or service not known
<libfile>',: ssh: Could not resolve hostname <libfile>',: Name or service not known
it: ssh: Could not resolve hostname it: Name or service not known
link: ssh: Could not resolve hostname link: Name or service not known
have: ssh: Could not resolve hostname have: Name or service not known
have: ssh: Could not resolve hostname have: Name or service not known

参考 http://blog.csdn.net/xin_jmail/article/details/40556267中的解决方法,设置 HADOOP_COMMON_LIB_NATIVE_DIR和HADOOP_OPTS环境变量,在 ~/.bashrc文件中添加如下内容并编译。

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"

source ~/.bashrc

重新启动HDFS,输出如下,表示启动成功。

$start-dfs.sh
15/03/16 22:21:08 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [localhost]
localhost: starting namenode, logging to /media/GoldenResources/localSoft/hadoop-2.6.0/logs/hadoop-qunengrong-namenode-qunengrong-Studio-1450.out
localhost: starting datanode, logging to /media/GoldenResources/localSoft/hadoop-2.6.0/logs/hadoop-qunengrong-datanode-qunengrong-Studio-1450.out
Starting secondary namenodes [0.0.0.0]
0.0.0.0: starting secondarynamenode, logging to /media/GoldenResources/localSoft/hadoop-2.6.0/logs/hadoop-qunengrong-secondarynamenode-qunengrong-Studio-1450.out
15/03/16 22:21:33 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

可通过http://localhost:50070/ 来查看NameNode的运行状态

8. 启动Yarn,命令如下:

sbin/start-yarn.sh

可通过http://localhost:8088/cluster 来查看Application的执行状态

在Ubuntu14.10中部署Hadoop2.6.0单节点伪分布集群的更多相关文章

  1. Eclipse中部署hadoop2.3.0

    1 eclipse中hadoop环境部署概览 eclipse 中部署hadoop包括两大部分:hdfs环境部署和mapreduce任务执行环境部署.一般hdfs环境部署比较简单,部署后就 可以在ecl ...

  2. Hadoop2.6.0安装—单机/伪分布

    目录 环境准备 创建hadoop用户 更新apt 配置SSH免密登陆 安装配置Java环境 安装Hadoop Hadoop单机/伪分布配置 单机Hadoop 伪分布Hadoop 启动Hadoop 停止 ...

  3. 在Ubuntu下配置运行Hadoop2.4.0单节点配置

    还没有修改hosts,请先按前文修改. 还没安装java的,请按照前文配置. (1)增加用户并设立公钥: sudo addgroup hadoop sudo adduser --ingroup had ...

  4. Zookeeper3.4.6部署伪分布集群(Apache)

    1.下载Zookeeper http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/ 2.创建/usr/app/zookeeper目录,并切换 ...

  5. Hadoop 2.2.0单节点的伪分布集成环境搭建

    Hadoop版本发展历史 第一代Hadoop被称为Hadoop 1.0 1)0.20.x 2)0.21.x 3)0.22.x 第二代Hadoop被称为Hadoop 2.0(HDFS Federatio ...

  6. hadoop2.7【单节点】单机、伪分布、分布式安装指导

    问题导读 1.从本文部署实际部署,总结本地模式.伪分布.分布式的区别是什么?2.单机是否是伪分布?3.本地模式是否可以运行mapreduce? 来源:about云 http://www.aboutyu ...

  7. 二、Ubuntu14.04下安装Hadoop2.4.0 (伪分布模式)

    在Ubuntu14.04下安装Hadoop2.4.0 (单机模式)基础上配置 一.配置core-site.xml /usr/local/hadoop/etc/hadoop/core-site.xml ...

  8. centos6.10中部署percona-mysql双实例的方法

    centos6.10中部署percona-mysql双实例的方法 数据库的同步关系:192.168.11.53(master) --> slave(192.168.10.189) --> ...

  9. Hadoop2.2.0多节点分布式安装及测试

    众所周知,hadoop在10月底release了最新版2.2.很多国内的技术同仁都马上在网络上推出了自己对新版hadoop的配置心得.这其中主要分为两类: 1.单节点配置 这个太简单了,简单到只要懂点 ...

随机推荐

  1. 解决VS在高DPI下设计出的Winform程序界面变形问题

    在目前高分屏流行的情况下,windows缩放与布局仍然设置为100%就显得太小(特别是笔记本),通常会调整为125%或150%, VS在缩放与布局设置为非100%的时候,就会自动启动DPI感知模式,以 ...

  2. 小程序 - 分包加载上限8M(一)

    使用分包 配置方法 假设支持分包的小程序目录结构如下 ├── app.js ├── app.json ├── app.wxss ├── packageA │   └── pages │   ├── c ...

  3. oracle 中关于null的操作

    空值 空值一般用NULL表示 一般表示未知的.不确定的值,也不是空格 一般运算符与其进行运算时,都会为空 空不与任何值相等 表示某个列为空用:IS NULL  不能使用COMM=NULL这种形式 某个 ...

  4. greenplum表的distributed key值查看

    greenplum属于分布式的数据库,MPP+Share nothing的体系,查询的效率很快.不过,这是建立在数据分散均匀的基础上的.如果DK值设置不合理的话,完全有可能出现所有数据落在单个节点上的 ...

  5. React 同构开发(二)

    React 同构 所谓同构,简单的说就是客户端的代码可以在服务端运行,好处就是能极大的提升首屏时间,避免白屏,另外同构也给SEO提供了很多便利. React 同构得益于 React 的虚拟 DOM.虚 ...

  6. 关于ie8兼容性问题的处理

    1.replace将单引号变成双引号 var page=user.customConfig.replace(/\‘|’/ig,"\""); 兼容谷歌和ie var pag ...

  7. 如何下载Red Hat Enterprise Linux系统

    关于如何下载Red Hat Enterprise Linux系统? 这是一个既简单,又复杂的问题.简单是因为我以为她很简单,复杂是因为下载的过程有点复杂的. 相信去Oracle官网下载过东西的同学对下 ...

  8. Ubuntu 下常用的命令 简略记录

    # 动态显示 NVIDIA watch -n 1 nvidia-smi #查看某一目录下文件的总数(不包含子目录) ls -l | wc -l #挂载硬盘或者U盘 mount /dev/sdb1 /m ...

  9. 事务的编写规范与Hibernate绑定session

    一.事务的编写规范 1.事务的基本概念: 数据库事务(Database Transaction) ,是指作为单个逻辑工作单元执行的一系列操作,要么完全地执行,要么完全地不执行. 事务处理可以确保除非事 ...

  10. Android新手常见问题(一)

    [1]AAPT2 error: check logs for details File->Settings->Build->Gradle一看path里有中文 最根本的原因是因为use ...