Introducing Hazelcast ... a new way to cluster Openfire!

I don’t think it will work. The domain name should be a valid DNS name that resolves via the network to the next IP address by cycling through the 3 IP addresses

1 Like

I think having A records (IPs) in DNS foe each server is necessary as a fallback mechanism. It’s possible (and recommended) to have SRV records instead.

kentzen, maybe this will help you: http://wiki.xmpp.org/web/SRV_Records

1 Like

Yeah.Dele and Alex,Thanks you a lot .It works now.

Here is my steps:

My server is Redhat6 32 bit.

1.Modify all nodes /etc/hosts file .Plus code as following:

127.0.0.1 openfire #Any valid DNS name you want.

2.Change ‘setup’ option to false within ‘/openfire/conf/openfire.xml’,this step means that you could reset configuration for openfire.And type a DNS name you just bound with IP ‘127.0.0.1’ into ‘domain’ option.

3.Check ‘xmpp.domain’ field in ‘ofProperty’ table of openfire database,see if its value was set to ‘admin@openfire’ (or admin@).Change it if it isn’t.

4.Restart openfire.

(note : Do these steps to all nodes,and domain name of each node is the same like ‘openfire’ )

Via steps above .It should work fine! Please contact me if you confuse!

I doubt hardcoding IPs left and right will get you too far, but if it works for now… enjoy.

1 Like

Lol .Thanks.

Which is better , Openfire cluster + nginx or Openfire cluster + Connection Manager?

Am able to create openfire cluster with 3 node using hazelcast plugin. I have tried with TCP and Multicast both. But problem is its automatically discovering which i dont want to be part of my cluster. How can we restrict other openfire node from this cluster environment?

Please help. Thanks in advance.

You can change the multicast group and/or port number in the classes/hazelcast-cache-config.xml file to create individual clusters:

224.2.2.3

54327

Thanks Tom.

It means, i can have my own multicast configuration. For example,

  •            <multicast-group>420.3.1.2</multicast-group>*
    
  •            <multicast-port>42031</multicast-port>*
    
  • *

Is it correct?

and Am deploying my server in EC2 i don’t want to open to many ports, how shall i restrict my servers to look in to only one port, i tried tcp/ip config as well but that doesn’t work. Am trying with private ip.

  • 172.31.34.200:5701*

  • 172.31.34.233:5701*

  • *

Please help me to configure cluster in secured manner?

Am using Openfire 3.9.3. Please let me know which hazelcast version will be compatible with this openfire version.

I use hazelcast1.2.0

get error

com.jivesoftware.util.cache.ClusteredCacheFactory - Failed to execute cluster task within 30 seconds

Am getting 2 exceptions

  1. Timeoutexception, It is failing to execute cluster task within 30 seconds.

  2. Hazelcastserialiaitonexcepiton, Class not found exception it occurs after 2 hours and 30 minutes and from there it keep on throwing every second.

If someone have fixed this exceptions, please help me to solve this one.

"Failed to execute cluster task within 30 seconds " issue help

  • openfire version 3.10.2

  • hazelcast plugin version 2.0 (hazelcast 3.4)

  • two server clustering, and now total session 5k

[error.log]

[debug.log]

“Failed to execute cluster task within 30 second” issue.

im guess this, hint from : www.javacreed.com/stopping-the-future-in-time/

edit source : org.jivesoftware.openfire.plugin.util.cache.ClusteredCacheFactory.java

check bold texts . please…

public Object doSynchronousClusterTask(ClusterTask task, byte[] nodeID) {

if (cluster == null) { return null; }

Member member = getMember(nodeID);

Object result = null;

// Check that the requested member was found

if (member != null) {

// Asynchronously execute the task on the target member

logger.debug("Executing DistributedTask: " + task.getClass().getName());

Future future = null;

try {

future = hazelcast.getExecutorService(HAZELCAST_EXECUTOR_SERVICE_NAME)

.submitToMember(new CallableTask(task), member);

result = future.get(MAX_CLUSTER_EXECUTION_TIME, TimeUnit.SECONDS);

logger.debug("DistributedTask result: " + (result == null ? “null” : result));

} catch (TimeoutException te) {

** if(future != null) future.cancel(true);**

** logger.error(“future is canceled, cause by TimeoutException”);**

logger.error(“Failed to execute cluster task within " + MAX_CLUSTER_EXECUTION_TIME + " seconds”, te);

} catch (Exception e) {

logger.error(“Failed to execute cluster task”, e);

}

} else {

String msg = MessageFormat.format(“Requested node {0} not found in cluster”, StringUtils.getString(nodeID));

logger.warn(msg);

throw new IllegalArgumentException(msg);

}

return result;

}

and see another method and edit : Collection doSynchronousClusterTask(ClusterTask task, boolean includeLocalMember)

Hi folks … I believe the timeout issue has been identified and will be resolved in the next release of the plugin (2.1.2). Refer to [OF-943] for more info.

i try to that source. (written by me - 2015. 9. 10)

but timeout error is not solve …

A principal question concerning of Hazelcast clustering system in Openfire: Should Clients A and B can chat to each other in cace illustrated in a figure below? Client B is connected to Node 2 but a connection to Internet from node B is down. But Internet connection from Node 1 is up and alive.

My problem is that if Client A sending messages to Client B, Client B cannot get them. Logs of xmpp2.xyz.com server say that it cannot get connection to xmpp.abz.com (no route).

Vice versa this case is working: if Client B is chatting to Client A: client 1 is getting all the messages. If Client A is connected to xmpp1.xyz.com server, the everything is working great in two-way.

Openfire: 3.10.3

Hazelcast cluster plugin: 2.1.2

Hi Juha -

Active S2S connections (for XMPP federation) are managed and shared within a cluster via the “Routing Servers Cache”.

In the scenario depicted, if Node 1 (xm.pp1.xyz.com) has previously established a connection to the abc.com domain, then all clients within the xyz.com domain should be able to reach abc.com by routing packets through this node in the cluster.

However, if no prior communication between the XMPP domains has been established, then Client A (connected to Node 2 in xyz.com) would be unable to initiate a new connection to Client B (abc.com) because there is no available route (which is what you observed in the log files).

Is this a typical scenario for your deployment? I might suggest that resolving the issues that cause Node 2 to experience limited network connectivity.

Regards,

Tom

Hi Tom,

big thanks for reply!

Ok. This is unfortunately my “default” scenario and environment. Have you good hints where to start and what kind of modifications for code should I do for doing this function that all the traffic is outgoing from Node 1 regardless which node a client is connected to?

BR, Juha

You might be able to write a custom plugin for this, but a connection manager might be a better solution than a cluster.