问题
First and foremost I'm a Nutch/Hadoop newbie. I have installed Cassandra. I have installed Nutch on the Master node of my EMR cluster. When I attempt to execute a crawl using the following command:
sudo bin/crawl crawl urls -dir crawl -depth 3 -topN 5
I get
Error: JAVA_HOME is not set.
If I run the command without 'sudo' I get:
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)
I cannot figure this out. I've seen the other forum here: Similar Topic
and followed it to no avail. I have added
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
and
export PATH=$PATH:${JAVA_HOME}/bin
to my ~/.bashrc and I am using Linux..
Any help will be appreciated!!
回答1:
The problem is I was running
sudo bin/crawl crawl urls -dir crawl -depth 3 -topN 5
I used
bin/crawl ./urls/seed.txt TestCrawl http://localhost:8983/solr/ 5
And all is well, just a malformed command.. i.e. 'crawl' is deprecated as stated here: Apache Nutch Tutorial
来源:https://stackoverflow.com/questions/24771239/nutch-getting-error-java-home-is-not-set-when-trying-to-crawl