Configuring load balancer for Openfire
To configure load balancer
Configure the load balancer to route requests to the appropriate server.
- Create a pool map for all the nodes in Openfire cluster listening on port 7070 (or bind port mentioned in admin console).
- Set rule on load balancer to route all requests on port 7070 (or bind port set) to pool map created in step a.
- Set rule in load balancer to enable sticky connections on coming URL parameter JID which can abstract from url parameter.
If you do not enable sticky session on JID, invalid SID errors are reported in bosh connections made to Openfire service.
When using load balancer address with bind port (7070 default), the following message is displayed in a browser: “Openfire HTTP binding service”.
Configure Smart IT with bosh URL pointing to load balancer.
- Configure the load balancer address in Smart IT bosh URL, from Centralized Configuration (CCS).
- Provide the same address in chat domain and chat service name. The same should reflect in all Openfire nodes admin console xmpp domain value.
- Update the auth URL pointing to Smart IT load balancer.
Sample HAProxy config
frontend tcp-smtopenfireclient
bind *:7070 # listening for incoming requests on port 7070
mode http
option forwardfor
option accept-invalid-http-request
acl is_http_bind url_beg /http-bind
default_backend back-smtopenfireclient
backend back-smtopenfireclient
mode http
balance leastconn
option forwardfor
option accept-invalid-http-response
stick-table type string len 40 size 200k expire 3m
stick on url_param(jid) table back-smtopenfireclient # abstract the jid from url parmater and enable stick on it
server itst-dev-smt-01 x.x.x.x:7070 check cookie itst-dev-smt-01
server itst-dev-smt-02 x.x.x.y:7070 check cookie itst-dev-smt-02
To configure F5 load balancer
- Create a virtual pool with the members of Openfire cluster server on port 5222.
Create a virtual server for the virtual pool. This virtual server is used by the chat server admin.
Properties tab
Resources tab- Create OpenFire health monitor.
The health monitor will monitor Openfire server state and mark the Punjab server serving node down if Openfire server goes down. Use the corresponding Alias Server Port as configured.- Create a new monitor
- Provide the Name. For example, OpenFire_HTTP_Monitor (or any suitable name)
- Select the Type as HTTP
- Set the Configuration to Advanced
- Set Send String as GET /login.jsp HTTP/1.0 \n\n.
- Set Alias Service Port as 9090. (port which is configured for accessing Openfire admin page)
- Create a virtual pool for Punjab connection manager
- Create new pool for Punjab servers.
- Add the following health monitors
- Openfire HTTP Monitor.
- http_15_46
- Click Update.
- Configure Virtual Server for SmartIT and Chat. This is the same Virtual Server used for current Digital Workplace traffic.
- Edit the currently used virtual server for Digital Workplace traffic.
- Set OneConnect Profile to OneConnect.
- Set HTTP Profile to http-no-cache.
- Add iRule rule_onbmc_myit_v1 to the virtual server.
- Create new onbmc_chat_pool_map in Data Group List.
- Go to Local Traffic > iRules > Data Group List.
- Create new onbmc_chat_pool_map in Data Group List.
- Map SmartIT host name to the desired chat cluster.
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*