Mapreduce 作业配置文件位置

Mapreduce Job Configuration File Location

我在哪里可以找到已经 运行 的 java mapreduce 作业的作业配置文件,例如覆盖的默认设置和其他作业特定设置。我正在使用 hadoop 2.6.0。我假设每个 运行 的作业都有一个作业配置文件及其用户设置。很抱歉,如果重复这个问题,则无法找到确切的答案。在我的 yarn-site.xml 或 mapred-site.xml 中没有与此相关的内容。

在你的mapred-site.xml中,有配置参数:yarn.app.mapreduce.am.staging-dir

该参数的说明为:

The staging dir used while submitting jobs.

默认设置为:

/tmp/hadoop-yarn/staging    

此路径被翻译成:

{Value of config parameter `yarn.app.mapreduce.am.staging-dir`} + Path.SEPARATOR + user + Path.SEPARATOR + STAGING_CONSTANT

例如在我的mapred-site.xml中,这个值设置为:

<property>
    <name>yarn.app.mapreduce.am.staging-dir</name>
    <value>/user</value>
 </property>

所以这个路径被转换成:

/user/{user}/{STAGING_CONSTANT}

即:

/user/mballur/.staging/ => Where user -> mballur and STAGING_CONSTANT -> .staging

在此文件夹中,您将看到您的工作相关设置,当您的工作是 运行

例如如果我的应用程序 ID 是:application_1450100618247_0018,那么暂存文件夹将是:

/user/mballur/.staging/job_1450100618247_0018/

在此文件夹中,您可以看到以下文件:

job.jar
job.split
job.xml
job_1450100618247_0018_1.jhist
job_1450100618247_0018_1_conf.xml

此处 job.xml 包含有关您的作业的配置信息。 但是,当作业完成(成功或失败)时,作业的暂存目录将被删除。

工作历史休息 API:

如果您启用了历史服务器,那么您可以查看到目前为止执行的所有作业的历史记录。例如在此处检查 link:https://hadoop.apache.org/docs/r2.4.1/hadoop-yarn/hadoop-yarn-site/HistoryServerRest.html#Job_Conf_API

使用以下 REST 查询,您可以获得作业的配置:

GET http://<history server http address:port>/ws/v1/history/mapreduce/jobs/{job_id}/conf