知识点
相关文章
更多最近更新
更多Hadoop用于和MapReduce作业交互的命令
2019-03-28 13:45|来源: 网络
用法:Hadoop job [GENERIC_OPTIONS] [-submit <job-file>] | [-status <job-id>] | [-counter <job-id> <group-name> <counter-name>] | [-kill <job-id>] | [-events <job-id> <from-event-#> <#-of-events>] | [-history [all] <jobOutputDir>] | [-list [all]] | [-kill-task <task-id>] | [-fail-task <task-id>]
命令选项 描述
-submit <job-file> 提交作业
-status <job-id> 打印map和reduce完成百分比和所有计数器。
-counter <job-id> <group-name> <counter-name> 打印计数器的值。
-kill <job-id> 杀死指定作业。
-events <job-id> <from-event-#> <#-of-events> 打印给定范围内jobtracker接收到的事件细节。
-history [all] <jobOutputDir> -history <jobOutputDir> 打印作业的细节、失败及被杀死原因的细节。更多的关于一个作业的细节比如:成功的任务,做过的任务尝试等信息可以通过指定[all]选项查看。
-list [all] -list all 显示所有作业。-list只显示将要完成的作业。
-kill-task <task-id> 杀死任务。被杀死的任务不会不利于失败尝试。
-fail-task <task-id> 使任务失败。被失败的任务会对失败尝试不利。
基本命令:
1、列出所有Hadoop Shell支持的命令
$ bin/hadoop fs -help
2、显示关于某个命令的详细信息
$ bin/hadoop fs -help command-name
3、递归地拷贝文件或目录
$ hadoop distcp <srcurl> <desturl>
srcurl 源Url
desturl 目标Url
4、运行HDFS文件系统检查工具(fsck tools)
用法:hadoop fsck [GENERIC_OPTIONS] <path> [-move | -delete | -openforwrite] [-files [-blocks [-locations | -racks]]]
命令选项 描述
<path> 检查的起始目录。
-move 移动受损文件到/lost+found
-delete 删除受损文件。
-openforwrite 打印出写打开的文件。
-files 打印出正被检查的文件。
-blocks 打印出块信息报告。
-locations 打印出每个块的位置信息。
-racks 打印出data-node的网络拓扑结构
更多Hadoop相关信息见Hadoop 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=13
相关问答
更多-
用于hadoop mapreduce的罐子(Jars for hadoop mapreduce)[2023-07-28]
本教程提到: 下载Hadoop-core-1.2.1.jar,用于编译和执行MapReduce程序。 访问以下链接http://mvnrepository.com/artifact/org.apache.hadoop/hadoop-core/1.2.1下载jar。 所以在这里你可以找到不同版本的所有罐子 This tutorial mentions : Download Hadoop-core-1.2.1.jar, which is used to compile and execute the MapRe ... -
我解决了这个问题。 这是hadoop配置文件中的错误。 资源管理器端口8040上存在绑定异常。 我从(old yarn-site.xml)更改了hadoop yarn-site.xml:
yarn.nodemanager.aux-services mapreduce_shuffle ... -
您可以通过在hdfs-site.xml中将以下属性设置为false来禁用hdfs权限
dfs.permissions.enabled false -
充分评论后的解决方案 在python中读取数据文件:使用-file发送它并将以下内容添加到脚本中: import sys import后有时需要添加: sys.path.append('.') (与Hadoop Streaming中的 @DrDee评论有关- 无法找到文件错误 ) Solution after plenty comments :) Reading a data file in python: send it with -file and add to your script the fo ...
-
hadoop上的python流mapreduce作业失败 - 缺少log4j?(python streaming mapreduce job on hadoop failed - missing log4j?)[2022-03-19]
您应该只提供本地 python文件的名称作为-mapper和-reducer参数。 它们不需要在HDFS上,也不应该使用命令行提供字符串来执行脚本。 您还需要为每个脚本提供-file参数。 尝试使用 hadoop hadoop-streaming-2.7.1.jar -file /home/user_name/Documents/mapper.py -file /home/user_name/Documents/reducer.py -mapper /home/user_name/Documents/map ... -
旧的( oahmapred )和新的( oahmapreduce )API之间没有太大的区别。 唯一的显着区别是记录被推送到旧的API中的映射器/ reducer。 而新的API支持拉/推机制。 您可以在这里获得有关拉动机构的更多信息。 此外,旧的API自0.21以来已被不推荐使用 。 您可以在这里找到有关新API的更多信息。 正如你所提到的一些类(如MultipleTextOutputFormat)没有迁移到新的API,由于这个和上述原因,最好坚持使用旧的API(尽管翻译通常很简单)。 Functiona ...
-
Wowww,经过两天的调试,事实证明问题在于hadoop内部目录名称规则。 表面上看,对于输入或输出map-reduce目录,不能选择以下划线“_”开头的名称。 那个笨蛋! 警告和错误根本没有帮助。 Wowww, after two days of debugging, it turns out that the problem is with hadoop internal directories names rule. Seemingly, for the input or output map-red ...
-
它需要这样的东西: conf.set("hadoop.security.authentication", "Kerberos"); UserGroupInformation.setConfiguration(conf); It requires something like this: conf.set("hadoop.security.authentication", "Kerberos"); UserGroupInformation.setConfiguration(conf);
-
关于不调用底层MapReduce作业的Hive命令(regarding the Hive commands that do not invoke underlying MapReduce jobs)[2022-03-18]
你是对的,Hive在后台使用MR作业来处理数据。 你可以在hive中激活类似SQL的查询,它会将它转换为后台的各种MR作业,并为你提供结果。 话虽如此,很少有查询不需要MR工作。 例如 SEKECT * FROM table LIMIT 10; 如果您在上面的查询中看到我们不需要任何数据处理。 我们只需要从表中读取几行。 所以上面的hive查询不会触发MR作业 但是如果我们稍微修改上面的查询。 SELECT COUNT(*)FROM table; 它将解雇MR工作。 因为我们需要读取此查询的所有数据,MR作 ... -
从评论中, 类文件似乎有行package woq; 在没有acutal目录结构的情况下。 您可以创建父目录woq或从文件中删除该行并重新编译它。 如果删除该行,则可以像这样提交作业 hadoop jar /home/xyz/Documents/hadoop-2.7.3/abc1.jar WordCount /test/vocab.txt /test/output3 From the comments, The class files appear to have the line package woq; ...