In GateIn project we sometime have to deal with the setup of a JBoss cluster. While JBoss clustering is quite easy to configure there are things you need to configure such as a shared database. In addition when doing tests you need to start from a fresh database. I will give you a tip I’m using when I’m setting up a GateIn cluster that can help you to save time for setting up a database.

By default GateIn uses the famous embedded database HSQLDB and it is very convenient because

  1. Deployed with GateIn, no need for extra setup
  2. Sufficient for doing development
  3. Fast
  4. Easy to erase the database and start from fresh

When dealing with a GateIn cluster (or any other application that requires a database), ultimately you need a database that will be used by the cluster nodes. Does it mean I have to give up HSQLSDB? the answer is no with an extra configuration step.

By default HSQLDB comes as an in process database, but it is possible to use other configuration modes:

  1. Make the database open a port to accept remote connection
  2. Connect to a remote database

We can use those two setup an asymmetric configuration of two nodes. The first node datasource owns the database and the second node datasource uses the database setup by the first node remotely.

blog comments powered by Disqus


08 September 2010