I am a Hadoop newbie. I installed Hadoop on my MAC using this link
It worked like a charm for me to begin with, but now I hit this problem when I run the same WordCount problem from Eclipse :
ERROR security.UserGroupInformation: PriviledgedActionException as:<username> cause:java.net.UnknownHostException: <hostname>: <hostname>: hostname nor servname provided, or not known
Exception in thread "main" java.net.UnknownHostException: <hostname>: <hostname>: nodename nor servname provided, or not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1466)
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.mapreduce.Job.submit(Job.java:550)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:580)
at WordCount.main(WordCount.java:57)
Caused by: java.net.UnknownHostException: <hostname>: nodename nor servname provided, or not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
This is how my conf files look :
core-site.xml:
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
hadoop-env.sh
Has the following entry, in addition the defaults:
export HADOOP_OPTS="-Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk"
hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
mapred-site.xml
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
I also see this in the beginning of the errors:
2013-10-11 21:03:08.795 java[7484:1903] Unable to load realm mapping info from SCDynamicStore
13/10/11 21:03:08 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
13/10/11 21:03:08 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
13/10/11 21:03:08 WARN mapred.JobClient: No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
13/10/11 21:03:08 INFO mapred.JobClient: Cleaning up the staging area file:/tmp/hadoop-<uname>/mapred/staging/<uname>386844365/.staging/job_local386844365_0001
Can somebody please tell me if I am doing anything wrong ? My program is the same and havent changed the defaults (which used to work)
Thanks
The problem was with the host file. Fixed it by adding this to the /etc/hosts file:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.1.1 <hostname>
You can fix this with a simple command:
echo "127.0.0.1 $HOSTNAME" | sudo tee -a /etc/hosts
(Source)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With