问题Bug:jps启动后datanode没打开原因:多次格式化HDFS,即hdfs namenode -format ,导致namenode和datanode集群不一致
解决:将data下的clusterID改成name下的clusterID(位置当前·用户家目录)
1.name节点位置和current下的version
[root@huli name]# pwd
/tmp/hadoop-hadoop/dfs/name
[root@huli name]# ll
total 4
drwxrwxr-x 2 hadoop hadoop 4096 Sep 8 22:45 current
2.查看clusterID
#data
[root@huli current]# cat VERSION
#Thu Sep 08 21:17:55 CST 2022
storageID=DS-3c67a794-88b4-44c5-ac1d-58d5160c22e0
clusterID=CID-cc244d0f-1362-4a36-9b76-77dca858117e
cTime=0
datanodeUuid=68d4964e-3e20-40ea-9875-120e069469d1
storageType=DATA_NODE
layoutVersion=-57
#namesecondary
[root@huli namesecondary]# cd current/
[root@huli current]# cat VERSION
#Thu Sep 08 21:18:58 CST 2022
namespaceID=868983427
clusterID=CID-cc244d0f-1362-4a36-9b76-77dca858117e
cTime=1662643059522
storageType=NAME_NODE
blockpoolID=BP-1922997848-172.27.111.210-1662643059522
layoutVersion=-64
#name
[root@huli name]# cd current/
[root@huli current]# cat VERSION
#Thu Sep 08 21:53:05 CST 2022
namespaceID=566624069
clusterID=CID-4cbd08dc-24c8-4b92-a283-bfaed0861c79
cTime=1662645185212
storageType=NAME_NODE
blockpoolID=BP-425923728-172.27.111.210-1662645185212
layoutVersion=-64
3.更改datanode里VERSION的clusterID=namenode的clusterID即可