在mapreduce程序中使用core-site.xml

7qhs6swi  于 2021-05-30  发布在  Hadoop
关注(0)|答案(2)|浏览(487)

我见过mapreduce程序使用/添加core-site.xml作为程序中的资源。core-site.xml在mapreduce程序中是什么或如何使用?

tzdcorbm

tzdcorbm1#

从文档中,除非显式关闭,否则hadoop默认指定两个资源,从类路径按顺序加载:
core-default.xml:hadoop的只读默认值,core-site.xml:给定hadoop安装的特定于站点的配置

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

30byixjq2#

core-site.xml和hdfs-site.xml将表示hadoop及其hdfs,这样您的mapreduce程序将找到要指出的集群和要执行的集群。。

相关问题