Hadoop中dataNode启动不了

**********************************************************/
2016-10-19 11:13:45,972 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: registered UNIX signal handlers for [TERM, HUP, INT]
2016-10-19 11:13:48,056 WARN org.apache.hadoop.util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2016-10-19 11:13:48,801 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Exception in secureMain
java.net.UnknownHostException: Zewen: Zewen
at java.net.InetAddress.getLocalHost(InetAddress.java:1496)
at org.apache.hadoop.security.SecurityUtil.getLocalHostName(SecurityUtil.java:187)
at org.apache.hadoop.security.SecurityUtil.login(SecurityUtil.java:207)
at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:2153)
at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:2202)
at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:2378)
at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:2402)
Caused by: java.net.UnknownHostException: Zewen
at java.net.Inet4AddressImpl.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)
... 6 more
2016-10-19 11:13:48,825 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
2016-10-19 11:13:48,844 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down DataNode at java.net.UnknownHostException: Zewen: Zewen
************************************************************/

2016-10-19 11:29:32,211 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: STARTUP_MSG: 

我的错误和这差不多

解决方法是

/etc/hosts加一行

127.0.0.1 Zewen    Zewen是你的主机名 也是你日志里面出错的那个比如这一行 java.net.UnknownHostException: Zewen: Zewen


你可能感兴趣的:(Hadoop中dataNode启动不了)