nutch2.0 hadoop输入路径不存在

s3fp2yjn  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(405)
Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: hdfs://yuqing-namenode:9000/user/yuqing/2
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:235)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:252)
at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:962)
at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:979)
at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:500)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530)
at org.apache.nutch.util.NutchJob.waitForCompletion(NutchJob.java:50)
at org.apache.nutch.crawl.InjectorJob.run(InjectorJob.java:219)
at org.apache.nutch.crawl.Crawler.runTool(Crawler.java:68)
at org.apache.nutch.crawl.Crawler.run(Crawler.java:136)
at org.apache.nutch.crawl.Crawler.run(Crawler.java:250)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.nutch.crawl.Crawler.main(Crawler.java:257)

当我从nutch conf中删除hadoop的配置文件时,第一行错误变成:

Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/home/yuqing/workspace/nutch2.0/2

曾经我用hbase成功运行nutch2.0,但现在完整的发行版不起作用。hbase在全发行版运行正常,我可以在shell中操作它。接下来我在nutch2.0中创建了一个文件夹,这样爬虫程序就可以运行了,但是控制台的输出似乎不正常。现在我得吃饭了。

xkrw2x1b

xkrw2x1b1#

看起来你没有输入路径。就像hadoop说的。检查hdfs dfs-ls/user/yuqing/2是否返回某些内容(2应该是文件或目录)
至于第二部分,当您删除hadoop配置时,hadoop库使用内部配置(您可以在名为*-default.xml、f.e.core default.xml的发行版中找到它们),hadoop函数使用“local”模式。在“本地”模式下,所有路径都是本地的(在本地文件系统中)。所以,当您在“hdfs”模式下引用文件,即hdfs dfs-ls/some/file时,hadoop将在hdfs中查找文件(hdfs://namenode.ip/some/file),但在本地模式下,将在相对位置搜索文件(通常是file:/home/user/some/file)。您可以在输出中看到:file:/home/yuqing/workspace/nutch2.0/2

相关问题