I'm trying to set up a 2 machine Hazelcast cluster, and can't use multicasting. Here's my xml file I'm using for configuration:
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config http://www.hazelcast.com/schema/config/hazelcast-config-3.9.xsd" xmlns="http://www.hazelcast.com/schema/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<network>
<port auto-increment="true">5701</port>
<join>
<multicast enabled="false">
</multicast>
<tcp-ip enabled="true">
<member>10.18.7.4</member>
<member>10.18.14.63</member>
</tcp-ip>
</join>
</network>
</hazelcast>
And I'm instantiating Hazelcast as such:
Config config = new FileSystemXmlConfig(xmlConfigFile);
HazelcastInstance hz = Hazelcast.newHazelcastInstance(config);
When I start up each one, I can see the connection get made, then it shuts down the node. Here is the relevant lines from the log file. The logs are the same for both machines, just the ips are different. I've added comments (after ->) to make it easier to read.
WARNING: Name of the hazelcast schema location is incorrect, using default -> Presumable no issue here
INFO: [LOCAL] [dev] [3.12] Interfaces is disabled, trying to pick one address from TCP-IP config addresses: [10.18.14.63, 10.18.7.4]
INFO: [LOCAL] [dev] [3.12] Picked [10.18.14.63]:5702, using socket ServerSocket[addr=/0.0.0.0,localport=5702], bind any local is true
INFO: [10.18.14.63]:5702 [dev] [3.12] Hazelcast 3.12 (20190409 - 915d83a) starting at [10.18.14.63]:5702 -> Great, we're starting Hazelcast on this machine.
INFO: [10.18.14.63]:5702 [dev] [3.12] Starting 2 partition threads and 3 generic threads (1 dedicated for priority tasks) -> Looking good
INFO: [10.18.14.63]:5702 [dev] [3.12] [10.18.14.63]:5702 is STARTING -> Ok looks like we've started.
INFO: [10.18.14.63]:5702 [dev] [3.12] Connecting to /10.18.7.4:5702, timeout: 10000, bind-any: true -> Trying to connect to the other machine
INFO: [10.18.14.63]:5702 [dev] [3.12] Connecting to /10.18.7.4:5703, timeout: 10000, bind-any: true -> Still trying to connect to the other machine
INFO: [10.18.14.63]:5702 [dev] [3.12] Initialized new cluster connection between /10.18.14.63:44251 and /10.18.14.63:5701 -> Ok started a cluster connection on this machine.
INFO: [10.18.14.63]:5702 [dev] [3.12] Initialized new cluster connection between /10.18.14.63:38941 and /10.18.7.4:5701 -> Great, started a connection with the other machine
SEVERE: [10.18.14.63]:5702 [dev] [3.12] Node could not join cluster. A Configuration mismatch was detected: Incompatible joiners! expected: multicast, found: tcp-ip Node is going to shutdown now! -> This is the error I don't understand.
Apr 22, 2019 6:57:44 PM com.hazelcast.instance.Node
WARNING: [10.18.14.63]:5702 [dev] [3.12] Terminating forcefully...
Apr 22, 2019 6:57:44 PM com.hazelcast.instance.Node
INFO: [10.18.14.63]:5702 [dev] [3.12] Shutting down connection manager...
My first question is, if I set multicast enabled="false"
in the xml config file, why do I get this message Node could not join cluster. A Configuration mismatch was detected: Incompatible joiners! expected: multicast, found: tcp-ip Node is going to shutdown now!
, Then it shuts down?
My second question is, how do I properly configure the xml file to create a 2 node cluster using tcp-ip, not multicasting?
Thank you for your help.
10.18.14.63
is starting at port5702
. That makes me think there's another Hazelcast node listening at port5701
on10.18.14.63
. Can you confirm that? – Churlps aux | grep hazelcast
didn't show any other Hazelcast members running on the same machine. If I have time to look into this more I'll try to figure it out and post an answer here, but for now I need to move ahead and ship this. Thanks again. – Winnifredwinning