Use of core-site.xml in mapreduce program

569 Views Asked by At

I have seen mapreduce programs using/adding core-site.xml as a resource in the program. What is or how can core-site.xml be used in mapreduce programs ?

2

There are 2 best solutions below

0
On BEST ANSWER

From documentation, Unless explicitly turned off, Hadoop by default specifies two resources, loaded in-order from the classpath:

core-default.xml : Read-only defaults for hadoop, core-site.xml: Site-specific configuration for a given hadoop installation

Configuration config = new Configuration();
config.addResource(new Path("/user/hadoop/core-site.xml")); 
config.addResource(new Path("/user/hadoop/hdfs-site.xml")); 
0
On

Core-site.xml and HDFS-site.xml will denote the hadoop and its hdfs so that your mapreduce program will findout the which cluster to be pointing out and where it to be performed..