2010/11/1 Leonko <the.leo...@gmail.com>

> [...]
> >  2.  Make your application server tolerant of database downtime (that
> > is, have the applications generate sensible errors while the db is down
> > and recover when it is up, rather than just crash and require an
> > application server restart).
>
> If appserver (java app server like jboss)  start and can't find db
> it's crash and need to restart by hand.  We are unable to do anything
> with it.
>

Make a start script for the Appserver which do the steps for you:

#! /bin/sh

checkdb () {
  [... code to check if DB is up ...]
}

startdb () {
  [... code to start DB if down ...]
}

startApp () {
  [... code to start App if down ...]
}

if [ ! $(checkdb) ]; then
  startdb
  sleep 60
  if [ ! $(checkdb) ]; then
    echo "Failed, couldn't start DB!"; exit
  else
    startApp
  fi
fi

You can also implement it as a watchdog if you put your code in a construct
like this:

while true; do
  [... start logic with checks ...]
  sleep 30
done

Kind regards, Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to