Yuval Asked: 2011-03-09 09:33:21 +0800 CST2011-03-09 09:33:21 +0800 CST 2011-03-09 09:33:21 +0800 CST Is there a way to get a list of Hadoop cluster machines from one of the data nodes? 772 I have access to a data node in a Hadoop cluster, and I'd like to find out the identity of the name nodes for the same cluster. Is there a way to do this? cluster hadoop discovery 2 Answers Voted user22656 2011-03-16T01:49:30+08:002011-03-16T01:49:30+08:00 You can read the configuration file of the datanode, specifically hdfs-site.xml. It will list the namenode that the datanode will try to connect to. Sujit Kadam 2016-06-09T02:39:24+08:002016-06-09T02:39:24+08:00 use below script #!/bin/bash date >> list_of_datanodes bin/hadoop dfsadmin -report > dfsstat.txt cat dfsstat.txt |grep 'Datanodes available' --color >> list_of_datanodes cat dfsstat.txt |grep 'Name:' --color >> list_of_datanodes rm -rf dfsstat.txt
You can read the configuration file of the datanode, specifically
hdfs-site.xml
. It will list the namenode that the datanode will try to connect to.use below script