我正在尝试执行同事编写的 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
)。 John 上次运行此工作流时使用了 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
下面是创建表的查询的一些片段:
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 表,您是否检查过该 Hive 表是哪个用户创建的。
你能否删除现有的 Hive 表并为你的用户创建一个新表,然后运行相同的作业并检查状态
关于hadoop - Oozie Workflow 使用不正确的用户目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31865739/