hi, experts,

I am trying to get the local filesystem directory of data node. My cluster
is using CDH5.x (hadoop 2.3) and the default configuration. So the datanode
is under file:///dfs/dn. I didn't specify the value in hdfs-site.xml.

My code is something like:

conf = new Configuration()

// test both with and without the following two lines
conf.addResource (new
Path("/etc/hadoop/conf.cloudera.hdfs/hdfs-site.xml"));
conf.addResource (new Path("/etc/hadoop/conf.cloudera.hdfs/core-site.xml"));

// I also tried get("dfs.datanode.data.dir"), which also return NULL
String dnDir = conf.get("dfs.data.dir");  // return NULL

It looks like the get only look at the configuration file instead of
retrieving the info from the live cluster?

Many thanks for your help in advance.

Demai

Reply via email to