i have installed MySQL NDB cluster. It needs around 2-3 minutes to synchronise the database in between cluster nodes. Once the synchronisation finished only, I can start another application called heartbeat. Therefore in my shell script, I want to check the availability of the ndbd service all the times. Once this service become available, I need to start the heartbeat application in five minute time. Could you please help me to write the script.
migrated from stackoverflow.com Jul 14 '09 at 22:57
This question came from our site for professional and enthusiast programmers.
You could also try using the "wait" bash built-in command.
From "man bash"
You script could look something like this:
What I'd to is have the ndb script exec another script, so that it's not waiting for the 5 minutes to finish and blocking other services from starting.
I've put a sleep 300 (seconds) in here, cause you've specified 5 minutes, but checking if the ndb sync is done would be much better.