Openfire uses the Hazelcast plugin, and I would like to know if multiple Openfire Java processes can be started on a single server to set up a cluster. For example, if there are two Openfire installation paths, /opt/openfire1 and /opt/openfire2, can I start both Java processes simultaneously? If so, are there any similar resources or references available for this?
I do expect that this is possible with perhaps some tweaking. The biggest issue that I think you’ll have is with competing port number assignments.
My suggestion is that you look at containerization to manage the issue of shared resources a bit. That way, the mapping of things to the host becomes an explicitly managed thing (in your container environment configuration).
As an example, you could look at the Docker-based environments that were created by Surevine. This is a project that is aimed at testing Openfire in various deployment configurations (including federation and clustering). It is not something that I expect you can use directly, but it does serve as an example of how you could structure your approach. You can find this project at GitHub - surevine/openfire-docker-compose: Run multiple Openfire servers & DBs in Docker for local testing
First of all, thank you very much for your response. We are currently unable to use Docker containers. We are considering whether it is possible to run multiple processes on a single server node using different Openfire paths, and whether these multiple processes can share a single database. For example, /opt/openfire1 and /opt/openfire2 could share the same database. We primarily use the xmpp.socket.plain.port client to connect to the server’s standard port, where openfire1 uses port 5222. Can the port for openfire2 be changed to another port? We would like to know if there are any methods to resolve the port conflict issue, or if there are any similar cases we could refer to. Is it possible to resolve the port conflict by adding virtual IP addresses (i.e., multiple IP addresses)? Are there any similar cases or resources we could refer to for this? We are looking forward to your reply. Thank you very much!![]()
In the hazelcast-local-config.xml configuration file of the Hazelcast plug-in, I have disabled multicast, used the TCP mode, defined members, enabled interfaces, and defined the IP address for listening on port 5701. However, after the process is started, the IP address for listening on port 5701 is still all zeros. How can I specify the IP address for listening on port 5701 in the Hazelcast plug-in? Looking forward to your reply. Thank you.
I’m a bit confused by your writing. You appear to be wanting to run multiple Openfire servers on the same server, but you are also using Hazelcast (which implies that you are running clustering).
When running multiple Openfire instances, one typically tries to create multiple XMPP domains (each with its own set of users, etc).
When using clustering on the other hand, more-than-one Openfire services are combined to form one bigger XMPP domain (they all share the same userbase, etc).
Clustering is typically used to:
- improve the capacity of the XMPP domain (for scalability)
- improve the reliability of the XMPP domain (to keep the service running even if one server fails)
When multiple Openfire instances are running on the same (physical/hardware) server, as you appear to be wanting to do, then I don’t expect those servers to be clustered. Capacity will not be improved (as each service is competing for the same hardware resources). Reliability is not improved either: when the hardware fails, all services will go down anyway.
Can you please explain the deployment model that you intend to use, including your reasons for choosing that particular model?
In any case, to answer your questions:
- When Openfire services are clustered, they must all use the same database
- When different Openfire services are not clustered, the cannot use the same database
(I’m referring here to the same set of tables in a database server - it is possible for one database server to contain multiple sets of similarly named tables, but I don’t expect that this is what you mean).
You have already found the xmpp.socket.plain.port setting to configure a different TCP port than the default value of 5222 for TCP client connectins. There are more of these properties that you can use for the other ports:
xmpp.socket.ssl.portfor the direct-TLS TCP client connections (default5223)xmpp.server.socket.portfor the server-to-server port (default5269)xmpp.server.socket.ssl.portfor the direct-TLS server-to-server port (deffault5270)xmpp.multiplex.socket.port/xmpp.multiplex.ssl.portfor the connection manager portsxmpp.component.socket.port/xmpp.component.ssl.portfor the external components portshttpbind.port.plain/httpbind.port.securefor the client webbinding portsadminConsole.port/adminConsole.securePortfor the admin console ports
You’ve also asked if it was possible to bind to specific network interfaces. There is limited support for this, using these properties. I do not know if they apply to all of the ports above. You’ll have to experiment to find out:
adminConsole.interfacenetwork.interface
I hope this helps!