Hi, I'm writing some failover tests for Artemis (using either shared
store or replication).
I have 2 nodes, a master and a backup one.
In the replication cases, I start my nodes and want to wait for the
cluster to be formed.
In the logs, I can see that the cluster is formed, as the backup has this log:
"11:36:39,768 INFO [org.apache.activemq.artemis.core.server]
(Thread-1 (ActiveMQ-client-netty-threads-1591310642)) AMQ221024:
Backup server
ActiveMQServerImpl::serverUUID=e7bd42ca-5b8b-11e5-9d19-796a17bef145
is synchronized with live-server."
However, if I look at ClusterConnectionControl#getNodes() on either
nodes, it returns an empty map. I was expecting to have both nodes
returned. Or maybe the other node at the end of the cluster
connection. Returning an empty map sounds suspicious.
If I now call ClusterConnectionControl#getTopology() on the master
node, it returns:
"topology on
Topology@1aaa7bfa[owner=ClusterConnectionImpl@764259437[nodeUUID=e7bd42ca-5b8b-11e5-9d19-796a17bef145,
connector=TransportConfiguration(name=http-connector,
factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory)
?host=localhost&http-upgrade-endpoint=http-acceptor&httpUpgradeEnabled=true&port=8080,
address=jms,
server=ActiveMQServerImpl::serverUUID=e7bd42ca-5b8b-11e5-9d19-796a17bef145]]:
e7bd42ca-5b8b-11e5-9d19-796a17bef145 => TopologyMember[id =
e7bd42ca-5b8b-11e5-9d19-796a17bef145,
connector=Pair[a=TransportConfiguration(name=http-connector,
factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory)
?host=localhost&http-upgrade-endpoint=http-acceptor&httpUpgradeEnabled=true&port=8080,
b=TransportConfiguration(name=http-connector,
factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory)
?httpUpgradeEnabled=true&port=8180&host=localhost&http-upgrade-endpoint=http-acceptor],
backupGroupName=null, scaleDownGroupName=null]
nodes=2 members=1"
The string is a bit opaque but I can at least see that there are 2
nodes in the cluster. Both nodes form a pair for the single member
identified with e7bd42ca-5b8b-11e5-9d19-796a17bef145
What's the correct way to know the number of nodes in the cluster?
Finally, is there a way to query the live server to know if it has one
or many backups ready to failover? Relying on the topology string
seems quite fragile...
thanks,
jeff
--
Jeff Mesnil
[email protected]
http://jmesnil.net/weblog/