sclee1
sclee1

Reputation: 1281

Hadoop errors when executing the word count program

I am beginner for Hadoop programming and I tried to run the word count program in the hadoop packages.

I ran the command and faced the errors below. I tried to search the same issues on the web,but I couldn't solve. I think that my problem is related to the permission in configuration file.

./bin/hadoop jar hadoop-examples-1.0.3.jar wordcount README.txt ~/wordcount-output

Below are my errors.

16/05/04 00:05:26 INFO util.NativeCodeLoader: Loaded the native-hadoop library
16/05/04 00:05:26 INFO mapred.JobClient: Cleaning up the staging area file:/tmp/hadoop-sclee1/mapred/staging/sclee1466120821/.staging/job_local_0001
16/05/04 00:05:26 ERROR security.UserGroupInformation: PriviledgedActionException as:sclee1 cause:java.net.UnknownHostException: NGS1: NGS1: Name or service not known
java.net.UnknownHostException: NGS1: NGS1: Name or service not known
        at java.net.InetAddress.getLocalHost(InetAddress.java:1496)
        at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:874)
        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.hadoop.examples.WordCount.main(WordCount.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
        at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
        at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:64)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: java.net.UnknownHostException: NGS1: Name or service not known
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:922)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1316)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1492)
        ... 21 more

For your better understand, sclee1 is my account and NGS1 is my linux server, which is centos version.

I struggled to fix its problems but it failed.

Upvotes: 0

Views: 140

Answers (1)

Ram Ghadiyaram
Ram Ghadiyaram

Reputation: 29155

Check and add the association between the hostnames and the ip address for the master and the slaves on all the nodes in the /etc/hosts file. Make sure that the all the nodes in the cluster are able to ping to each other.

example configuration: /etc/hosts file like this:

127.0.0.1       localhost       NGS1

Upvotes: 1

Related Questions