jar不存在或不是普通文件

ki0zmccv  于 2021-05-29  发布在  Hadoop
关注(0)|答案(4)|浏览(1792)

在中运行wordcount示例时 Hadoop ,我面临以下错误。

saying "JAR does not exist or is not a normal file: 
/usr/local/hadoop/share/hadoop/mapreduce/hadoop-mapreduceexamples-2.2.0.jar"

我的输入命令是:

hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduceexamples-2.2.0.jar  wordcount input output
8yoxcaq7

8yoxcaq71#

.jar 每个发行版的路径可能不同很难说确切的路径,显然,您可以将cd放入每个目录并进行检查,但您是否想过有一种简单的方法。只需执行以下命令,它就会列出所有名为 hadoop-mapreduceexamples-2.2.0.jar 准确的位置,

find . -name hadoop-mapreduceexamples-2.2.0.jar

或者如果你不知道 .jar 你可以试试这个,

find . -name *.jar
z3yyvxxp

z3yyvxxp2#

只需转到该路径并检查名称是否正确,约定可能因分布而异。
例如,hadoop 3.1.0的路径如下:
$hadoop\u home/share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.0.jar

bnl4lu3b

bnl4lu3b3#

我也面临同样的问题,问题是文件中的版本号。例如,在安装说明中,命令是:
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.2.1.jar grep输入输出'dfs[a-z.]+'
我使用的版本是3.1.3,所以对我有效的是:
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar grep输入输出'dfs[a-z.]+'

guz6ccqo

guz6ccqo4#

只需检查jar文件中是否包含所有依赖项。试试这样的。

hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduceexamples-2.2.0-jar-with-dependencies.jar  wordcount input output

相关问题