Cluster how to work

Now I have run clustering on two servers. One IP is 192.168.4.185, another IP is 192.168.4.166. 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 192.168.4.166. It logout when I close the server on 192.168.4.166. I think it can automaticall connect to 192.168.4.185. 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 – test.com.

Corresponding to the following old document: http://community.igniterealtime.org/docs/DOC-1471

Quote:

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 communityadmin@igniterealtime.org

 Ignite Realtime <http://community.igniterealtime.org/index.jspa>  Re:

Cluster how to work created by Brian Mengeshttp://community.igniterealtime.org/people/mengesbin

Openfire Support - View the full discussion<Cluster how to work - #5 by Brian_Menges - Openfire Support - Ignite Realtime Community Forums

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.

Thanks.

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 3.3.1.zip 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, coherence.work.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.

192.168.4.185 and 192.168.4.166 are the IP of the two openfire servers.

The IP which runs HAProxy is 192.168.4.167.

So we can login openfire. http://192.168.4.167:6070.

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.


defaults

log 127.0.0.1 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 192.168.4.185:9090 weight 3

server w2 192.168.4.166:9090 weight 3

listen tcp-in

mode tcp

bind *:6080

balance roundrobin

server c1 192.168.4.185:5222 weight 3 maxconn 2

server c2 192.168.4.166:5222 weight 3

2011/2/23 Balaji communityadmin@igniterealtime.org

Ignite Realtime <[http://community.igniterealtime.org/index.jspa](http://community.igniterealtime.org/index.jspa)>  Re:

Cluster how to work created by Balaji<http://community.igniterealtime.org/people/balaji_050>in

Openfire Support - View the full discussion<http://community.igniterealtime.org/message/209563#209563

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.

Thanks.

You can get 3.3.1 from

http://www.ourssky.com/upload/coherence-java-v3.3.1.openfire.zip.

2011/2/24 balaji_050 communityadmin@igniterealtime.org

 Ignite Realtime <http://community.igniterealtime.org/index.jspa>  Re:

Cluster how to work created by Balajihttp://community.igniterealtime.org/people/balaji_050in

Openfire Support - View the full discussion<Cluster how to work - #10 by Balaji1 - Openfire Support - Ignite Realtime Community Forums

Thanks.

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.

Thanks.

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

need license. thanks

2011/2/24 balaji_050 communityadmin@igniterealtime.org

Ignite Realtime <[http://community.igniterealtime.org/index.jspa](http://community.igniterealtime.org/index.jspa)>  Re:

Cluster how to work created by Balaji<http://community.igniterealtime.org/people/balaji_050>in

Openfire Support - View the full discussion<http://community.igniterealtime.org/message/209602#209602

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.

thanks

2011/2/24 balaji_050 communityadmin@igniterealtime.org

 Ignite Realtime <http://community.igniterealtime.org/index.jspa>  Re:

Cluster how to work created by Balajihttp://community.igniterealtime.org/people/balaji_050in

Openfire Support - View the full discussion<Cluster how to work - #14 by Balaji1 - Openfire Support - Ignite Realtime Community Forums
tangosol.jar (2171847 Bytes)
coherence-work.jar (25758 Bytes)
coherence.jar (1819433 Bytes)
clustering.jar (59779 Bytes)

Thanks, got them.

Hi,

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?

Thanks.

No, I only use to chat. thanks

2011/3/2 balaji_050 communityadmin@igniterealtime.org

 Ignite Realtime <http://community.igniterealtime.org/index.jspa>  Re:

Cluster how to work created by Balajihttp://community.igniterealtime.org/people/balaji_050in

Openfire Support - View the full discussion<Cluster how to work - #17 by Balaji1 - Openfire Support - Ignite Realtime Community Forums

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.