Payara / Hazelcast with two network interfaces

39 views
Skip to first unread message

Ulrich Mayring

unread,
Apr 12, 2017, 4:03:27 AM4/12/17
to Payara Forum
Hello,

I have several machines with two (virtual) network interfaces. One example:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.23.92.131  netmask 255.255.252.0  broadcast 172.23.95.255

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.113.48.157  netmask 255.255.252.0  broadcast 10.113.51.255

If I just start Payara without any configuration, then it runs on eth1 - first question: why? Can I make it run on eth0?

Second question: how can I get Hazelcast autodiscovery to work, when (like here) the broadcast address is on another subnet?

Ulrich

Ben Davis

unread,
Dec 7, 2017, 5:50:59 PM12/7/17
to Payara Forum
I'm seeing the same thing on a system with two network interfaces. When I start up two or more Parara Micro instances, they do not automatically make a cluster. 
However, if I disable one interface, autodiscovery works and I see all the micro servers as members of a cluster. 

Ondro Mihályi

unread,
Dec 8, 2017, 2:46:55 AM12/8/17
to Payara Forum
It's interesting that so many people have asked questions about multicast binding to different interfaces.

Here's a similar question and my answer at Stackoverflow: https://stackoverflow.com/questions/47626417/payara-hazelcast-cluster-node-picks-the-wrong-network-interface/47643893#47643893

In short, Payara Server/Micro pick the first interface returned by the system and start Hazelcast with multicast autodiscovery on that interface. On most systems and JVMs, the same interface is picked all the time (I have a couple of interfaces but Payara always picks my docker interface, I don't know why). As long as 2 instances pick the same interface, autodiscovery works. A different interface can be forced by a system property as mentioned in the SO answer.

Ondro

Ben Davis

unread,
Dec 8, 2017, 11:43:48 AM12/8/17
to Payara Forum
Thank you for the quick reply! I read your SO post and got my Payara micro application to work by adding -Dhazelcast.local.localAddress=<my-address>  
Reply all
Reply to author
Forward
0 new messages