Reputation: 1439
When running the hdfs dfs -mkdir /abc
I get the following error.
Exception in thread "main" java.lang.RuntimeException: core-site.xml not found
at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2577)
at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2503)
at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2409)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1144)
at org.apache.hadoop.conf.Configuration.set(Configuration.java:1116)
at org.apache.hadoop.conf.Configuration.setBoolean(Configuration.java:1454)
at org.apache.hadoop.util.GenericOptionsParser.processGeneralOptions(GenericOptionsParser.java:319)
at org.apache.hadoop.util.GenericOptionsParser.parseGeneralOptions(GenericOptionsParser.java:485)
at org.apache.hadoop.util.GenericOptionsParser.<init>(GenericOptionsParser.java:170)
at org.apache.hadoop.util.GenericOptionsParser.<init>(GenericOptionsParser.java:153)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:64)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
at org.apache.hadoop.fs.FsShell.main(FsShell.java:372)
the path to my core-site.xml is /usr/local/hadoop/etc/hadoop/core-site.xml.
How to fix this error?
Upvotes: 5
Views: 7901
Reputation: 850
Can you try to set the below variable in ~/.bash_profile or at the start of the script.
export HADOOP_CONF_DIR=**location of your hadoop in local**
like (/home/hadoop/hadoop-2.7.3/etc/hadoop
)
You can also look into the below link :
Upvotes: 6