0
votes

Trying to crawl with Nutch 1.9 on Centos 6.6.

When trying to initalize my first crawl after following this guide:

http://wiki.apache.org/nutch/NutchTutorial

However, I am getting the following exception when launching:

Injector: Converting injected urls to crawl db entries. Injector: java.net.UnknownHostException: Sparky.LITK: Sparky.LITK: Name or service not known at java.net.InetAddress.getLocalHost(InetAddress.java:1473) at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:960) 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:324) at org.apache.nutch.crawl.Injector.run(Injector.java:380) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) at org.apache.nutch.crawl.Injector.main(Injector.java:370) Caused by: java.net.UnknownHostException: Sparky.LITK: Name or service not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293) at java.net.InetAddress.getLocalHost(InetAddress.java:1469) ... 12 more

It seems to be trying to crawl the machine's own hostname (Sparky.LITK) which is not what I want it to do, I set up a seed.txt list as per the tutorial, but it stuck here.

1

1 Answers

0
votes

The fix is as simple as adding your machine's host name to your /etc/hosts file pointing back to your loopback address (127.0.0.1)

I ammended my hosts entry as follows:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 Sparky.LITK
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 Sparky.LITK

And it worked!