To set up BellaDati in cluster mode using Tomcat containers is a bit different compared to doing it in Glassfish (documented at Scaling BellaDati).

Set up

Even though Tomcat supports running in a cluster mode, we can't do it with BellaDati as it requires HTTP session objects to be serialisable which is currently not possible. Because of that the BD cluster must be set up as following:

  1. Install Tomcat on each node which should be part of the BD cluster - see Installing BellaDati on Tomcat.
  2. For each Tomcat instance add following JVM properties to either CATALINA_OPTS or to JAVA_OPTS environment variables (see point 4.4 on the Installing BellaDati on Tomcat page):

    -Dapplication.actor.server.port=<port> -Dtapestry.clustered-sessions=true -Dapplication.servers=<servers-list>

    where:

    • <port> - is the port to be used by servers for in-cluster communication, e.g. 2335 and
    • <servers-list> - is the comma separated list of <host>:<port> addresses of each node in the cluster, e.g. 172.31.38.23:2335,172.31.13.180:2335,172.31.45.195:2335,172.31.2.41:2335.
  3. Deploy the BellaDati WAR file to each of the servers and start each of the Tomcat servers - see below.
  4. Set up the load balancer and point it to each of the nodes in the BD cluster.

It may be neccessary to add another JVM property to direct Akka to run under remote IP address of the host and not local (127.0.0.1), otherwise nodes wouldn't be able to talk to each other. The JVM property is -Dapplication.actor.server.host=<remote IP of the host>

BellaDati (re-)deployment

As each server in the BD cluster is running as a separate Tomcat installation, the (re-)deployment of BellaDati can't be done from a single central place as it is in case of Glassfish set up (see Scaling BellaDati). 

To (re-)deploy a new version of BellaDati:

  1. Stop a single Tomcat server.
  2. Deploy a new version of BellaDati by copying the WAR file to a path specified in Tomcat's BD context file (see point 4.1 on the Installing BellaDati on Tomcat page).
  3. Start the Tomcat server.
  4. Repeat steps 1-3 on all the nodes in the cluster.




  • No labels