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.

ExecuteStreamCommand requires file in all machines

ExecuteStreamCommand requires file in all machines

New Contributor

Hello,

i have two node nifi cluster and i have a scenario that i need to run the bash script to connect to database. now file is available in one machine and when i run this it returns error like cannot run program./zz.sh (in directory /home/nifi/test/) no such file or directory.

i created test directory in all two machines under /home/nifi and i have enough permissions.
now i created zz.sh file in one of the nifi instance(non primary node) and gave 777 permission.

my flow:

generateflowfile(allnodes) --> executestreamcommand

i tried like create zz.sh file only in primary node and set run on primary node only in generatedataflow it works fine.

but i need to workout this as generateflowfile(allnodes).


any help would be appreciated.

@Shu @Matt Burgess @Timothy Spann


110225-executestream.png

1 REPLY 1
Highlighted

Re: ExecuteStreamCommand requires file in all machines

Super Guru

@Satish Karuturi

This is an expected behaviour from ExecuteStreamCommand processor and best practice is to place shell script file on all nodes of NiFi cluster.

As you are having 2 node nifi cluster and we are not able to control which will be primary node and ExecuteStreamCommand processor will run only on primary node.

In case of primary node changes nifi will pick the shell script from the active primary node and continue to execute the script without any issues..!




In addition you can also use ExecuteProcess processor to execute Shell script in NiFi.