Why does data node shut down when I run hadoop?

我与影子孤独终老i 提交于 2019-12-22 08:45:02

问题


I have hadoop 1.0.4 installed on ubuntu 11.0.4 in VirtualBox(same as my hostname), somehow the data node shuts down giving the following error in the log files

/************************************************************
STARTUP_MSG: Starting DataNode
STARTUP_MSG:   host = VirtualBox/127.0.1.1
STARTUP_MSG:   args = []
STARTUP_MSG:   version = 1.0.4
STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.0 -r 1393290; compiled by 'hortonfo' on Wed Oct  3 05:13:58 UTC 2012
************************************************************/
2013-08-18 19:52:21,301 INFO org.apache.hadoop.metrics2.impl.MetricsConfig: loaded properties from hadoop-metrics2.properties
2013-08-18 19:52:21,394 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source MetricsSystem,sub=Stats registered.
2013-08-18 19:52:21,412 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Scheduled snapshot period at 10 second(s).
2013-08-18 19:52:21,417 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: DataNode metrics system started
2013-08-18 19:52:23,207 INFO org.apache.hadoop.metrics2.impl.MetricsSourceAdapter: MBean for source ugi registered.
2013-08-18 19:52:23,276 WARN org.apache.hadoop.metrics2.impl.MetricsSystemImpl: Source name ugi already exists!
2013-08-18 19:52:26,887 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: java.io.IOException: Incompatible namespaceIDs in /app/hadoop/tmp/dfs/data: namenode namespaceID = 457871323; datanode namespaceID = 2066655210
    at org.apache.hadoop.hdfs.server.datanode.DataStorage.doTransition(DataStorage.java:232)
    at org.apache.hadoop.hdfs.server.datanode.DataStorage.recoverTransitionRead(DataStorage.java:147)
    at org.apache.hadoop.hdfs.server.datanode.DataNode.startDataNode(DataNode.java:385)
    at org.apache.hadoop.hdfs.server.datanode.DataNode.<init>(DataNode.java:299)
    at org.apache.hadoop.hdfs.server.datanode.DataNode.makeInstance(DataNode.java:1582)
    at org.apache.hadoop.hdfs.server.datanode.DataNode.instantiateDataNode(DataNode.java:1521)
    at org.apache.hadoop.hdfs.server.datanode.DataNode.createDataNode(DataNode.java:1539)
    at org.apache.hadoop.hdfs.server.datanode.DataNode.secureMain(DataNode.java:1665)
    at org.apache.hadoop.hdfs.server.datanode.DataNode.main(DataNode.java:1682)

2013-08-18 19:52:26,903 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: SHUTDOWN_MSG: 
/************************************************************
SHUTDOWN_MSG: Shutting down DataNode at VirtualBox/127.0.1.1
************************************************************/

Any idea why?How can I fix it?


回答1:


I've had this happen a few times. If restarting the data node doesn't help, then do the following:

  1. Restart Hadoop
  2. Go to /app/hadoop/tmp/dfs/name/current
  3. Open VERSION (i.e. by vim VERSION)
  4. Record namespaceID
  5. Go to /app/hadoop/tmp/dfs/data/current
  6. Open VERSION (i.e. by vim VERSION)
  7. Replace the namespaceID with the namespaceID you recorded in step 4.

This should fix the problem.




回答2:


This is well known problem when we format the name node. Please refer below url:

http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-multi-node-cluster/#javaioioexception-incompatible-namespaceids




回答3:


This usually results when you format the namenode and don't do a datanode clean up and you namespace changes.

Probable solution:

Try deleting the /app/hadoop/tmp/dfs/data directory and restart the datanode




回答4:


I lost my data on namenode. I had to format my namenode with

hadoop namenode -format

After starting namenode, datanode was failing to start because of VERSION problem

Then I need to remove all the data from datanodes also.

I can simply clean data folder in dfs (/{hadoop.tmp.dir}/dfs/data/*) and restart datanode

i.e rm -rf /{hadoop.tmp.dir}/dfs/data/*

OR

delete the VERSION file (/{hadoop.tmp.dir}/dfs/data/current/VERSION) and restart datanode




回答5:


Restart Hadoop
Go to /app/hadoop/tmp/dfs/name/current
Open VERSION (i.e. by vim VERSION)
Record namespaceID
Go to /app/hadoop/tmp/dfs/data/current
Open VERSION (i.e. by vim VERSION)
Replace the namespaceID with thve namespaceID you recorded in step 4.

to do this above steps, i dont have any files in the data folder /tmp/data



来源:https://stackoverflow.com/questions/18300940/why-does-data-node-shut-down-when-i-run-hadoop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!