Oozie Workflow 使用不正确的用户目录

Oozie Workflow uses incorrect user directory

我正在尝试执行同事编写的 oozie 工作流。我执行这个命令:

oozie job -config ./job.properties -run

我已经在 job.properties 中设置了参数,包括我的 user.name,当我检查日志时,我可以看到工作流程中使用的这些值 - 在我的 hdfs 目录中创建文件(例如exportDir=/user/${user.name}/ra_export)。但在工作流程的某个时刻,它因权限错误而失败,因为它试图修改我同事目录中的某些内容。就好像 ${user.name} 被缓存在某个地方,并且正在使用旧值。有没有人见过这样的行为,如果有,解决方案是什么?

更新:

这是日志的失败部分:

  1215755 [main] INFO  org.apache.hadoop.hive.ql.exec.FileSinkOperator  - Moving tmp dir: hdfs://hadoop-name-01.mycompany.com:8020/tmp/hive-staging_hive_2015-08-06_19-51-57_511_3052536268795125086-1/_tmp.-ext-10000 to: hdfs://hadoop-name-01.mycompany.com:8020/tmp/hive-staging_hive_2015-08-06_19-51-57_511_3052536268795125086-1/-ext-10000
  1215761 [main] INFO  org.apache.hadoop.hive.ql.log.PerfLogger  - <PERFLOG method=task.MOVE.Stage-0 from=org.apache.hadoop.hive.ql.Driver>
  1215762 [main] INFO  org.apache.hadoop.hive.ql.exec.Task  - Loading data to table client_reporting.campaign_web_events_export from hdfs://hadoop-name-01.mycompany.com:8020/tmp/hive-staging_hive_2015-08-06_19-51-57_511_3052536268795125086-1/-ext-10000
  1215821 [main] ERROR org.apache.hadoop.hive.ql.exec.Task  - Failed with exception Permission denied: user=clark.bremer, access=WRITE, inode="/user/john.smith/ra_export":john.smith:john.smith:drwxr-xr-x

但我可以从同一日志的顶部看到 job.properties 变量替换已成功进行:

  Starting the execution of prepare actions
  Deletion of path hdfs://hadoop-name-01.mycompany.com:8020/user/clark.bremer/foo_export succeeded.
  Creating directory at /user/clark.bremer/foo_export succeeded.
  Completed the execution of prepare actions successfully

但是正如您在日志的失败部分所见,它使用了错误的用户名(john.smith 而不是 clark.bremer)和错误的导出目录(ra_export而不是 foo_export)。约翰上次 ra_export 使用此工作流程时 运行。

这是我的 job.properties 文件的一部分:

user.name=clark.bremer
jobTracker=hadoop-name-01.mycompany.com:8032
nameNode=hdfs://hadoop-name-01.mycompany.com:8020
exportDir=/user/${user.name}/foo_export

下面是创建 table:

的查询的一些片段
 CREATE EXTERNAL TABLE IF NOT EXISTS client_reporting.campaign_web_events_export
        ....
 stored as textfile location '${EXPORTDIR}/campaign_web_events';
 insert overwrite table client_reporting.campaign_web_events_export

其中 EXPORTDIR 在我的用户目录中。

您尝试访问的 Hive Table,您是否检查过,在 Hive Table.

中创建了哪个用户

您能否删除现有的 Hive Table 并为您的用户创建一个新的 table,运行 相同的作业并检查状态