BellaDati is not depending on selected cluster environment, you can run it on GlassFish, Websphere or JBoss, but there are several parameters contained in application.properties (see BellaDati WAR Configuration) which need to be changed in order to run BellaDati in the cluster):
application.actor.server.port=2335 tapestry.clustered-sessions=true application.servers=192.168.1.10:2335,192.168.1.11:2335
The example above defines parameters for 2 servers in cluster, running on 192.168.1.10 and 192.168.1.11.
Cluster overview page
Administrators have access to cluster overview pages, which shows useful information about the servers in the cluster.
Glassfish cluster on Linux example
Installing cluster node prerequisites:
- BellaDati must be installed on one server (main server)
- both servers (main server with BellaDati installation and Node server for installing instance node) must have valid hostname and must be visible to each other
- on Linux, resolvable hostname must be contained in /etc/hostname and /etc/hosts must contain both server names on both servers.
- JAVA and JAR (part of Java distribution) must be installed on server to be used as instance node
- SSH user with password or certificate authentication
- Port 2335 must be opened to both servers
- Edit application.properties as defined in
This example shows configuration of Glassfish SSH node (complete description can be found in Glassfish reference manual)
For this example we assume, we have BellaDati installed on belladati-main server and node server (without BellaDati installation) running on node1 host, then an SSH user glassfish with password authentication stored in password file:
AS_ADMIN_SSHPASSWORD=glassfish
Add cluster configuration to glassfish5/glassfish/domains/domain1/applications/belladati/WEB-INF/classes/conf/application.properties
Example for 2 servers clustertapestry.clustered-sessions=true application.servers=belladati-main:2335,node1:2335
- Have two linux servers with SSH access (user and password or certificate).
Create SSH node over console or asadmin command
./asadmin create-node-ssh --nodehost node1 --installdir /home/glassfish --install=true --sshuser glassfish --passwordfile password node1
This command creates /home/glassfish/glassfish directory on the node server.
Comment out AS_JAVA in /home/glassfish/glassfish/glassfish5/glassfish/config/asenv.conf on the node server.
Verify SSH node by pinging the server
./asadmin ping-node-ssh node1
Using console:
Create cluster
./asadmin create-cluster belladati-cluster
Using console:
Create node instance and assign it to newly create cluster
./asadmin create-instance --node node1 --cluster belladati-cluster instance-node1
Start instance
./asadmin start-instance instance-node1
Configure JDBC resources targets
./asadmin create-resource-ref --target belladati-cluster jdbc/belladati_db
Using console:
- Configure Application targets
- Start cluster
Updating BellaDati in Cluster
We recommend updating only the WAR file. It is necessary to keep the currently existing application.properties file.
Troubleshooting
- When installing Glassfish cluster on Windows, WMI and DCOM services must be enabled. Please refer to https://technet.microsoft.com/en-us/library/cc771387.aspx for enabling DCOM and to https://technet.microsoft.com/en-us/library/cc771551.aspx for enabling the WMI
- JDK has to be installed and path set to as_java must be set on both machines