Hi, yes, the database is also configured for failover. Master instance of database is on one server (A) and slave instance is on the other physical server. The setup is similar to ServiceMix using ActiveMQ when ActiveMQ is configured for failover (there's master ActiveMQ and slave ActiveMQ running on different servers).
On Tue, Jun 14, 2011 at 10:59 PM, Christian Müller <[email protected]> wrote: > Hello Janne, > > you wrote "database instances" and "database-master"/"database-slave". I'm > wondering whether you really use two database instances? > Both ServiceMix instances uses the same database and the lock mechanism > configuration in system.properties are exactly the same. > > As JB wrote, the fail-over mechanism comes from Karaf: > http://karaf.apache.org/manual/2.2.2-SNAPSHOT/users-guide/failover.html > Note: The right configuration for the karaf.lock.class is: > org.apache.karaf.main.DefaultJDBCLock > > Best, > Christian > > On Fri, May 27, 2011 at 8:52 AM, janne postilista < > [email protected]> wrote: > >> ServiceMix JDBC locking >> >> http://servicemix.apache.org/kernel/67-configuring-failover-deployments-available-in-110.html >> can be used for configuring a master/slave failover setup. >> Documentation states that if master servicemix loses database >> connection, it shuts down: >> >> "If connection to the DB is lost then the master instance will attempt >> to gracefully shutdown, allowing a slave instance to become master >> when the DB service is restored. The former master will require manual >> restart." >> >> This would cause a problem. >> - we have a server A and server B with master-slave configured >> servicemix and database instances. >> - initially server A holds servicemix-master and database-master, >> while server B holds servicemix-slave and database-slave >> - some updates or problems may cause server B to become >> servicemix-master. server A is servicemix-slave. server A still has >> database-master. >> - so we have servicemix master in server B and database master in server A >> - now if whole server A shuts down, there is a delay when server B >> database-slave activates, and in the meanwhile database is >> inaccessible >> - server B had servicemix-master. Now it loses database connection and >> gracefully shuts itself down >> - end result: neither servicemix is running >> >> 1. does the JDBC locking failover mechanism indeed shutdown the master >> instance immediately when it loses the connection, or are there any >> retries or delays? >> 2. if there a way to prevent this "graceful shutdown" feature or >> otherwise prevent this scenario? >> >
