Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To use this feature the following must be set on each system in the master/slave setup:

  • $SERVICEMIX$KARAF_HOME/etc/system.properties file updated to reflect the below entries.
No Format
servicemixkaraf.lock=true
servicemixkaraf.lock.delay=10

Simple Lock File with container level locking.

The Container Level locking mechanism allows bundles to be loaded into the slave kernel instance in order to provide faster failover performance. The Container Level refers to the starting priority assigned to each bundle in the OSGI container. These start levels are specified in $SERVICEMIX$KARAF_HOME/etc/startup.properties, in the format jar.name=level. The core system bundles have levels below 50, where as user bundles have levels greater than 50.

...

To use this feature the following must be set on each system in the master/slave setup:

  • $SERVICEMIX$KARAF_HOME/etc/system.properties file updated to reflect the below entries.
No Format
servicemixkaraf.lock=true
servicemixkaraf.lock.level=50
servicemixkaraf.lock.delay=10

Please note that when using a 'hot' spare on the same host the jmx remote port will need to be configured to a unique port to avoid bind conflicts. The servicemix start script can be edited to include the following:

...

  • Classpath updated to include JDBC driver.
  • $SERVICEMIX$KARAF_HOME/etc/system.properties file updated to reflect the below entries.
  • $SERVICEMIX$KARAF_HOME/bin/servicemix karaf updated to have unique jmx remote port set if instances reside on same host.
No Format
servicemixkaraf.lock=true
servicemixkaraf.lock.class=org.apache.servicemixfelix.kernelkaraf.main.DefaultJDBCLock
servicemixkaraf.lock.level=50
servicemixkaraf.lock.delay=10
servicemixkaraf.lock.jdbc.url=jdbc:derby://dbserver:1527/sample
servicemixkaraf.lock.jdbc.driver=org.apache.derby.jdbc.ClientDriver
servicemixkaraf.lock.jdbc.user=user
servicemixkaraf.lock.jdbc.password=password
servicemixkaraf.lock.jdbc.table=SERVICEMIXKARAF_LOCK
servicemixkaraf.lock.jdbc.clustername=smx4karaf
servicemixkaraf.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 Karaf 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.

The Container Level locking mechanism allows bundles to be loaded into the slave kernel instance in order to provide faster failover performance. The Container Level refers to the starting priority assigned to each bundle in the OSGI container. These start levels are specified in $SERVICEMIX$KARAF_HOME/etc/startup.properties, in the format jar.name=level. The core system bundles have levels below 50, where as user bundles have levels greater than 50.

...