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.

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

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

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

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

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

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?

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

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

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