Support Questions

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

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

avatar
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

avatar
@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/

avatar
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?

avatar

@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/