Clustering Openfire 4.3.1

I am trying to setup a cluster of openfire 4.3.1 using hazelcast plugin, but unable to do so.

I found couple of links to follow, but they do not contain enough information, can someone post the exact steps or some resources to do so?

Do we require any enterprise edition plugin (mentioned in few links)? I don’t see such kind of plugin on openfire’s download plugins page.

Please help.

The enterprise edition has long since been retired.

The only option left open to you is the Hazelcast plugin.

Greg

Hi Greg,

Thanks your reply on this thread, I have installed Hazelcast plugin, post installation I am updating hazelcast-local-config.xml placed under <Openfire_Home>/conf/ folder with below configuration:

    <join>
        <multicast enabled="false"/>
        <tcp-ip enabled="true">
            <member>10.20.0.62:5701</member>
			<member>10.20.1.137:5701</member>
        </tcp-ip>
    </join>

And when I am trying to enable clustering after restarting openfire, it gives me error : ‘Unable to join existing cluster, please see logs for more details’ and when checked in logs found nothing.

Can you please share some resource to configure clustering or if you could suggest a way out?

You’ll also need to update the section

        <interfaces enabled="false">
            <interface>10.10.1.*</interface>
        </interfaces>

To reflect the address of the node in question (10.20.. should do it for both, looking at those addresses)

when checked in logs found nothing.

No logs, or nothing of value? If no logs, then that’s another issue (probably means you’re running on a Debian based Linux distro). If nothing of value, try enabling debug logging and posting all.log to somewhere to like https://gist.github.com/

Greg

Here is All.log, after clearing the logs and enabling the clustering:

2019.02.01 15:37:59 DEBUG [DefaultQuartzScheduler_QuartzSchedulerThread]: org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2019.02.01 15:38:03 DEBUG [Jetty-QTP-AdminConsole-24]: org.jivesoftware.util.cache.CacheFactory - Clustering plugin class loader: org.jivesoftware.openfire.container.PluginClassLoader
file:/usr/share/openfire/plugins/hazelcast/classes/
file:/usr/share/openfire/plugins/hazelcast/web/
jar:file:/usr/share/openfire/plugins/hazelcast/lib/hazelcast-2.4.0.jar!/
jar:file:/usr/share/openfire/plugins/hazelcast/lib/hazelcast-3.11.1.jar!/
2019.02.01 15:38:10 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: sessions. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: server_bytes. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: muc_occupants. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: proxyTransferRate. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: conversations. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: muc_traffic. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: packet_count. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: muc_rooms. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: server_sessions. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 DEBUG [pool-monitoring4]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: muc_users. Last sample: 1549015620. New sample: 1549015680
2019.02.01 15:38:11 INFO [Jetty-QTP-AdminConsole-30]: system-clustering.jsp - Enabling clustering
2019.02.01 15:38:11 INFO [TaskEngine-pool-2]: org.jivesoftware.openfire.plugin.util.cache.ClusteredCacheFactory - Starting hazelcast clustering
2019.02.01 15:38:11 DEBUG [TaskEngine-pool-2]: org.jivesoftware.openfire.plugin.util.cache.ClusterClassLoader - Adding conf folder /usr/share/openfire/conf
2019.02.01 15:38:23 DEBUG [DefaultQuartzScheduler_QuartzSchedulerThread]: org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2019.02.01 15:38:41 INFO [Jetty-QTP-AdminConsole-30]: system-clustering.jsp - Clustering enabled
2019.02.01 15:38:51 DEBUG [DefaultQuartzScheduler_QuartzSchedulerThread]: org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2019.02.01 15:39:10 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: sessions. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:10 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: server_bytes. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:10 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: muc_occupants. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:11 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: proxyTransferRate. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:11 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: conversations. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:11 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: muc_traffic. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:11 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: packet_count. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:11 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: muc_rooms. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:11 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: server_sessions. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:11 DEBUG [pool-monitoring2]: org.jivesoftware.openfire.reporting.stats.StatsEngine - Stat: muc_users. Last sample: 1549015680. New sample: 1549015740
2019.02.01 15:39:16 DEBUG [DefaultQuartzScheduler_QuartzSchedulerThread]: org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers
2019.02.01 15:39:41 DEBUG [DefaultQuartzScheduler_QuartzSchedulerThread]: org.quartz.core.QuartzSchedulerThread - batch acquisition of 0 triggers|

