Cluster how to work

Now I have run clustering on two servers. One IP is, another IP is Now I can see the two nodes on the admin console. But I don’t know the clustering how to work. The two server shares the same mysql. The user ‘test’ login via It logout when I close the server on I think it can automaticall connect to So the user will be online. But now it is offline. The client only can connect to the specified server, but not one of the two nodes. why?

You are connecting directly to a single IP so yes your connection will drop. The clustering allows multiple openfire servers configured for the same realm/domain to communicate with each other as if they were one server, so to have the kind of failover you want, you will need a load balancer or proxy device in front, or accept some failover latency in using srv records via dns. In the end, I would recommend a load balance device.

thanks for your reply. What you means is that I should install one proxy before the two openfire servers? Now Both of them have the same xmpp.domain –

Corresponding to the following old document:


You may want to use a load balancer to distribute load between active servers. The load balancer does not need to support sticky sessions since XMPP connections are longed lived.

So there are two options. you can use a software load balancer to distribute the load, or function as an active/passive failover scenario; or you can use a hardware load balancer. HAProxy is one such way to do software load balancing, or Zeus software makes another alternative. There’s Linux LVS as well. If you have hardware, then I would recommend using that.

Basically in a clustering capacity, you’re more about distributing load than having failover capacity; you still have failover, but that’s not the primary purpose in most cases. This load balancing mechanisim will mean that your servers individually have different IPs, a single xmpp domain, and have a virtual IP which distributes the load. An easy way of doing that would be configuring all servers with the same loopback address, hooking them to a dumb hub (not a switch), and putting that uplink to a switch. This is rather hacky, so I don’t recommend it.

In your situation, you can overload the SRV records for your xmpp domain to also have a load balanced effect, but no failover or service checking capability. You can find out more about SRV records here.

By the way, in my situation, I have a clustered/load balanced setup running on GoGrid. This clustered setup has been running for several hundred days very well, and the load balancer distributes the load evenly, and efficiently.

thanks for your advice. I have resolved the problem. I use HAProxy.

2011/2/23 Brian Menges

 Ignite Realtime <>  Re:

Cluster how to work created by Brian Menges

Openfire Support - View the full discussion<

Been going through clustering in openfire. Could you please direct me to the link or provide steps as how the clustering is enabled in openfire. You seem to have done this successfully.

We are using openfire 3.6.4, Fastpath and for clustering - clustering.jar, coherence.jar, tangosol.jar.


Took me some time to dig this back up.

First you’ll need Oracle Coherence 3.3.1, specifically, including a license which is quite costly.

You’ll have to prepare the files necessary from the plugin package, using the instructions found in this post

Then you can enable the clustering and all should work fine.

xenz wrote:

  1. once configured, go Admin console, Plugin Tab, Avaiable Plugin and install clustering plugin v1.2.0 by Jive Software
  1. open the coherence file you download earlier. extract coherence.jar, coherence-work.jar and tangosol.jar in folder coherence/lib
  1. open coherence.jar and replace the coherence-cache-config.xml with the one from your installed openfire/plugins/clustering folder’s coherence-cache-config.xml (jar file is a zip file, so rename .jar to .zip to replace it and rename it back to .jar)
  1. copy the modified coherence.jar, and tangosol.jar into your installed openfire/lib folder
  1. restart your openfire server.

That should get you straightened up.

Yes. I have dont that. You should have load balancer or proxy before

openfire. You can use HAProxy. First you should copy clustering.jar to

plugins, and coherence.jar, coherence-work.jar, tangosol.jar to lib, then

restart your openfire server. You can enable clustering. You can see the

server has joined the cluster. If you see that, It means the clustering is

working. Run your HAPxory, and configure. Following is my configure file. and are the IP of the two openfire servers.

The IP which runs HAProxy is

So we can login openfire.

If you want to login, you should change the port to 6080. But I can’t login via spark, pidgin and miranda can work well.


log local3

mode http #layer 7代理

retries 2

maxconn 2000

balance roundrobin

contimeout 500000

clitimeout 500000

srvtimeout 500000

listen http-in

mode http

bind *:6070

stats uri /stats

balance roundrobin

server w1 weight 3

server w2 weight 3

listen tcp-in

mode tcp

bind *:6080

balance roundrobin

server c1 weight 3 maxconn 2

server c2 weight 3

2011/2/23 Balaji

Ignite Realtime <[](>  Re:

Cluster how to work created by Balaji<>in

Openfire Support - View the full discussion<

Thanks, for the response.

We are using coherence version 3.5 and yes, load balancer in front of openfire.

The older version 3.3.1 does not seem to be available anywhere.

Appreciate any help with that version.


You can get 3.3.1 from

2011/2/24 balaji_050

 Ignite Realtime <>  Re:

Cluster how to work created by Balaji

Openfire Support - View the full discussion<


But are you sure the link is working? Its been hours that I am trying to download from that link.

Appreciate your help or to send the zip as attachment.


OKay. I don’ know whether it need oracle license. You can delete them if it

need license. thanks

2011/2/24 balaji_050

Ignite Realtime <[](>  Re:

Cluster how to work created by Balaji<>in

Openfire Support - View the full discussion<

The zip folder could not be unzipped and extracted. windows errors out that “invalid file”

Any other location I can get version 3.3.1 from?

Hi, They are the jar files which I used in openfire. They can work well.


2011/2/24 balaji_050

 Ignite Realtime <>  Re:

Cluster how to work created by Balaji

Openfire Support - View the full discussion<
tangosol.jar (2171847 Bytes)
coherence-work.jar (25758 Bytes)
coherence.jar (1819433 Bytes)
clustering.jar (59779 Bytes)

Thanks, got them.


Able to cluster two instances of openfire.

We are using a flex client to connect to openfire/Fastpath and to enable chat using XMPP APIs.

Client does HTTP-Binding at port 7070. Our load balancer is configured to route to port 7070.

But we see random behaviour where connectivity is lost from the client end.

Do you use Fastpath services in your setup along with openfire to manage routing?


No, I only use to chat. thanks

2011/3/2 balaji_050

 Ignite Realtime <>  Re:

Cluster how to work created by Balaji

Openfire Support - View the full discussion<

You’ll need to setup some stickiness or persistence so that the messages continue to go the same route. Remember that the http web client for fastpath behaves differently than raw xmpp messaging, and the session doesn’t involve a ‘client’ with session awareness.