Verify a Cluster
Last modified by Eleni Cojocariu on 2026/10/20 06:45
Steps
Prove that the nodes of a cluster found each other and really replicate, once event distribution is enabled.
- Put this snippet on a page of the wiki, for instance a scratch page in the Sandbox. It names the node that answered the request, says whether distribution is on, and lists the channels with their members.
{{velocity}} * Node: $services.observation.remote.id * Event distribution enabled: $services.observation.remote.enabled * Network adaptor: $services.observation.remote.adapterId #foreach ($channel in $services.observation.remote.channels) * Channel $channel.id, leader $channel.leader.id, members:#foreach ($member in $channel.members) $member.id#end #end {{/velocity}}An author without Programming right gets a reduced view of the channels, limited to the identifier, the members and the leader, which is all this check needs.
- Open that page and read the answer. A node that has joined nothing answers like this, and a UUID in place of a name means observation.remote.id was left unset on it.
Node: e733d40c-fa31-4746-9291-6921175666a7 Event distribution enabled: false Network adaptor: jgroups - Find out which node answered a given request, when the load balancer decides for you: the session cookie carries the route name of the node that served it, after the dot.
JSESSIONID=node01x5l7ovxo53gj1iwmaiw9lwilp25.node0Add a Load Balancer is where that name is set.
- Reach a chosen node instead, by going around the balancer: a host name or a port per node is the simplest way to open the same document on each in turn.
http://node1.example.org:8080/xwiki/bin/view/Sandbox/ http://node2.example.org:8080/xwiki/bin/view/Sandbox/ - Check that the balancer really spreads visitors, by opening the wiki in a second browser profile, which gives a second session, and reading the cookie or the snippet again. Do not expect the second session to land elsewhere by construction: the usual balancing method counts requests, and says nothing about where any given session ends up.
- Turn the logs up when something does not add up: raise the org.xwiki.observation.remote logger to debug on both nodes, from the "Logging" section of the wiki administration or in logback.xml, and watch one node send what the other receives.
<logger name="org.xwiki.observation.remote" level="debug"/>The "Debugging" section of the Remote Observation Module page lists what those messages look like.
- Confirm what all of this is for: open the same page on two nodes, modify it on one, and reload it on the other. The change is there, without restarting anything, and the snippet on each node now lists the other as a member of the channel.
Node: node2 Event distribution enabled: true Network adaptor: jgroups Channel udp, leader node1, members: node1 node2