Issue in Openfire Cluster with AWS Load Balancers & Strophe.Js

Hello There,

I have a two node Openfire cluster setup running over two AWS EC2 instances (say App Server-A & App Server-B).

I have my UI application running on two Web Servers (say Web Server-A & Web Server-B). I am using Strophe.Js to enable chat functionality in my UI application.

I tried using AWS Application Load Balancer (ALB) as well as Classic Load Balancer (CLB) in front of Openfire cluster to cater all the HTTP-BIND requests from UI application/client browser. Question here is does this kind of openfire setup supports CLB, ALB or both for load balancing, or do I have to use any specific load balancer like HAProxy or etc., if this is so then which one will be best suited for this use case?

Also, I have allowed all the incoming TCP traffic (within the App Servers and Outside App Servers) & verified all the security group configurations for load balancers. ALB didn’t worked for me, somehow CLB worked for sometime (only when I registered only one target App Server instance, when checked with both the App Servers being registered, it gave 404- Invalid SID Value) and then stopped working for same set of configurations even with only one registered target instance.

I used load balancer generated session stickness, but it seems like session stickness is not working for this use case.

Can some one suggest how can this setup be functional & used with load balancers being placed to handle fail-over scenarios?

Any leads will be highly appreciable.

have you get any solution?

@mai_tarek i think I saw you post this question in the chat.

after taking a quick look at aws loadbalancer options, you’ll need to use stickness. if you are using tcp mode, then you’ll need to use the classic loadbalancer, as the others do not support stickiness of tcp connections. disclaimer, I don’t have an experience with what you are trying to accomplish…just going based on the documentation

Openfire does not offer support for this. If you choose to use a load balancer in combination with a cluster, then you’ll need to configure your load balancer in such a way that it uses the same host for every request from a particular client (eg: “sticky sessions”). You’ll have to review the support documentation for the load balancer to see if and how that’s supported.

Typically in XMPP setups (like Openfire), the client determines what host (for a particular domain / cluster) to connect to out of band. Mostly, DNS SRV records are used, which allow each client to determine what the best load balancing and fallback strategy is.

Yes i need to enable sticky session but that’s not enabled with tcp mode its only enabled with http mode and to use gwt it need to be tcp ! Is there a way to use http with the gwt or with the http-bind?

You should ask that to people that support the load balancer.

@guus is right, you need to consult the load balancer documenation and support. howerver, as I stated, the Classic Load Balancer (CLB), supports sticky session on TCP.
https://aws.amazon.com/elasticloadbalancing/features/


as you see here the load balancer named sticky is classic one but sticky is not available for TCP protocols
is there any way to enable it?

help?!