I am using Scalr for scaling the website server.
On the Apache server, I have installed Sakai, and created an boot-up script for Linux machine.
The question is, how can I ensure that MySQL Instance is booted up and running before the Apache server is booted up, because if Apache server gets booted up first, then the connection for running Sakai will fail, and that causes all sorts of problems.
How I can ensure the instance start at the way I need it to start? I am still new to Scalr so any help would be appreciated.
Thanks
If you wrote the Apache startup-script yourself, you can include a check if the database instance is already running.
You can include a simple wait-loop:
Obivously you have to create some testuser and the test-database in Mysql:
Simply put the while-loop somewhere in the start) part of your script. If your system is some kind of Redhat-system, you will notice that the start-script /etc/init.d/httpd has a line like this:
If you add $mysqld to that line, Apache will insist on a running mysqld before startup:
However, the disadvantage is that the Apache startup will fail instead of waiting for running mylsqd.
Good luck, Alex.