Clustering standalone HornetQ in Jboss7. Initial discovery is incorrect.
johnnysoccer Jan 30, 2013 3:09 PMAccidently posted as an article before...
I have 4 nodes set up all running in Jboss7 (7.1.2) I have upgraded to 2.2.23.AS7.Final HornetQ running inside the app server.
Here is my scenario.
- start node 1 - all things are good (cluster1.tmx.com)
- start node 2 (cluster2.tmx.com)
- Node 2 comes up correctly, through JMX (to node 2) I can see an entry in ClusterConnection with my cluster name ("cluster1"). When I look in the attribues, at the Nodes attribute, I see 1 node listed.
- The node listed has a hash value = node1.host.com/ip address:port
- 49917ce9-63e8-11e2-9ffc-b94078d8350a=cluster1.tmx.com/172.21.162.48:5445
- All things look good
- Looking back at node1 through JMX at the same ClusterConnection has the following entry
- 72248456-6972-11e2-b14d-4fe9b2c880f3=cluster1.tmx.com/172.21.162.48:5445
- This is where it gets interesting. Notice that there is a different has value, but that the host name/ ip address it is pointing at is NOT the second node in the cluster, but instead is pointing at itself
- Node 2 comes up correctly, through JMX (to node 2) I can see an entry in ClusterConnection with my cluster name ("cluster1"). When I look in the attribues, at the Nodes attribute, I see 1 node listed.
- Node 2 is able to communicate with Node1, but Node1 is not able to communicate with Node 2
- I now start Node3
- Node 3 now has 2 Nodes listed in it's ClusterConnection, both correctly pointing to Node2 and Node1
- Node 2 now has 2 Nodes listed in it's ClusterConnection, the original Node points back to Node1, The new Node now points back to itself.
- Node1 now has 2 Nodes listed in it's ClusterConnection, both these nodes point back to itself
- Node 3 can communicate with 2 and 1, Node 2 can only communicate with Node 1, Node 1 cannot communicate with either 2 or 3
- I now start Node4 (wait for it....)
- Node 4 now has 3 Nodes listed in it's ClusterConnection, all three are correclty pointing to Node 3, Node 2 and Node 1
- Node 3 now has 3 Nodes listed. 2 correctly pointing at Node 2 and Node 1 and a new Node pointing back to itself
- Node 2 now has 3 Nodes listed. 1 correctly pointing at Node 1 and 2 incorreclty pointing back to itself
- Node 1 now has 3 Nodes listed. All three are incorrectly pointing back to itself.
- A couple of other interesting items:
- If you look at this entry in Node 3
- 72248456-6972-11e2-b14d-4fe9b2c880f3=cluster2.tmx.com/172.21.162.49:5445
- And the same entry (based on the hash value) in Node1
- 72248456-6972-11e2-b14d-4fe9b2c880f3=cluster1.tmx.com/172.21.162.48:5445 (this is incorrect, this address points back to the Node 1 machine)
- You notice that the identical hashes are pointing to different addresses. It seems all the Hash values are identified correctly in each node, but the address/host the point to the wrong address
- If I go back and stop Jboss on Node1, then restart it, Discovery seems to work correctly, and now all three Nodes listed point to the correct host name, and Node1 is now able to communicate with Node 2, Node 3 and Node 4
- Restarting each node 1 at a time eventually gets the entire cluster communicating.
- If you look at this entry in Node 3
Any ideas out there on why this happens?
All Nodes have the following in their standalone.xml config file
<broadcast-groups>
<broadcast-group name="hq-cluster-broadcast">
<socket-binding>messaging-group</socket-binding>
<connector-ref connector-name="netty">netty</connector-ref>
</broadcast-group>
</broadcast-groups>
<discovery-groups>
<discovery-group name="hq-cluster-discovery">
<socket-binding>messaging-group</socket-binding>
<refresh-timeout>60000</refresh-timeout>
</discovery-group>
</discovery-groups>
<cluster-connections>
<cluster-connection name="cluster-conn-1">
<connector-ref connector-name="netty">netty</connector-ref>
<address>jms</address>
<max-hops>1</max-hops>
<discovery-group-ref discovery-group-name="hq-cluster-discovery" />
</cluster-connection>
</cluster-connections>
<socket-binding name="messaging-group" multicast-address="${jboss.messaging.group.address:231.7.7.7}" multicast-port="${jboss.messaging.group.port:9876}"/>
thanks,
John