[email protected]:/usr/local/hadoop/hadoop-2.2.0/hdfs/data/current$ jps11634 SecondaryNameNode11315 NameNode11779 ResourceManager11910 NodeManager12534 Jps
After hadoop is started, it is found that datanode is not started, view the contents of the log logs/hadoop-hadoop-datanode-yts-Rev-1-0.log, log
View the log as follows:
Java. Io. ioexception: incompatible clusterids in/usr/local/hadoop/hadoop-2.2.0/HDFS/data: namenode clusterid = CID-519c284d-c80a-47e0-b660-b7bba79f363e; datanode clusterid = CID-08483061-44f1-483c-a1fa-f8160835015d
At org. Apache. hadoop. HDFS. server. datanode. datastorage. dotransition (datastorage. Java: 391)
At org. Apache. hadoop. HDFS. server. datanode. datastorage. recovertransitionread (datastorage. Java: 191)
At org. Apache. hadoop. HDFS. server. datanode. datastorage. recovertransitionread (datastorage. Java: 219)
At org. Apache. hadoop. HDFS. server. datanode. datanode. initstorage (datanode. Java: 837)
At org. Apache. hadoop. HDFS. server. datanode. datanode. initblockpool (datanode. Java: 808)
At org. Apache. hadoop. HDFS. server. datanode. bpofferservice. verifyandsetnamespaceinfo (bpofferservice. Java: 280)
At org. Apache. hadoop. HDFS. server. datanode. bpserviceactor. connecttonnandhandshake (bpserviceactor. Java: 222)
At org. Apache. hadoop. HDFS. server. datanode. bpserviceactor. Run (bpserviceactor. Java: 664)
At java. Lang. thread. Run (thread. Java: 745)
09:49:02, 500 warn org. Apache. hadoop. HDFS. server. datanode. datanode: Ending block pool service for: block pool BP-1615382850-127.0.1.1-1412990967046 (storage ID DS-1929896092-127.0.1.1-50010-1412933345417) Service to localhost/127.0.0.1: 9000
09:49:02, 502 info org. Apache. hadoop. HDFS. server. datanode. datanode: removed block pool BP-1615382850-127.0.1.1-1412990967046 (storage ID DS-1929896092-127.0.1.1-50010-1412933345417)
09:49:04, 502 warn org. Apache. hadoop. HDFS. server. datanode. datanode: exiting datanode
2014-10-11 09:49:04, 504 info org. Apache. hadoop. util. exitutil: exiting with status 0
09:49:04, 506 info org. Apache. hadoop. HDFS. server. datanode. datanode: shutdown_msg:
The reason is that the clusterid of datanode does not match the namterid of namenode.
Open the directory corresponding to datanode and namenode configured in the hdfs-site.xml, open the version in the current folder respectively, you can see that the clusterid items are as recorded in the log, indeed inconsistent, modify the clusterid of the version file in datanode to be consistent with that in namenode, restart DFS (execute the start-dfs.sh), and then execute the JPS command to see that datanode has started properly.
Cause of this problem: After formatting DFS for the first time, hadoop is started and used, and HDFS namenode-format is re-executed. At this time, the clusterid of namenode will be re-generated, the clusterid of datanode remains unchanged.
Hadoop -- datanode cannot be started