Oozie shell操作不会以提交用户身份运行 [英] Oozie shell action not running as submitting user

查看:1223
本文介绍了Oozie shell操作不会以提交用户身份运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个Oozie工作流,运行BASH shell脚本来执行一些配置单元查询并对结果执行一些操作。脚本运行但在访问某些HDFS数据时抛出权限错误。提交Oozie工作流的用户拥有权限,但脚本以纱线用户身份运行。

I've written an Oozie workflow that runs a BASH shell script to do some hive queries and perform some actions on the results. The script runs but throws a permission error when accessing some of the HDFS data. The user that submitted the Oozie workflow has permission but the script is running as the yarn user.

是否可以让Oozie以提交工作流的用户身份执行脚本? Hive和Java动作都以提交的用户身份执行,只是shell的行为有所不同。

Is it possible to make Oozie execute the script as the user who submitted the workflow? Hive and Java actions both execute as the submitted user, just shell is behaving differently.

以下是我的Oozie动作的大致轮廓

Here's the rough outline of my Oozie action

<action name="start_action"
        retry-max="12"
        retry-interval="600">
    <shell xmlns="uri:oozie:shell-action:0.1">
        <job-tracker>${jobTracker}</job-tracker>
        <name-node>${nameNode}</name-node>
        <job-xml>${WorkflowRoot}/hive-site.xml</job-xml>
        <exec>script.sh</exec>
        <file>${WorkflowRoot}/script.sh</file>
        <capture-output />
    </shell>
    <ok to="next_action"/>
    <error to="send_email"/>
</action>

我正在运行Oozie 4.1.0和HDP 2.1。

I'm running Oozie 4.1.0 and HDP 2.1.

推荐答案

使用Simple Security配置的所有群集都会发生此问题。您可以选择覆盖默认配置。

This issue will occur in all cluster that are configured using Simple Security. You've an option to override the default configuration. Include the below statement at the starting of the shell script will fix this issue.

export HADOOP_USER_NAME=<Name of submitted user>;

这篇关于Oozie shell操作不会以提交用户身份运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