我是 Hadoop 新手。我使用此链接在我的 MAC 上安装了 Hadoop
一开始它对我来说就像一个魅力,但现在当我从 Eclipse 运行相同的 WordCount 问题时,我遇到了这个问题:
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)
这就是我的 conf 文件的外观:
核心站点.xml:
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
hadoop-env.sh
除了默认值外,还有以下条目:
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>
我在错误的开头也看到了这一点:
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
如果我做错了什么,有人可以告诉我吗?我的程序是相同的并且没有更改默认值(以前可以工作)
谢谢