2

I was trying to start 2 hazelcast nodes simultaneously, and they can not discover each other. It's true for both multicast and tcp-ip discovery. If I restart one node later - they see each other. Is there a way to make them discover each other without restarting? Or how to postpone discovery during node start-up?

Configuration:

    <network>
    <port auto-increment="true">5701</port>
    <outbound-ports>
        <!--
        Allowed port range when connecting to other nodes.
        0 or * means use system provided port.
        -->
        <ports>0</ports>
    </outbound-ports>
    <join>
        <multicast enabled="true">
            <multicast-group>224.3.3.6</multicast-group>
            <multicast-port>5705</multicast-port>
        </multicast>
    </join>
</network>

or

        <multicast enabled="false">
            <multicast-group>224.3.3.6</multicast-group>
            <multicast-port>5705</multicast-port>
        </multicast>
        <tcp-ip enabled="true">
            <member>host1:5701</member>
            <member>host2:5701</member>
            <member>host3:5701</member>
            <member>host4:5701</member>
        </tcp-ip>

UPD: Solved by manually add random sleep on startup before cluster init.

theme
  • 361
  • 5
  • 7
  • I can postpone member creation (Hazelcast.newHazelcastInstance(cfg);). But is doesn't seem as a nice solution – theme Oct 07 '13 at 20:09
  • They should really find each other. Have you listed the both their addresses in the config? Can you show your config? – vikingsteve Oct 08 '13 at 13:12
  • I guess and has something to do about it, but exactly impact of these options is unclear to me – theme Oct 10 '13 at 21:59
  • 1
    It is very strange that the nodes can't find each other when they are started concurrently. So I guess it is related to you environment since this problem is new to me. Can you post some of your logging so we can see what is going on. – pveentjer Oct 14 '13 at 11:10

1 Answers1

1

Are your nodes running sufficiently long? In my experience, it can take quite a while (30 seconds) until the nodes find each other - independent of the discovery communication (multicast vs TCPIP).

After several trials and erros, Hazelcast.com and me found quite a simple solution:

config.setProperty("hazelcast.initial.min.cluster.size","2");

In my experiments, the solution is faster and more stable than waiting for a while.

Community
  • 1
  • 1
DaveFar
  • 7,078
  • 4
  • 50
  • 90