I'm trying to use the HA Singleton on JBoss EAP 6.4. I have two hosts: app-05
, app-06
and two groups: ADM
, DEV
. Both server groups use their own profiles based on standard HA profile and both use ha-sockets socket binding.
+-----------------------------------+
|Group v / Host > | app-05 | app-06 |
|-----------------+--------+--------|
| ADM | ADM_01 | ADM_02 |
|-----------------+--------+--------|
| DEV | DEV_01 | DEV_02 |
+-----------------------------------+
When I assign an application containing HA singleton to one of the groups the result is as I would expect. The app-05
server starts:
INFO [stdout] -------------------------------------------------------------------
INFO [stdout] GMS: address=app-05:DEV_01/singleton, cluster=singleton, physical address=10.7.0.131:55400
INFO [stdout] -------------------------------------------------------------------
INFO [o.i.r.t.j.JGroupsTransport] ISPN000094: Received new cluster view: [app-05:DEV_01/singleton|0] [app-05:DEV_01/singleton]
INFO [o.i.r.t.j.JGroupsTransport] ISPN000079: Cache local address is app-05:DEV_01/singleton, physical addresses are [10.7.0.131:55400]
INFO [o.j.a.clustering] JBAS010238: Number of cluster members: 1
and is elected as the HA singleton provider:
INFO [o.j.a.c.infinispan] JBAS010281: Started default cache from singleton container
INFO [o.j.a.c.singleton] JBAS010342: app-05:DEV_01/singleton elected as the singleton provider of the jboss.test.ha.singleton service
INFO [o.j.a.c.singleton] JBAS010340: This node will now operate as the singleton provider of the jboss.test.ha.singleton service
then app-06
server starts and forms a cluster:
INFO [stdout] -------------------------------------------------------------------
INFO [stdout] GMS: address=app-06:DEV_02/singleton, cluster=singleton, physical address=10.7.0.132:55400
INFO [stdout] -------------------------------------------------------------------
INFO [o.i.r.t.j.JGroupsTransport] ISPN000094: Received new cluster view: [app-05:DEV_01/singleton|1] [app-05:DEV_01/singleton, app-06:DEV_02/singleton]
INFO [o.i.r.t.j.JGroupsTransport] ISPN000079: Cache local address is app-06:DEV_02/singleton, physical addresses are [10.7.0.132:55400]
INFO [o.j.a.clustering] JBAS010238: Number of cluster members: 2
and ultimateley second app-06
is elected:
INFO [o.j.a.c.infinispan] JBAS010281: Started default cache from singleton container
INFO [o.j.a.c.singleton] JBAS010342: app-06:DEV_02/singleton elected as the singleton provider of the jboss.test.ha.singleton service
INFO [o.j.a.c.singleton] JBAS010340: This node will now operate as the singleton provider of the jboss.test.ha.singleton service
But when I assign the same application to the second group of servers strange things are happening. All FOUR servers form a cluster:
INFO [o.i.r.t.j.JGroupsTransport] ISPN000094: Received new cluster view: [app-05:DEV_01/singleton|2] [app-05:DEV_01/singleton, app-06:DEV_02/singleton, app-06:ADM_02/singleton, app-05:ADM_01/singleton]
INFO [o.j.a.c.singleton] JBAS010342: app-05:DEV_01/singleton elected as the singleton provider of the jboss.test.ha.singleton service
INFO [o.j.a.c.singleton] JBAS010340: This node will now operate as the singleton provider of the jboss.test.ha.singleton service
Why do servers from different groups and using different profiles see each other? And all of them form only one cluster with one HA singleton?
I would expect there will be two independent clusters, each one with its own instance of HA singleton.
Do you use different JGroups multicast addresses for your groups? Two different server groups correspond to two different clusters. In order for JBoss cluster to work correctly with other clusters in the same network, you need to isolate it so that it does not interfere with others. This is done by setting different values for jgroups-udp
and messaging-group
in socket binding group - for example by setting system properties jboss.default.multicast.address
and jboss.messaging.group.address
. The multicast addresses should be in range 224.0.0.0 to 239.255.255.255.