{channel.title!channel.name} - 楚淮公司周东林

hadoop启动后有NameNode没有9000端口

hadoop启动后,jps命令查看有namenode但是netstat 查看没有9000端口监听


解决方法:

1.关闭所有集群

 

[root@sxfj-ysfwq-10-4-22-16 sbin]# sh stop-all.sh
This script is Deprecated. Instead use stop-dfs.sh and stop-yarn.sh
Stopping namenodes on [Master]
Master: stopping namenode
10.4.22.17: no datanode to stop
10.4.22.18: no datanode to stop
10.4.22.19: no datanode to stop
Stopping secondary namenodes [0.0.0.0]
0.0.0.0: stopping secondarynamenode
stopping yarn daemons
stopping resourcemanager
10.4.22.17: stopping nodemanager
10.4.22.18: stopping nodemanager
10.4.22.19: stopping nodemanager
no proxyserver to stop

2.格式化namenode

 

[root@sxfj-ysfwq-10-4-22-16 sbin]# hadoop namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
18/10/22 15:43:17 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG:   host = Master/10.4.22.16
STARTUP_MSG:   args = [-format]
STARTUP_MSG:   version = 2.7.4

省略茫茫多------------

18/10/22 15:43:48 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
18/10/22 15:43:48 INFO util.ExitUtil: Exiting with status 0
18/10/22 15:43:48 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at Master/10.4.22.16

3.格式化namenode以后会导致节点服务器jps 查看不到DataNode

​3.1查看主服务器的 /hdfs/namenode/current/VERSION 文件 clusterID

[root@sxfj-ysfwq-10-4-22-16 sbin]# more /hdfs/namenode/current/VERSION
#Mon Oct 22 15:43:48 CST 2018
namespaceID=1743115032
clusterID=CID-a637c6f6-f9da-4988-8209-fd9db3323fe5
cTime=0
storageType=NAME_NODE
blockpoolID=BP-2037756970-10.4.22.16-1540194206607
layoutVersion=-63
[root@sxfj-ysfwq-10-4-22-16 sbin]# jps
18050 SecondaryNameNode
18917 Jps
15193 Master
18237 ResourceManager
17822 NameNode

3.2将其他节点服务器的 clusterID 改和主服务器一致。再次启动

[root@sxfj-ysfwq-10-4-22-17 ~]# vi /hdfs/datanode/current/VERSION
#Fri Mar 23 12:03:25 CST 2018
storageID=DS-a54bb9f7-039a-40e9-9d57-9e55ef695fbc
clusterID=CID-a637c6f6-f9da-4988-8209-fd9db3323fe5
cTime=0
datanodeUuid=0691a769-aa54-49cb-9bd7-83a73b2b207b
storageType=DATA_NODE
layoutVersion=-56
 
节点服务器
[root@sxfj-ysfwq-10-4-22-17 ~]# jps
1405 Worker
1053 DataNode
22455 Jps
31935 NodeManager
 
主服务器
[root@sxfj-ysfwq-10-4-22-16 ~]# jps
23526 Jps
2127 Master
7396 NameNode
7594 SecondaryNameNode
7681 ResourceManager
 
注意 /hdfs/datanode/ 的路径和hdfs配置的要一致。

 


浏览.发表于:2018-10-22 16:24:29