hadoop在opensuse上执行以下命令报错 bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'

hadoop在opensuse上执行以下命令报错
bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'

解决方法:在/etc/hosts
127.0.0.1       localhost下一行
添加:
127.0.0.1       linux-7e8g.site

13/05/28 14:29:28 INFO mapred.JobClient: Cleaning up the staging area file:/tmp/hadoop-root/mapred/staging/root239779977/.staging/job_local239779977_0001
13/05/28 14:29:28 ERROR security.UserGroupInformation: PriviledgedActionException as:root cause:java.net.UnknownHostException: linux-7e8g.site: linux-7e8g.site
java.net.UnknownHostException: linux-7e8g.site: linux-7e8g.site
     at java.net.InetAddress.getLocalHost(InetAddress.java:1426)
     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:416)
     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.hadoop.examples.Grep.run(Grep.java:69)
     at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
     at org.apache.hadoop.examples.Grep.main(Grep.java:93)
     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:616)
     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:616)
     at org.apache.hadoop.util.RunJar.main(RunJar.java:160) 

你可能感兴趣的:(hadoop)