I’m using Hazelcast cluster of two Openfire nodes and HAProxy as a load balancer (you can see my configuration in Re: java.lang.NullPointerException when user logging in to one of two clustered servers). I also have external component, which serves client requests.
HAProxy is configured to balance nodes: nodes port 5222 for c2s connections, nodes port 5275 for external component connections. Both balance strategies are roundrobin.
While both nodes are running, client serving through external component works ok (for both nodes), and external component is shown on component-session-summary.jsp page on both nodes.
But when I stop the node, to which external component was connected by LB:
- On the remaining node, external component disappears from component-session-summary.jsp.
- External component loses connection and tries to reconnect. LB redirects to port 5275 of alive node. But Openfire node sends stream:error->confict in reply on registration request. That seems strange because *component-session-summary.jsp *does not show component as registered. Logs from Openfire console (produced by *xmldebugger *plugin):
ExComp - RECV (23020725): <stream:stream xmlns="jabber:component:accept" xmlns:stream="http://etherx.jabber.org/streams" to="myExtComp.myExtCompDomain"> ExComp - SENT (23020725): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:component:accept" from="myExtComp.myExtCompDomain"><stream:error xmlns:stream="http://etherx.jabber.org/streams"><conflict xmlns="urn:ietf:params:xml:ns:xmpp-streams"/></stream:error> ExComp - SENT (23020725): </stream:stream>
After restarting the node, which has been stopped:
- External component successfully connects back to **restarted **node! Again, *component-session-summary.jsp *shows my external component on both nodes.
- When client connects to the restarted node, client is successfully serviced by external component.
- When client connects to the other node, connection from Openfire to external component fails.
So, the questions are:
- Does sharing of external components work correctly in hazelcast cluster?
- Is external component redistribution on node shutdown expected to work correctly?
- Is there a way to prevent stream:error - *conflict *error while external component connects?
- What are the probable mistakes of my cluster + LB configuration?
- Is there any working example of configuring LB (preferably HAProxy) for serving c2s connections through external component, including node stopping?