Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

shell action in oozie

shell action in oozie

Expert Contributor

I am trying to execute a shell script from oozie. The script is used to download a file from a remote server using scp command.

The shell script looks like this:

sudo -u test scp userName@ServerIP:pathToFileONRemoteServer/export_all_products.csv /home/test

Now, I am using sudo - u test because password less ssh has been enabled for test user only. I came across error messages that suggested disabling tty and that's what I did for test user.

However, Now I get:

sudo: no tty present and no askpass program specified
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]

Why is that and how do we fix this? I am using hue and can't seem to enable password less ssh for hue user as it isn't a shell user and isn't a folder under with username under home directory.

Is there a way around this?

4 REPLIES 4
Highlighted

Re: shell action in oozie

May I ask why you cannot simply run the oozie workflow as user test. yarn will use the linuxtaskcontroller to execute a script as the user who runs the oozie workflow. The shell action can be run on any datanode node so I don't assume you made sudo -u work passwordless on all datanodes.

Alternatively you can use the SSH action to execute a program on a specific node. ( then you need to allow the oozie user password less SSH to the user on the node who is running the workflow. ) In that case everything is completely as if you run the command locally for example on an edge node.

Highlighted

Re: shell action in oozie

Expert Contributor

@Benjamin Leonhardi: The server I am trying to fetch data from isn't a part of hadoop cluster. Do you think it is still possible to do it?

Highlighted

Re: shell action in oozie

That's not the question. The point is where you run the scp command and as whom.

If you run shell it can be executed on any datanode. So all datanodes need to be able to run the command you put into there successfully and have access to your remote machine.

If you use ssh action you can force the execution of the scp command unto an edge node. Only that one then needs access to your remote server.

Highlighted

Re: shell action in oozie

Super Guru
@Simran Kaur

I agree with what @Benjamin Leonhardi has mentioned.

Just to add, you can use below link for Oozie SSH action

https://community.hortonworks.com/articles/7413/oozie-ssh-action.html

Don't have an account?
Coming from Hortonworks? Activate your account here