我见过mapreduce程序使用/添加core-site.xml作为程序中的资源。core-site.xml在mapreduce程序中是什么或如何使用?
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"));
30byixjq2#
core-site.xml和hdfs-site.xml将表示hadoop及其hdfs,这样您的mapreduce程序将找到要指出的集群和要执行的集群。。
2条答案
按热度按时间tzdcorbm1#
从文档中,除非显式关闭,否则hadoop默认指定两个资源,从类路径按顺序加载:
core-default.xml:hadoop的只读默认值,core-site.xml:给定hadoop安装的特定于站点的配置
30byixjq2#
core-site.xml和hdfs-site.xml将表示hadoop及其hdfs,这样您的mapreduce程序将找到要指出的集群和要执行的集群。。