在Ubuntu14.10中部署Hadoop2.6.0单节点伪分布集群
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单节点伪分布集群的更多相关文章
- Eclipse中部署hadoop2.3.0
1 eclipse中hadoop环境部署概览 eclipse 中部署hadoop包括两大部分:hdfs环境部署和mapreduce任务执行环境部署.一般hdfs环境部署比较简单,部署后就 可以在ecl ...
- Hadoop2.6.0安装—单机/伪分布
目录 环境准备 创建hadoop用户 更新apt 配置SSH免密登陆 安装配置Java环境 安装Hadoop Hadoop单机/伪分布配置 单机Hadoop 伪分布Hadoop 启动Hadoop 停止 ...
- 在Ubuntu下配置运行Hadoop2.4.0单节点配置
还没有修改hosts,请先按前文修改. 还没安装java的,请按照前文配置. (1)增加用户并设立公钥: sudo addgroup hadoop sudo adduser --ingroup had ...
- Zookeeper3.4.6部署伪分布集群(Apache)
1.下载Zookeeper http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.4.6/ 2.创建/usr/app/zookeeper目录,并切换 ...
- 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 ...
- hadoop2.7【单节点】单机、伪分布、分布式安装指导
问题导读 1.从本文部署实际部署,总结本地模式.伪分布.分布式的区别是什么?2.单机是否是伪分布?3.本地模式是否可以运行mapreduce? 来源:about云 http://www.aboutyu ...
- 二、Ubuntu14.04下安装Hadoop2.4.0 (伪分布模式)
在Ubuntu14.04下安装Hadoop2.4.0 (单机模式)基础上配置 一.配置core-site.xml /usr/local/hadoop/etc/hadoop/core-site.xml ...
- centos6.10中部署percona-mysql双实例的方法
centos6.10中部署percona-mysql双实例的方法 数据库的同步关系:192.168.11.53(master) --> slave(192.168.10.189) --> ...
- Hadoop2.2.0多节点分布式安装及测试
众所周知,hadoop在10月底release了最新版2.2.很多国内的技术同仁都马上在网络上推出了自己对新版hadoop的配置心得.这其中主要分为两类: 1.单节点配置 这个太简单了,简单到只要懂点 ...
随机推荐
- Struts2和SpringMVC的action是单例还是原型的?
struts2的acion单独使用的时候应是多例的,也就是原型(prototype). 因为它是基于类开发的,它的三种获取页面传参的方式都是通过成员变量的方式来接受的. 如果用struts2框架基于方 ...
- 剑指offer——面试题20:表示数值的字符串
#include"iostream" using namespace std; bool IsInt(const char **str); bool IsUnsignInt(con ...
- 转 crs damon can't start 2个例子
###sample 1 "node 1 (10.198.127.5): ps -ef|grep ora.crsd root 45613166 47185944 0 10:24:35 pts/ ...
- myEclipse或eclipse复制或修改项目后的部署名称
第一种方式: 右键工程-properties-Deployment-Deployment Assembly下 修改Web Content Root名称即可.见下图 第二种方式: 右键工程-proper ...
- 每一次要fix的pr
1.TODO一定要加自己名字 2.写代码考虑别人的阅读,比如event这样很general的名字不要用,所以不用from sqlalchemy import event, 要用import sqlal ...
- vue笔记精华部分
以 _ 或 $ 开头的属性 不会 被 Vue 实例代理,因为它们可能和 Vue 内置的属性.API 方法冲突.你可以使用例如 vm.$data._property 的方式访问这些属性. mixin的使 ...
- C++下混合编译c语言方法总结
最近在读SGI STL源码,感觉对C++的学习很有帮助,之前对于泛型.iterator.traits等等各种特性的概念非常模糊,通过这两天的琢磨,再加上<STL 源码剖析>的帮助,对C++ ...
- 再探display:table-cell &&左边固定、右边自适应
display:table-cell;这个属性用的不多,它和td差不多,但是如果可以用好还是能收益不少的,下面举例说明. 1. 父元素display:table-cell,并设置verticle-al ...
- JAVA学习4:用Maven创建Struts2项目
采用struts版本:struts-2.3.8 一.创建一个web项目 参考前面文章,项目名:maven-struts-demo. 二.配置pom.xml文件添加struts2依赖 <pro ...
- bootstrap table 以及xEdittable的应用
以前一直没有用过 bootstrap 表格框架,因为项目css框架用的是bootstrap,为考虑到统一性的原因,所以选用了这个框架 步骤: 第一步:引用 <link href=" ...