Get HDFS cluster name Spring Boot Yarn

Let’s say you need to get the name of hdfs cluster in an application. To do this, you need to get the org.apache.hadoop.conf.Configuration object:

Configuration conf;

In the place we need, we get the fs.defaultFS property value:

String hdfsName = conf.get("fs.defaultFS");"HDFS cluster name = " + name);

If you still have any questions, feel free to ask me in the comments under this article or write me at

If I saved your day, you can support me 🤝

Leave a Reply

Your email address will not be published. Required fields are marked *