Hadoop安装和使用
1、安装
1.1、下载hadoop-2.5.1.tar.gz
1.2、解压至安装目录
tar -zxv -f hadoop-2.5.1.tar.gz -C ../soft/
1.3、配置hadoop相关配置文件
vim .bashrc
##添加JAVA配置
export JAVA_HOME=/usr/xuelu/java
export PATH=$PATH:$JAVA_HOME/bin
vim .bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/bin #设置hadoop的环境变量
export HADOOP_HOME=/home/xuelul/soft/hadoop251
#设置maven的环境变量
export MAVEN_HOME=/usr/xuelul/maven
export ZOOKEEPER_HOME=/home/xuelu/soft/zoo346
PATH=$PATH:$HADOOP_HOME/bin:$MAVEN_HOME/bin:$ZOOKEEPER_HOME/bin
export PATH
source .bash_profile,使上述修改生效
修改hadoop自带的配置文件:
etc/hadoop/core-site.xml:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
etc/hadoop/hdfs-site.xml:
<configuration>
<property>
<name>dfs.replication</name>
<value></value>
</property>
</configuration>
Setup passphraseless ssh
Now check that you can ssh to the localhost without a passphrase:
$ ssh localhost
If you cannot ssh to localhost without a passphrase, execute the following commands:
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys 数据准备:
$ mkdir input
$ cp etc/hadoop/*.xml input
#1、格式化文件系统: $ bin/hdfs namenode -format #2、开启 NameNode daemon and DataNode daemon: $ sbin/start-dfs.sh #3、The hadoop daemon log output is written to the $HADOOP_LOG_DIR directory (defaults to $HADOOP_HOME/logs).
Browse the web interface for the NameNode; by default it is available at:
NameNode - http://localhost:50070/
#4、Make the HDFS directories required to execute MapReduce jobs: $ bin/hdfs dfs -mkdir /user
$ bin/hdfs dfs -mkdir /user/<username> #5、Copy the input files into the distributed filesystem: $ bin/hdfs dfs -put etc/hadoop input #6、Run some of the examples provided: $ bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5..jar grep input output 'dfs[a-z.]+' #7、Examine the output files: Copy the output files from the distributed filesystem to the local filesystem and examine them: $ bin/hdfs dfs -get output output
$ cat output/* or View the output files on the distributed filesystem: $ bin/hdfs dfs -cat output/* #8、When you're done, stop the daemons with: $ sbin/stop-dfs.sh
YARN on Single Node
You can run a MapReduce job on YARN in a pseudo-distributed mode by setting a few parameters and running ResourceManager daemon and NodeManager daemon in addition.
The following instructions assume that 1. ~ 4. steps of the above instructions are already executed.
- Configure parameters as follows:
etc/hadoop/mapred-site.xml:
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>etc/hadoop/yarn-site.xml:
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration> - Start ResourceManager daemon and NodeManager daemon:
$ sbin/start-yarn.sh
- Browse the web interface for the ResourceManager; by default it is available at:
- ResourceManager - http://localhost:8088/
- Run a MapReduce job.
- When you're done, stop the daemons with:
$ sbin/stop-yarn.sh
Hadoop安装和使用的更多相关文章
- linux hadoop安装
linux hadoop安装 本文介绍如何在Linux下安装伪分布式的hadoop开发环境. 在一开始想利用cgywin在 windows下在哪, 但是一直卡在ssh的安装上.所以最后换位虚拟机+ub ...
- 转载:Hadoop安装教程_单机/伪分布式配置_Hadoop2.6.0/Ubuntu14.04
原文 http://www.powerxing.com/install-hadoop/ 当开始着手实践 Hadoop 时,安装 Hadoop 往往会成为新手的一道门槛.尽管安装其实很简单,书上有写到, ...
- hadoop安装遇到的各种异常及解决办法
hadoop安装遇到的各种异常及解决办法 异常一: 2014-03-13 11:10:23,665 INFO org.apache.hadoop.ipc.Client: Retrying connec ...
- hadoop安装实战(mac实操)
集群环境配置参考(http://blog.csdn.net/zcf1002797280/article/details/49500027) 参考:http://www.cnblogs.com/liul ...
- hadoop安装计
hadoop安装计 大体上按这个做就好了 http://blog.csdn.net/hitwengqi/article/details/8008203 需要修改hadoop-env.sh export ...
- [Hadoop入门] - 2 ubuntu安装与配置 hadoop安装与配置
ubuntu安装(这里我就不一一捉图了,只引用一个网址, 相信大家能力) ubuntu安装参考教程: http://jingyan.baidu.com/article/14bd256e0ca52eb ...
- Hadoop安装(Ubuntu Kylin 14.04)
安装环境:ubuntu kylin 14.04 haoop-1.2.1 hadoop下载地址:http://apache.mesi.com.ar/hadoop/common/hadoop-1. ...
- hadoop安装配置——伪分布模式
1. 安装 这里以安装hadoop-0.20.2为例 先安装java,参考这个 去着下载hadoop 解压 2. 配置 修改环境变量 vim ~/.bashrc export HADOOP_HOME= ...
- Hadoop安装教程_单机/伪分布式配置_Hadoop2.6.0/Ubuntu14.04
摘自: http://www.cnblogs.com/kinglau/p/3796164.html http://www.powerxing.com/install-hadoop/ 当开始着手实践 H ...
- Hadoop安装教程_单机/伪分布式配置
环境 本教程使用 CentOS 6.4 32位 作为系统环境,请自行安装系统(可参考使用VirtualBox安装CentOS).如果用的是 Ubuntu 系统,请查看相应的 Ubuntu安装Hadoo ...
随机推荐
- HDU 1599
裸的FLOYD 求最小环. #include <iostream> #include <cstdio> using namespace std; ; ; int n,m,min ...
- Unix(AIX) set命令
Unix(AIX) set命令,set命令是shell所具有的,不仅仅是aix自己有的: set -o vi 可以用vi方式操作,用来获取已经输入过的命令: 如果希望自动设置,可以在.profile ...
- 先序遍历创建二叉树,对二叉树统计叶子节点个数和统计深度(创建二叉树时#代表空树,序列不能有误)c语言
#include "stdio.h" #include "string.h" #include "malloc.h" #define NUL ...
- C语言读取文件大量数据到数组
针对.txt文档的大量有规律数据,譬如100行8列的数据将其读取到二维数组(矩阵)中,留作之后的数据处理. 改程序通过宏定义的方法来确定将要读取程序的行数和列数,将数据读取到二维数组data[100] ...
- 基于spark1.4的Spark-Sql
Author: kwu 基于spark1.4的Spark-Sql,spark1.4.1在7月15刚公布.提供较好sql支持 1.怎样启动Spark-Sql 启动脚本例如以下 #!/usr/bin/en ...
- 错误: su: 无法设置组: 不允许的操作
到 /bin目录下,用ls -l 看下su文件的权限是不是rwxr-xr-x或者-rwxrwxrwx 执行这条命令chmod ug+s su
- Linux内核OOM机制的详细分析【转】
本文转载自:http://blog.csdn.net/liukuan73/article/details/43238623 Linux内核根据应用程序的要求分配内存,通常来说应用程序分配了内存但是并没 ...
- 杂项-DB:时序数据库
ylbtech-杂项-DB:时序数据库 1.返回顶部 1. 时序数据库全称为时间序列数据库.时间序列数据库主要用于指处理带时间标签(按照时间的顺序变化,即时间序列化)的数据,带时间标签的数据也称为时间 ...
- 南海区行政审批管理系统接口规范v0.3(规划) 2.业务申报API 2.1.businessApply【业务申报】
{"v_interface":"2015987654327","c_project":"NH09A102"," ...
- [HTML5] 新标签解释及用法
转自:http://www.cnblogs.com/yuzhongwusan/archive/2011/11/17/2252208.html HTML 5 是一个新的网络标准,目标在于取代现有的 HT ...