This chapter will demonstrate how to configure failover deployments.
Simple Lock File
To use this feature the following must be set on each system in the master/slave setup:
- $SERVICEMIX_HOME/etc/system.properties file updated to reflect the below entries.
servicemix.lock=true
JDBC Locking
To use this feature the following must be set on each system in the master/slave setup:
- Classpath updated to include JDBC driver.
- $SERVICEMIX_HOME/etc/system.properties file updated to reflect the below entries.
servicemix.lock=true servicemix.lock.class=org.apache.servicemix.kernel.main.DefaultJDBCLock servicemix.lock.jdbc.url=jdbc:derby://dbserver:1527/sample servicemix.lock.jdbc.driver=org.apache.derby.jdbc.ClientDriver servicemix.lock.jdbc.user=user servicemix.lock.jdbc.password=password servicemix.lock.jdbc.table=SERVICEMIX_LOCK servicemix.lock.jdbc.clustername=smx4 servicemix.lock.jdbc.timeout=30
Note:
- Will fail if jdbc driver is not on classpath.
- The database name "sample" will be created if it does not exist on the db.
- First SMX4 instance to acquire the locking table is the master instance.
- 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.