Enable Clustering in Openfire

Clustering is a technique used to "scale up" a single XMPP domain. The server members within a cluster share an identical configuration. Each member allows any user within the domain to connect, authenticate, and exchange stanzas.
Clustered server shares a single database, and also required to be resident within the same LAN-based (low latency) network infrastructure.

This type of deployment is suitable to provide runtime redundancy and will support a larger number of users and connections (within a single domain) than a single server.

How to Cluster Openfire
To create an Openfire cluster, you should have at least two Openfire servers, and each server must have the Hazelcast plugin installed.

Install hazelcast plugin

  • The Hazelcast plugin version corresponding to the Openfire release (3.9.3) is 1.2.0
  • Edit the config file of hazelcast in plugins/hazelcast/classes directory
        $nano openfire/plugins/hazelcast/classes/hazelcast-cache-config.xml 

By default during the Openfire startup/initialization process, the servers will discover each other by exchanging UDP (multicast) packets via a configurable IP address and port. if your network does not support multicast communication then try the following alternative

    <multicast enabled="false"/> 
    <tcp-ip enabled="true"> 
    <aws enabled="false"/> 

in <member> Element add the ip of server for which you want to keep in cluster, the port may varies.

After the Hazelcast plugin has been deployed to each of the servers, use the radio button controls located on the Clustering page in the admin console to activate/enable the cluster.

You only need to enable clustering once; the change will be propagated to the other servers automatically. After refreshing the Clustering page you will be able to see all the servers that have successfully joined the cluster, see fig.

Restart openfire servers.

With your cluster up and running, you will now want some form of load balancer to distribute the connection load among the members of your Openfire cluster.


Post a Comment

Popular Posts

Java Conversion Types and Conversion Contexts

Load Balancing usign HAProxy for Openfire

Enable JMX Port in Tomcat with authentication