启动haoop并运行wordcount
启动hadoop,这里hadoop的版本是2.7.4
进入Hadoop的安装目录的bin目录下,采用-format命令格式化文件系统。
hadoop namenode -format
hadoop datanode -format
start-all.sh
注意:在执行格式化-format命令时,要避免NameNode的namespace ID与DataNode的namespace ID
的不一致。这是因为每格式化就会产生Name、Data、temp等临时文件记录信息,多次格式化就会产生很多的Name、Data、temp,这样容易导致ID的不同,使Hadoop不能正常运行。每次执行格式化命令是,就需要将DataNode和NameNode上原来的data、temp文件删除。
启动Hadoop,采用start-all.sh命令:start-all.sh
查看进程,采用jps命令:jps
使用了废弃的命令
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
$ hadoop dfs -ls
DEPRECATED: Use ofthis script. to execute hdfs command is deprecated.
Instead use the hdfscommand for it.
原来从0.21.0版本以后,hadoop 命令换成了hdfs命令,上面的命令如同下面的命令:
$ hdfs dfs -ls // 这时就没有错误了
This script is Deprecated. Instead use stop-dfs.sh and stop-yarn.sh
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
主从时间不对
Got exception: org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container.
This token is expired. current time is 1508407745227 found 1508379544313
Note: System times on machines may be out of sync. Check system time and time zones.
调整一下master和slave的时间,使其一致吧
hostname和/etc/hosts的配置错误
Got exception: java.net.ConnectException: Call From hadoop.master/192.168.168.11 to hadoop.master:41190 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
老子,尼玛,沃日啊,
下图给出了解释,自己看

#!/bin/bash # 下面对hdfs的操作都在绝对路径下 # 在HDFS中创建input文件目录
hdfs dfs -rm /input/* # 删除结果文件
hdfs dfs -rm /output/*
hdfs dfs -rmdir /output # 上传文件到/input目录
hdfs dfs -put /root/test.txt /input hadoop jar /usr/local/hadoop-2.7.4/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.4.jar wordcount /input /output hdfs dfs -ls /output
# 查看输出结果的目录
# 查看输出结果
hdfs dfs -cat /output/part-r-00000
查看集群状态:
hdfs dfsadmin -report
启动haoop并运行wordcount的更多相关文章
- hadoop2.6.4运行wordcount
hadoop用户登录,启动服务: start-dfs.sh && start-yarn.sh 创建输入目录: hadoop df -mkdir /input 把测试文件导入/input ...
- CentOS上安装Hadoop2.7,添加数据节点,运行wordcount
安装hadoop的步骤比较繁琐,但是并不难. 在CentOS上安装Hadoop2.7 1. 安装 CentOS,注:图形界面并无必要 2. 在CentOS里设置静态IP,手工编辑如下4个文件 /etc ...
- debian下 Hadoop 1.0.4 集群配置及运行WordCount
说明:我用的是压缩包安装,不是安装包 官网安装说明:http://hadoop.apache.org/docs/r1.1.2/cluster_setup.html,繁冗,看的眼花...大部分人应该都不 ...
- (三)配置Hadoop1.2.1+eclipse(Juno版)开发环境,并运行WordCount程序
配置Hadoop1.2.1+eclipse(Juno版)开发环境,并运行WordCount程序 一. 需求部分 在ubuntu上用Eclipse IDE进行hadoop相关的开发,需要在Eclip ...
- win10+eclipse+hadoop2.7.2+maven+local模式直接通过Run as Java Application运行wordcount
一.准备工作 (1)Hadoop2.7.2 在linux部署完毕,成功启动dfs和yarn,通过jps查看,进程都存在 (2)安装maven 二.最终效果 在windows系统中,直接通过Run as ...
- Spark on YARN简介与运行wordcount(master、slave1和slave2)(博主推荐)
前期博客 Spark on YARN模式的安装(spark-1.6.1-bin-hadoop2.6.tgz +hadoop-2.6.0.tar.gz)(master.slave1和slave2)(博主 ...
- Spark standalone简介与运行wordcount(master、slave1和slave2)
前期博客 Spark standalone模式的安装(spark-1.6.1-bin-hadoop2.6.tgz)(master.slave1和slave2) Spark运行模式概述 1. Stan ...
- 021_在Eclipse Indigo中安装插件hadoop-eclipse-plugin-1.2.1.jar,直接运行wordcount程序
1.工具介绍 Eclipse Idigo.JDK1.7-32bit.hadoop1.2.1.hadoop-eclipse-plugin-1.2.1.jar(自己网上下载) 2.插件安装步骤 1)将ha ...
- RedHat 安装Hadoop并运行wordcount例子
1.安装 Red Hat 环境 2.安装JDK 3.下载hadoop2.8.0 http://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/had ...
随机推荐
- Google Volley框架之https请求
先插一句.Google出的volley框架本身是支持https请求的,可是仅仅是针对有第三方机构认证过的. 假设自己随便在网上搞的一个证书,那volley是不支持请求的. 本文讲下怎样让volley支 ...
- 【自创+转发】jQuery给input 密码框绑定回车事件
<script type="text/javascript" src="Scripts/jquery-1.6.2.js"></script&g ...
- PC上的番茄工作法软件 Pomodairo 1.9 详细攻略
http://www.zhantuo.com/archives/673155 番茄钟软件 Pomodairo 1.9: 我觉得这款软件特别好,完全符合番茄工作法的要求. 你可以通过add new 来增 ...
- HDU 2256 Problem of Precision (矩阵乘法)
Problem of Precision Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth ...
- iOS NSString去除其他字符(空格回车符)
很多时候大家都需要对字符串进行处理.现在就对字符串删掉特殊字符的处理进行总结一下. 1.stringByTrimmingCharactersInSet 这个方法只能对字符串前后两个部分的特殊字符进行 ...
- SqlMapConfig.xml中的setting属性 Ibatis mybatis
<settingscacheModelsEnabled="true"lazyLoadingEnabled="false"enhancementEnable ...
- chromedriver 下载地址
重要的事情说三遍 chromedriver 下载地址 chromedriver 下载地址 chromedriver 下载地址 http://chromedriver.storage.googleapi ...
- 从github上下载项目到eclipse
第一步:把代码下载到本地的仓库中 到github后选择自己想下载的项目,拷贝它的URL,图示如下: 进入eclipse中 点击后如下: 继续 按照图片指示继续(大白菜next教程) fin ...
- javascript限定输入textarea输入长度
<textarea id="content" onkeyup="limitLength(this.value,'512','content')"> ...
- Common Probability Distributions
Common Probability Distributions Probability Distribution A probability distribution describes the p ...