Get HDFS cluster name


What's inside this article ⌄
  • Get HDFS cluster name Spring Boot Yarn
  • Spring Boot Yarn get HDFS cluster name
  • HDFS cluster name

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

@Autowired
Configuration conf;

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

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