Support Questions
Find answers, ask questions, and share your expertise

How to execute .sh file? from lacoal machine to hadoop

New Contributor

I have .sh file. which is working in linux. I want to execute that file in hadoop environment.

can anyone porvide me some knowledge?

3 REPLIES 3

@Azad Kumar

There are 3 ways.

1. hadoop fs -cat /tmp/test.sh|exec sh

2. You can install HDP NFS and mount the hdfs directory on local file system from where you can execute your script.

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.3.4/bk_hdfs_nfs_gateway/content/user-guide-hdfs...

3. You can write an oozie shell workflow and call your .sh HDFS file inside the workflow.

http://rogerhosto.com/apache-oozie-shell-script-example/

New Contributor

@nshelke

hadoop fs -cat /tmp/test.sh|exec sh

Should I execute this command in Sandbox terminal?

Where should I upload file test.sh?

how I will copy test.sh from local machine?

@Azad Kumar

Should I execute this command in Sandbox terminal? yes

Where should I upload file test.sh? /tmp folder

how I will copy test.sh from local machine?

hadoop fs -copyFromLocal <local path of test.sh file> /tmp/

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.