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. Canvas 同心圆旋转示例解析

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. ASP.NET Core中Middleware的使用

    https://www.cnblogs.com/shenba/p/6361311.html   ASP.NET 5中Middleware的基本用法 在ASP.NET 5里面引入了OWIN的概念,大致意 ...

  3. 记.net 遇到的几个bug

    这两个bug都是查了挺久才查到的,随手记是个好习惯. 1.public static CultureInfo GetCultureInfo(string name); 方法,传参错误时,某些操作系统环 ...

  4. 用hashmap实现redis有什么问题

    1.容量问题 hashmap是有最大容量的 2.时效问题 redis可以持久化,也可以定时时间 hashmap不可以持久化 3.线程并发问题 hashmap不是线程安全的(并且:多线程同时调用hash ...

  5. nginx常用配置2

    ## 一.Nginx中虚拟主机配置 ### 1.基于域名的虚拟主机配置 1.修改宿主机的hosts文件(系统盘/windows/system32/driver/etc/HOSTS) ​ linux : ...

  6. [原]SuperMap GIS(JavaScript) 拉框放大和缩小功能实现

    版权声明:本文为博主原创文章,未经博主允许不得转载. var ZoomControl; /* * 拉框缩小 */ function ZoomOut(){ if(ZoomControl==null||Z ...

  7. 如何获取select中的value、text、index相关值 && 如何获取单选框中radio值 && 触发事件 && radio 默认选中

    如何获取select中的value.text.index相关值 select还是比较常用的一个标签,如何获取其中的内容呢? 如下所示: <select id="select" ...

  8. Netty构建Http服务器

    Netty 是一个基于 JAVA NIO 类库的异步通信框架,它的架构特点是:异步非阻塞.基于事件驱动.高性能.高可靠性和高可定制性.换句话说,Netty是一个NIO框架,使用它可以简单快速地开发网络 ...

  9. JSP页面GET传值乱码问题

    两个JSP页面进行GET传值的时候.两个页面的编码都是UTF-8,且传值之前设置response的content为UTF-8也解决不了问题. 设置tomcat的配置文件server.xml:在Conn ...

  10. unity远程修改游戏配置

    关于修改游戏配置这点,如果pc还好 但是在移动端,比较麻烦,比如游戏换ip地址了,可能需要重新打包了 那能不能动态修改,这里有个思路 以udp举例 在客户端里面写一个udp服务,在游戏第一界面打开,比 ...