Hazelcast configuration

The most basic Hazelcast settings can be edited in Configuration.xml, while more advanced settings such as SSL encryption must be configured in /WEB-INF/Hazelcast.xml

When Management Console starts, it creates a Hazelcast node on port 5701 (or the next available port that is available). By default this Hazelcast node will bind to IP address You will have to change the bind address to a public IP/host name before it can participate in a cluster. This is done by modifying the interface property of the cluster bean in Configuration.xml. It might look like this:

    <bean id="cluster" class="com.kapowtech.mc.config.ClusterConfig" >
        <property name="port" value="26000"/>
        <property name="interface" value="10.0.0.*"/>

The * is used as a wildcard, in this case the application will try bind to the 'first' interface that has an IP address starting with 10.0.0. It is possible, but not recommended to use *.*.*.* as you may end up binding to, or another virtual interface.

When you start additional instances of Management Console, their Hazelcast instances will try to find any existing Hazelcast node and join the cluster. This discovery can be done through multicast or through TCP/IP.

To use multicast discovery you must modify the cluster bean in Configuration.xml. This is done my un-commenting the following line

    <property name="joinConfig" ref="multicastCluster"/>

multicastCluster is a reference to the multicastCluster bean, which defines the multicast group and port. You may change it to fit your network topology.

If your network doesn't allow multicast you will have to use the tcpCluster. That is done by un-commenting this line instead:

    <property name="joinConfig" ref="tcpCluster"/>

The tcpCluster bean contains a list of TcpPeer, one for each other Hazelcast node. If you use the same TCP port for all Hazelcast nodes you don't need to specify a port number (each node will assume that its peers are running on the same port as itself). If you have two nodes configured in a TCP cluster it could look like this:

    <bean id="tcpCluster" class="com.kapowtech.mc.config.TcpJoinConfig">
        <property name="peers">
                <bean class="com.kapowtech.mc.config.TcpPeer">
                    <property name="host" value=""/>
                <bean class="com.kapowtech.mc.config.TcpPeer">
                    <property name="host" value=""/>

Notice that both nodes are in the list. This means that regardless which node starts first it will be able to find its peer. It also allows you to use identical Configuration.xml files in both applications. Also, TCP ports numbers are not defined, so each peer will try to connect to the other one on the same port as it is listening on itself.

Application Nodes

You can verify that the application is properly clustered by going to the Projects tab, and look at the Application Nodes section in the bottom of the page. Here you should see something like this

This means that the cluster currently consists of two nodes. The interface column will list the IP/host and port that Hazelcast is using for inter-cluster communication. The Connected to column informs you which of the two nodes you are connected to at the moment. If you shut down the server you are currently connected to, you will automatically be re-routed to another live instance by the load balancer.

If you right click on an application node a context menu will appear, here you can request a thread dump from any node, this may be useful for debugging purposes.