Datanode not starts correctly

核能气质少年 提交于 2019-11-28 03:28:37

You can do the following method,

copy to clipboard datanode clusterID for your example, CID-8bf63244-0510-4db6-a949-8f74b50f2be9

and run following command under HADOOP_HOME/bin directory

./hdfs namenode -format -clusterId CID-8bf63244-0510-4db6-a949-8f74b50f2be9

then this code formatted the namenode with datanode cluster ids.

You must do as follow :

  • bin/stop-all.sh
  • rm -Rf /home/prassanna/usr/local/hadoop/yarn_data/hdfs/*
  • bin/hadoop namenode -format

I had the same problem until I found an answer in this web site.

Whenever you are getting below error, trying to start a DN on a slave machine:

java.io.IOException: Incompatible clusterIDs in /home/hadoop/dfs/data: namenode clusterID= ****; datanode clusterID = ****

It is because after you set up your cluster, you, for whatever reason, decided to reformat your NN. Your DNs on slaves still bear reference to the old NN.

To resolve this simply delete and recreate data folder on that machine in local Linux FS, namely /home/hadoop/dfs/data.

Restarting that DN's daemon on that machine will recreate data/ folder's content and resolve the problem.

Do following simple steps

  • Clear the data directory of hadoop
  • Format the namenode again
  • start the cluster

After this your cluster will start normally if you are not having any other configuration issue

sofiene zaghdoudi

DataNode dies because of incompatible Clusterids compared to the NameNode. To fix this problem you need to delete the directory /tmp/hadoop-[user]/hdfs/data and restart hadoop.

rm -r /tmp/hadoop-[user]/hdfs/data

I got similar issue in my pseudo distributed environment. I stopped cluster first, then I copied Cluster ID from NameNode's version file and put it in DataNode's version file, then after restarting cluster, its all fine.

my data path is here /usr/local/hadoop/hadoop_store/hdfs/datanode and /usr/local/hadoop/hadoop_store/hdfs/namenode.

FYI : version file is under /usr/local/hadoop/hadoop_store/hdfs/datanode/current/ ; likewise for NameNode.

Neil

Here, the datanode gets stopped immediately because the clusterID of datanode and namenode are different. So you have to format the clusterID of namenode with clusterID of datanode

Copy the datanode clusterID for your example, CID-8bf63244-0510-4db6-a949-8f74b50f2be9 and run following command from your home directory. You can go to your home dir by just typing cd on your terminal.

From your home dir now type the command:

hdfs namenode -format -clusterId CID-8bf63244-0510-4db6-a949-8f74b50f2be9

Delete the namenode and datanode directories as specified in the core-site.xml. After that create the new directories and restart the dfs and yarn.

I also had the similar issue. I deleted namenode and datanode folders from all the nodes, and rerun:

$HADOOP_HOME/bin> hdfs namenode -format -force
$HADOOP_HOME/sbin> ./start-dfs.sh
$HADOOP_HOME/sbin> ./start-yarn.sh

To check the health report from command line (which I would recommend)

$HADOOP_HOME/bin> hdfs dfsadmin -report

and I got all the nodes working correctly.

LinxFan

I had same issue for hadoop 2.7.7

I removed the namenode/current & datanode/current directory on namenode and all the datanodes

  • Removed files at /tmp/hadoop-ubuntu/*
  • then format namenode & datanode
  • restart all the nodes.
  • things work fine

steps: stop all nodes/managers then attempt below steps

  1. rm -rf /tmp/hadoop-ubuntu/* (all nodes)
  2. rm -r /usr/local/hadoop/data/hdfs/namenode/current (namenode: check hdfs-site.xml for path)
  3. rm -r /usr/local/hadoop/data/hdfs/datanode/current (datanode:check hdfs-site.xml for path)
  4. hdfs namenode -format (on namenode)
  5. hdfs datanode -format (on namenode)
  6. Reboot namenode & data nodes
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!