首先也是最重要的一点,我是一个nutch/hadoop新手。我已经安装了Cassandra。我已经在emr集群的主节点上安装了nutch。当我尝试使用以下命令执行爬网时:
sudo bin/crawl crawl urls -dir crawl -depth 3 -topN 5
我明白了
Error: JAVA_HOME is not set.
如果我在没有“sudo”的情况下运行命令,我会得到:
Injector: starting at 2014-07-16 02:12:24
Injector: crawlDb: urls/crawldb
Injector: urlDir: crawl
Injector: Converting injected urls to crawl db entries.
Injector: org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/home/hadoop/apache-nutch-1.8/runtime/local/crawl
at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:197)
at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:208)
at org.apache.hadoop.mapred.JobClient.writeOldSplits(JobClient.java:1081)
at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:1073)
at org.apache.hadoop.mapred.JobClient.access$700(JobClient.java:179)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:983)
at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:936)
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:1190)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:936)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:910)
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1353)
at org.apache.nutch.crawl.Injector.inject(Injector.java:279)
at org.apache.nutch.crawl.Injector.run(Injector.java:316)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.nutch.crawl.Injector.main(Injector.java:306)
我想不通。我在这里见过另一个论坛:类似的主题
跟着它走也没用。我补充说
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
和
export PATH=$PATH:${JAVA_HOME}/bin
到我的~/.bashrc,我正在使用linux。。
任何帮助都将不胜感激!!
1条答案
按热度按时间slwdgvem1#
问题是我在跑步
我曾经
一切都很好,只是一个错误的命令。。i、 e.“crawl”在这里被弃用:apachenutch教程