首页 > 代码库 > hadoop多次格式化后,导致datanode启动不了

hadoop多次格式化后,导致datanode启动不了

hadoop多次格式化后,导致datanode启动不了,并且在datanode里面执行

 hadoop datanode -upgrade 会抛出如下异常:

************************************************************/2014-08-27 14:51:25,917 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: registered UNIX signal handlers for [TERM, HUP, INT]2014-08-27 14:51:26,126 WARN org.apache.hadoop.hdfs.server.common.Util: Path /usr/local/hadoop-2.4.0/dfs/data should be specified as a URI in configuration files. Please update hdfs configuration.2014-08-27 14:51:26,501 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Exception in secureMainjava.net.UnknownHostException: VM_32_234_centos: VM_32_234_centos        at java.net.InetAddress.getLocalHost(InetAddress.java:1473)        at org.apache.hadoop.security.SecurityUtil.getLocalHostName(SecurityUtil.java:186)        at org.apache.hadoop.security.SecurityUtil.login(SecurityUtil.java:206)        at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:1770)        at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:1812)        at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:1988)        at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:2012)Caused by: java.net.UnknownHostException: VM_32_234_centos        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)        at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)        at java.net.InetAddress.getLocalHost(InetAddress.java:1469)        ... 6 more2014-08-27 14:51:26,504 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 12014-08-27 14:51:26,505 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG: /************************************************************SHUTDOWN_MSG: Shutting down DataNode at java.net.UnknownHostException: VM_32_234_centos: VM_32_234_centos************************************************************/

 

 

2.40版本解决 ,在master和namenode 上执行

rm -Rf tmp/*rm -Rf dfs/data/*rm -Rf dfs/name/*

然后再master上重新格式化

hadoop namenode -format

 

hadoop多次格式化后,导致datanode启动不了