On 2013-02-21 18:01, Alejandro Abdelnur wrote:

Thanks Alejandro,

Oozie provides MR and Pig actions that propagate the user identity
correctly. If you are using a shell action your shell action ends up
running as the Unix user running the task, in an unsecure cluster is
typically the mapred user, in a secure cluster is the same user that
submitted the job to Oozie

I fully understand that. My question was about how to make things work for the shell action since I believe that my use case is legitimate. What is the purpose of the shell action if even a simple operation like creating a new file leads to a bad file ownership ?

you want to run jobs against the cluster using the correct user, you should
use the Oozie provided actions for that effect (MR, Pig, Sqoop, Hive,
distcp, etc).

In the meantime I did some experimentation with the HADOOP_USER_NAME environment variable. Specifying it solve almost all my issues (Pig & MR job are run using the right user, files have the right owner). You even don't have to hard code the user name since you can use the user() EL function.

   <exec>[SHELL-COMMAND]</exec>
            <argument>[ARG-VALUE]</argument>
                ...
            <env-var>HADOOP_USER_NAME=${wf:user()}</env-var>
            <file>[FILE-PATH]</file>
            ...
   </exec>


Wouldn't it be good to do something like this automatically rather the put the burden on the user ? I don't see why an user would prefer the current behavior.

I'm not sure if this solution would work in secure mode too. But I definitely believe that there is a better option than forcing the user to always use Oozie actions even when another tool is more suitable for the job.


BTW: Does the Java action suffers from the same limitation ?


Thanks,


-- Clément

Reply via email to