-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when using a port range on unicast discovery, scanning stops after the first connection #2992
Comments
The 'host[port1-port2]' stuff is documented here: http://www.elasticsearch.org/guide/reference/modules/discovery/zen/ |
we only try the first one because the default is 9300-9400, and we used to try all of them by default (way back), and it was very expensive trying to form the connection on all those ports (assuming nothing was there). So it was changed to try the first one with the assumption that if a range is specified, the first one should be up to answer it. |
@jordansissel As there is a workaround and that IMHO having more than one node on a single box is very uncommon (more a dev than a prod concern), could we close this issue? |
This instance was a production issue; where a logstash and elasticsearch nodes colocated on the same server, logstash starts up first occasionally and snags port 9300 and only talks to itself despite elasticsearch being on port 9301 and the port range logstash told via NodeBuilder to connect to as 9300-9400 Still, I've worked around this thusly: Basically, implemented the "try all ports" logic in my own code. Works well enough. |
@jordansissel So this is happenning when you start logstash with an embedded elasticsearch, right? |
Agreed there. For backwards compatibility reasons I can't change the port. I think it's safe to close this given the reported behavior is the intended behavior :) |
re: logstash with embedded elasticsearch No, this also occurs, in general, when logstash and elasticsearch are simply on the same server as separate procseses. The result is that the default configurations require startup ordering because both compete for port 9300, and if ES starts on port 9301, logstash searches for ES on ports 9300-9400, finds itself (logstash) on 9300 and keeps trying to ping itself which it ignores. |
Roughly, just to describe what I've seen - two separate cases: Case 1
Case 2
In both cases, my work around of setting the unicast discovery list of all port combinations (host:9300, host:9301, ...) works around this. (Just documenting for completeness and posterity!) |
Thank you! I was trying to understand and now I think it's clear. IMHO, you should try to use TransportClient when you don't need an embedded node and NodeClient if embedded is set to true. That way, logstash won't start any Node process and won't listen to any http/transport port. |
Version: ElasticSearch 0.20.6
How to reproduce:
Observations:
Expected?
Workaround:
The text was updated successfully, but these errors were encountered: