【发布时间】:2015-06-14 15:09:13
【问题描述】:
我已经看到 mapreduce 程序使用/添加 core-site.xml 作为程序中的资源。什么是 core-site.xml 或如何在 mapreduce 程序中使用?
【问题讨论】:
我已经看到 mapreduce 程序使用/添加 core-site.xml 作为程序中的资源。什么是 core-site.xml 或如何在 mapreduce 程序中使用?
【问题讨论】:
来自documentation, 除非明确关闭,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"));
【讨论】:
Core-site.xml 和 HDFS-site.xml 将表示 hadoop 及其 hdfs,以便您的 mapreduce 程序将找出要指出的集群以及要执行的位置..
【讨论】: