Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer

use below script

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
share|improve this answer
Recursively deleting the dfsstat.txt files seems like overkill. – chicks Jun 8 at 13:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.