我是Hadoop编程的初学者,我尝试在hadoop包中运行word count程序。
我运行命令并面对下面的错误。我试图在网上搜索相同的问题,但我无法解决。我认为我的问题与配置文件中的权限有关。
./bin/hadoop jar hadoop-examples-1.0.3.jar wordcount README.txt ~/wordcount-output
以下是我的错误。
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
为了更好地理解,sclee1是我的帐户,NGS1是我的linux服务器,这是centos版本。
我努力解决问题,但失败了。
答案 0 :(得分:1)
检查并添加/etc/hosts
文件中所有节点上主服务器和从服务器的主机名和IP地址之间的关联。确保群集中的所有节点都能够相互ping通。
示例配置:/etc/hosts
文件如下:
127.0.0.1 localhost NGS1