elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.6k stars 24.63k forks source link

Exception in clusters with embedded and standalone nodes #40

Closed sbtourist closed 14 years ago

sbtourist commented 14 years ago

When I run a cluster made up of embedded and standalone nodes, former ones seems not to be able to connect to latter ones, and I get the following log messages on embedded nodes:

OOB-1,elasticsearch,caffeine.local-16363 - jgroups.pbcast.NAKACK - caffeine.local-16363: dropped message from caffeine.local-17690 (not in xmit_table), keys are [caffeine.local-16363], view=[caffeine.local-16363|0] [caffeine.local-16363]

The problem seems to be related to JGroups which, on IPv6-enabled machines, prefers IPv6 addresses over IPv4 ones, but embedded instances aren't able to guess a proper IPv6 address.

That can be fixed by: Specifying java.net.preferIPv4Stack=true on the embedded node, forcing the use of IPv4. or Specifying java.net.preferIPv4Stack=false and java.net.preferIPv6Stack=false on the standalone node, apparently forcing JGroups to take the proper default.

kimchy commented 14 years ago

The elasticsearch script currently set the preferIPv4Stack to true because of problems I had with using the default in Java (which defaults to the machine). This menas that you need to either change the flag on the script, or set the flag on the embedded client side.

I need to revisit this decision to set the ipv4 flag to true and use the JVM default, but it needs to work well out of the box, without needing to set it explicitly. See this thread for why I default to ipv4: http://old.nabble.com/Suspect-warning-in-jgroups-2.8.0-CR6-to26560364.html#a26560364