all.log (7.5 KB)

Regenrated log file : all.log (81.8 KB)

Well, the second all.log has rolled over since the start. It looks to me like your conf file is incorrect in some way. I just tried a fresh install of Openfire 4.2.3, added Hazelcast 2.4.0, updated conf/hazelcast-local-config.xml and all is good. The relevant part of my log is as follows;

2019.02.01 10:36:43 INFO  [Jetty-QTP-AdminConsole-48]: system-clustering.jsp - Enabling clustering
2019.02.01 10:36:43 INFO  [TaskEngine-pool-3]: org.jivesoftware.openfire.plugin.util.cache.ClusteredCacheFactory - Starting hazelcast clustering
2019.02.01 10:36:43 DEBUG [TaskEngine-pool-3]: org.jivesoftware.openfire.plugin.util.cache.ClusterClassLoader - Adding conf folder C:\Greg\openfire-4.3\conf
2019.02.01 10:36:44 INFO  [TaskEngine-pool-3]: com.hazelcast.instance.AddressPicker - [LOCAL] [openfire] [3.11.1] Interfaces is disabled, trying to pick one address from TCP-IP config addresses: [192.168.1.208]
2019.02.01 10:36:44 INFO  [TaskEngine-pool-3]: com.hazelcast.instance.AddressPicker - [LOCAL] [openfire] [3.11.1] Prefer IPv4 stack is true, prefer IPv6 addresses is false
2019.02.01 10:36:44 DEBUG [TaskEngine-pool-3]: com.hazelcast.instance.AddressPicker - [LOCAL] [openfire] [3.11.1] Trying to bind inet socket address: 0.0.0.0/0.0.0.0:5701
2019.02.01 10:36:44 DEBUG [TaskEngine-pool-3]: com.hazelcast.instance.AddressPicker - [LOCAL] [openfire] [3.11.1] Bind successful to inet socket address: /0:0:0:0:0:0:0:0:5701
2019.02.01 10:36:44 INFO  [TaskEngine-pool-3]: com.hazelcast.instance.AddressPicker - [LOCAL] [openfire] [3.11.1] Picked [192.168.1.208]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
2019.02.01 10:36:44 INFO  [TaskEngine-pool-3]: com.hazelcast.system - [192.168.1.208]:5701 [openfire] [3.11.1] Hazelcast 3.11.1 (20181218 - d294f31) starting at [192.168.1.208]:5701
2019.02.01 10:36:44 INFO  [TaskEngine-pool-3]: com.hazelcast.system - [192.168.1.208]:5701 [openfire] [3.11.1] Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
2019.02.01 10:36:44 DEBUG [TaskEngine-pool-3]: com.hazelcast.system - [192.168.1.208]:5701 [openfire] [3.11.1] Configured Hazelcast Serialization version: 1
2019.02.01 10:36:44 INFO  [TaskEngine-pool-3]: com.hazelcast.instance.Node - [192.168.1.208]:5701 [openfire] [3.11.1] A non-empty group password is configured for the Hazelcast member. Starting with Hazelcast version 3.8.2, members with the same group name, but with different group passwords (that do not use authentication) form a cluster. The group password configuration will be removed completely in a future release.
2019.02.01 10:36:45 INFO  [TaskEngine-pool-3]: com.hazelcast.spi.impl.operationservice.impl.BackpressureRegulator - [192.168.1.208]:5701 [openfire] [3.11.1] Backpressure is disabled
2019.02.01 10:36:45 DEBUG [TaskEngine-pool-3]: com.hazelcast.spi.impl.operationservice.impl.InboundResponseHandlerSupplier - [192.168.1.208]:5701 [openfire] [3.11.1] Running with 2 response threads
2019.02.01 10:36:47 INFO  [TaskEngine-pool-3]: com.hazelcast.instance.Node - [192.168.1.208]:5701 [openfire] [3.11.1] Creating TcpIpJoiner
2019.02.01 10:36:48 INFO  [TaskEngine-pool-3]: com.hazelcast.spi.impl.operationexecutor.impl.OperationExecutorImpl - [192.168.1.208]:5701 [openfire] [3.11.1] Starting 4 partition threads and 3 generic threads (1 dedicated for priority tasks)
2019.02.01 10:36:48 INFO  [TaskEngine-pool-3]: com.hazelcast.internal.diagnostics.Diagnostics - [192.168.1.208]:5701 [openfire] [3.11.1] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
2019.02.01 10:36:48 INFO  [TaskEngine-pool-3]: com.hazelcast.core.LifecycleService - [192.168.1.208]:5701 [openfire] [3.11.1] [192.168.1.208]:5701 is STARTING
2019.02.01 10:36:48 DEBUG [TaskEngine-pool-3]: com.hazelcast.internal.partition.InternalPartitionService - [192.168.1.208]:5701 [openfire] [3.11.1] Adding Member [192.168.1.208]:5701 - 02022138-f1f2-4caf-a3df-3bb1791224ea this
2019.02.01 10:36:48 DEBUG [TaskEngine-pool-3]: com.hazelcast.internal.networking.nio.NioNetworking - [192.168.1.208]:5701 [openfire] [3.11.1] TcpIpConnectionManager configured with Non Blocking IO-threading model: 3 input threads and 3 output threads
2019.02.01 10:36:48 DEBUG [TaskEngine-pool-3]: com.hazelcast.internal.networking.nio.NioNetworking - [192.168.1.208]:5701 [openfire] [3.11.1] IO threads selector mode is SELECT
2019.02.01 10:36:48 DEBUG [TaskEngine-pool-3]: com.hazelcast.cluster.impl.TcpIpJoiner - [192.168.1.208]:5701 [openfire] [3.11.1] [192.168.1.208]:5701 is local? true

