Skip to content

hdfs-shell do not read conf file from files defines into HADOOP_CONF_DIR  #19

@jmercier-lbi

Description

@jmercier-lbi

Dear,

As I own a specifics FileSystem and using kereberos, I have a custom hdfs-site.xml and core-site.xml . So vanilla hdfs-shell did not work as it uses default configuration file defines from the classpath. As an example, core-default.xml is taken from hadoop-common jar.

image
legend: Application state while debugging

The environment variable HADOOP_CONF_DIR is set to: /usr/hdp/3.1.0.0-78/hadoop/conf/
which contained the required configuration files.

if I add explicitly after line 184

configuration.addResource(new Path("file:///usr/hdp/3.1.0.0-78/hadoop/conf/hdfs-site.xml"));
configuration.addResource(new Path("file:///usr/hdp/3.1.0.0-78/hadoop/conf/core-site.xml"));

These 2 lines solves my problem, which show that HADOOP_CONF_DIR is not used in order to discover resources files.

Moreover, I trace the process to read the configuration files and put a breakpoint when parsing the file . When the resource var is equaled to core-site.xml both the ùrlanddocvar was null` as it fails to find the resource.

So should I build with:

  • gradle by adding these xml files into the resourcedir
  • using the programmatic way by the use of configuration.addResource...
  • an another way to build with gradle in order to use HADOOP_CLASSPATH and HADOOP_CONF_DIR

thanks

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions