GridGain nodes do not discover each other if I use GridTcpDiscoveryMulticastIpFinder
, which is default.
How to set it up?
Usually when nodes cannot see each other means that IP Multicast is not properly working on your network. Getting IP Multicast to work properly can sometimes be a challenge. GridGain grid uses IP Multicast to find IP addresses for node discovery. GridTcpDiscoveryMulticastIpFinder
is default IP Finder.
The following tips maybe useful when enabling IP Multicast:
Address
224.0.0.0
and 239.255.255.255
[0-9].0.0.1
should not be usedFirewall
Most operating systems come with Software Firewall configured by default. If you already have a hardware firewall, then most likely you don’t need the one that comes with Operating System. Try disabling it and see if IP Multicast starts working.
If disabling Operating System Firewall is not an option, then you should configure the Firewall to accept and properly route IP Multicast packets.
SELinux and iptables
We noticed that at least in Fedora Core 9 multicast does not work with default SELinux configuration. So to have it working you need either to configure SELinux properly or better disable it.
Also if your computer is not exposed directly to the Internet (is behind the router or firewall) we would recommend to disable iptables
and ip6tables
services on Linux.
Add IP Multicast Route
System should have at least one route for IP multicast traffic. You can add a route for all multicast traffic to use the correct (Linux example):
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
Note that if there are multiple IP multicast applications you will need to configure the route for a specific IP multicast address.
IPv4 and IPv6
If you have an OS with IPv6 enabled Java applications may try to route IP multicast traffic over IPv6. Use java.net.preferIPv4Stack=true
system property to prevent this.
Local network
If you don’t have network installed, then most likely your IP Multicast packets will be routed to your ISP router which is probably blocking them. Try enabling loopback IP Multicast on your local box, so multiple grid nodes started on your local box can see each other.
Multiple Interfaces
This problem is mostly noticed with JGroups. Try adding your IP address to hosts file on your operating system (e.g. /etc/hosts/
on Unix/Linux) and restart your network. Also, specify your local IP address as local bind configuration parameter in JGroups configuration file or in GridTcpDiscoverySpi
depending on which SPI you are using to start grid.