Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

question on oozie SSH action

avatar
Expert Contributor

Hi,

I need to execute a shell script in a remote server from hadoop server. So I am planning to use oozie SSH action for this. I have 2 basic questions regarding oozie actions.

1. for passwordless SSH, I need to share the public keys between 2 servers. In case of oozie SSH action, where does the oozie workflow initiate the SSH action from? Does it execute from any of the data nodes? If so, how to setup the SSH or get the public keys.

2. Does the oozie Shell action execute from any of the available data nodes or is there any specific way this execution server is identified?

Thanks!

1 ACCEPTED SOLUTION

avatar

@R M

When you create the SSH action, you can give Oozie the username and hostname to execute the command:

<workflow-app name="[WF-DEF-NAME]" xmlns="uri:oozie:workflow:0.1">
    ...
    <action name="[NODE-NAME]">
        <ssh xmlns="uri:oozie:ssh-action:0.1">
            <host>[USER]@[HOST]</host>
            <command>[SHELL]</command>
            <args>[ARGUMENTS]</args>
            ...
            <capture-output/>
        </ssh>
        <ok to="[NODE-NAME]"/>
        <error to="[NODE-NAME]"/>
    </action>
    ...
</workflow-app>

The command needs to exist on the node you specify, and the command will be run as the user specified in the action definition from that user's home directory. This page of the oozie docs has some additional information as well.

View solution in original post

3 REPLIES 3

avatar

@R M

When you create the SSH action, you can give Oozie the username and hostname to execute the command:

<workflow-app name="[WF-DEF-NAME]" xmlns="uri:oozie:workflow:0.1">
    ...
    <action name="[NODE-NAME]">
        <ssh xmlns="uri:oozie:ssh-action:0.1">
            <host>[USER]@[HOST]</host>
            <command>[SHELL]</command>
            <args>[ARGUMENTS]</args>
            ...
            <capture-output/>
        </ssh>
        <ok to="[NODE-NAME]"/>
        <error to="[NODE-NAME]"/>
    </action>
    ...
</workflow-app>

The command needs to exist on the node you specify, and the command will be run as the user specified in the action definition from that user's home directory. This page of the oozie docs has some additional information as well.

avatar

In case of oozie SSH action, where does the oozie workflow initiate the SSH action from? Does it execute from any of the data nodes?

It executes from the current Oozie server, which usually runs on a master node. Deploy your SSH private keys there. See this article on how to go from start to finish.

avatar
Expert Contributor

Thanks, I was able to set up the SSH and it is working. But I have a question.

What is this oozie ID? I am logging in to Linux using my ID. I submit the workflow either using my ID or I do a kinit to other ID and submit the workflow using that ID.

When I see in the UI logs, oozie workflow is shown to be submitted using either my ID or other ID for which ticket was obtained using Kinit.

What I dont understand is where does this "oozie" user id fit in. Even I had to go to the home directory of this user "oozie" and get its keys and added it to my destination server authprized_keys file. Can you please explain the purpose of this id? And also how to find this "oozie user id" Is this user id available in oozie-site.xml? Based on this article I also searched for oozie id, but what if it were different? how to find this oozie id?

Thanks!