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.
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.
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.