188.8.131.52. Configuring Interaction between Middleware Servers
Middleware servers can maintain shared lists of user sessions and other objects and coordinate invalidation of caches. The cuba.cluster.enabled property should be enabled on each server to achieve this. An example of the
app_home/local.app.properties file is shown below:
cuba.cluster.enabled = true cuba.webHostName = host3 cuba.webPort = 8080
Interaction mechanism is based on JGroups. The platform provides two configuration files for JGroups:
jgroups.xml- a UDP-based stack of protocols which is suitable for local network with enabled broadcast communication. This configuration is used by default when the cluster is turned on.
jgroups_tcp.xml- TCP-based stack of protocols which is suitable for any network. It requires explicit setting of cluster members addresses in
TCPPING.initial_hostsparameters. In order to use this configuration, set cuba.cluster.jgroupsConfig application property.
If there is a firewall between your middleware servers, don’t forget to open firewall ports according to your
In order to set up JGroups parameters for your environment, copy the appropriate
jgroups.xml file from the root of
cuba-core-<version>.jar to your project core module or to
tomcat/conf/app-core and modify it.
ClusterManagerAPI bean provides the program interface for interaction between servers in the Middleware cluster. It can be used in the application – see JavaDocs and usages in the platform code.