Note there is a whole bunch of stuff about IP addresses that you’re missing. It points to a badly configured or mis-formed conf file, I think. Try posting it here.

Greg

Thanks for your inputs Greg.
Just to check here if its a version issue, I am using Openfire 4.3.1 and Hazelcast plugin 2.4.0, is it fine?

I have installed fresh setup of Openfire and installed Hazelcast plugin of the versions mentioned above. Could you post the steps here to follow now (considering below assumptions) ?

Also the use case here is, say I have two machines A (IP: 192.168.2.212) & B (192.168.2.226),
configuration file under /conf/hazelcast-local-config.xml of say Server A is like : hazelcast-local-config.xml (2.5 KB)

Could you please suggest what I am missing here?

May be if you can share a copy of your config file, that could also help.

Your versions should be fine; install steps are quite simple
a) Install Openfire
b) Go to Plugins … Available plugins and add the Hazelcast plugin (or manually download and copy to plugins folder)
c) Edit the /conf/hazelcast-local-config.xml
d) Go to Server -> Clustering and enable clustering.

Pretty much the only thing that can go wrong is step c!

In this case, I think I can see the problem.

You have:

        <interfaces enabled="true">
            <interface>192.168.2.212</interface>
            <interface>192.168.2.226</interface>
        </interfaces>

This tells Hazelcast which interfaces to bind to to on the local machine (https://docs.hazelcast.org/docs/3.11.1/manual/html-single/index.html#interfaces). The node running on 192.168.2.212 will not be able to bind to 192.168.2.226 so Hazelcast will not start.

I can see three ways forward;
a) Don’t enable the interfaces - i.e. <interfaces enabled="false"> - in which case Hazelcast will bind to all available addresses.
b) Specify a wildcard interface, i.e.

        <interfaces enabled="true">
            <interface>192.168.2.*</interface>
        </interfaces>

which will be valid on both nodes.
b) Have different conf files for different nodes; i.e.

        <interfaces enabled="true">
            <interface>192.168.2.212</interface>
        </interfaces>

one one node, and

        <interfaces enabled="true">
            <interface>192.168.2.226</interface>
        </interfaces>

on the other node.

Greg

1 Like

Thanks Greg, it was really helpful, I am able to configure the cluster now. Thanks once again.
This could be well documented in Openfire’s cluster setup guide as there are not much resources available on this.