I’ve been working on getting the opensource Openfire XMPP server and it’s clustering component up and running in a testing environment. I quickly found out that enabling the clustering plugin from the “Available plugins” section of the admin interface simply does not work at all. In trying to get this configured and working, I’ve had to scour the web for bits and pieces of this puzzle. To help out those who are attempting to do the same, I’m going to detail the basic steps that I took to get this working for my environment.
I’ll be skipping over the basics and assume that you currently have two existing Openfire servers running, each using an external MySQL database. I’m also going to assume that your two servers are on the same physical network. The clustering plugin uses multicast for communication by default. It’s possible to specify the IP addresses of each server in the cluster, but I have not yet been able to get that working myself.
What you’ll need to download:
The clustering plugin itself is a .jar file. Within this file, there are two additional files that will need to be copied to the following directories on each of your Openfire servers.
- Copy tangosol-coherence-override.xml to /usr/share/openfire/
- Copy coherence-cache-config.xml to /usr/share/openfire/lib/
Next, we will be copying three files from the Oracle Coherence zip file you’ve downloaded.
- coherence.jar
- coherence-work.jar
- tangosol.jar
Those three files need to be copied to /uar/share/openfire/lib/ on each server. Once that is complete, restart Openfire on each server.
Once Openfire has restarted, log in to the Openfire web interface and upload the clustering.jar file from the plugins section (Plugins>Plugin Admin>Plugins). This must also be done on each of your servers. After you’ve uploaded the plugin, enable clustering (Server>Server Manager>Clustering). You’re done!
You should now see your servers listed in the cluster overview section of the administration page.