Issue
I am trying to run a couple of scripts relating to apache storm. I execute the commands through ssh and all these commands are executed on the same remote machine. For some how that does not work properly. Here is my code:
echo Begin!
ssh -i file root@IP 'nohup ./zookeeper-3.4.6/bin/zkCli.sh -server IP >/dev/null & '
echo Zookeeper connected
ssh -i file root@IP 'nohup ./apache-storm-0.9.3/bin/storm nimbus &'
echo Nimbus started
ssh -i file root@IP 'nohup ./apache-storm-0.9.3/bin/storm ui &'
echo UI started
ssh -i file root@IP 'nohup ./apache-storm-0.9.3/bin/storm supervisor &'
echo End!
So as expected the script is connecting zookeeper first and puts out "Zookeeper connected" then. After that the nimbus daemon is starting up and I get "Nimbus started". But then for some how the script seems stuck and I have no idea why?
EDIT: When I run the script locally, without the ssh part of the command it works out well. So that the problem has to be related to ssh?
Solution
Adding another "&" did it for me:
echo Begin!
ssh -i file root@IP 'nohup ./zookeeper-3.4.6/bin/zkCli.sh -server IP >/dev/null & '
echo Zookeeper connected
sleep 15
ssh -i file root@IP 'nohup ./apache-storm-0.9.3/bin/storm nimbus &' &
echo Nimbus started
sleep 15
ssh -i file root@IP 'nohup ./apache-storm-0.9.3/bin/storm ui &' &
echo UI started
sleep 15
ssh -i file root@IP 'nohup ./apache-storm-0.9.3/bin/storm supervisor &' &
echo End!
Answered By - Brave