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
cloud-gce plugin should check discovery.type
#13809
Conversation
@@ -56,7 +59,7 @@ public String description() { | |||
@Override | |||
public Collection<Module> nodeModules() { | |||
List<Module> modules = new ArrayList<>(); | |||
if (settings.getAsBoolean("cloud.enabled", true)) { | |||
if (settings.getAsBoolean("cloud.enabled", true) && GceModule.isDiscoveryReady(settings, logger)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really related to this change but we can remove now the check for cloud.enabled
Thanks for doing this! |
Is this really necessary? I don't like plugins checking a setting that is not theirs. The gce plugin registers itself as a discovery type. It is the discovery modules job to decide which discovery type to use. |
Don't have a strong opinion as well. Just thinking of what would be the consequences when we will remove the need for setting any cloud.gce property. Not a problem I guess. Let's apply Ryan suggestion. |
Actually, I like the fact we don't bind unnecessary modules when discovery is not set to That's what we do today for azure: https://github.com/elastic/elasticsearch/blob/master/plugins/discovery-azure/src/main/java/org/elasticsearch/cloud/azure/AzureDiscoveryModule.java#L79-L83 I think it's cleaner. If we don't do that, in Azure, we will automatically start |
@rjernst I agree with your sentiment. Do you see any way of allowing the plugin to bind extra services if the DiscoveryModule activated it ? there are things like network address resolution, adding unicast host providers etc. @dadoonet long term it will be awesome if we can decouple things such that we won't need guice. The network part of the plugin can be registered all the time (people need to active it using gce in their setting) and maybe the unicast host provider can be create in GCEDiscovery on start (GCEDiscovery is now kinda empty) |
@bleskes I'm not sure we need extra services? I have two thoughts:
|
@rjernst re splitting discovery - yeah and I'm still thinking on what's the right split. these things are tied together. Breaking them up are not trivial at all. Note though that GCE only supplies configuration (i.e., list of hosts to ping), which makes it creating it from the discovery implementation an option (see note to david from earlier :)) |
I'm fine for now with moving the hosts list to a protected method that plugins override on their subclass of zen (I think that's what you are suggesting)? |
I looked at the code and I think it will be a biggish change to move the unicast host providers from Guice into a method zen discovery. It will also imply that UnicastZenPing needs to move ZenDiscovery and ZenPingService need to be either moved away from Guice as well or have an extra method for late addition of ping types. For the sake of moving forward, I suggest we proceed with the current approach where we check settings for now and try to work towards a better way of doing this in ZenDiscovery/DiscoveryModule.
|
Thanks a lot guys. |
415ce48
to
74fdb60
Compare
It looks good to me |
@xuzha I think we need it as well in 2.x and 2.0 branches. See https://github.com/elastic/elasticsearch/blob/2.0/plugins/cloud-gce/src/main/java/org/elasticsearch/plugin/cloud/gce/CloudGcePlugin.java#L74 We hit a similar issue with ec2 today on 2.0 branch. Could you check it and cherry pick this commit if needed to 2.0, 2.x branches? And add 2.0.0 and 2.1.0 labels to this PR? |
@dadoonet sure, I saw your message in hipchat, I think we should do it. |
thanks for confirming. I added labels to this PR then. |
As done in elastic#13809 and in Azure, we should check that `discovery.type` is set to `ec2` before starting services. Closes elastic#13581.
closes #13614
This commmit adds check
discovery.type
and other required parameters beforeloading gce plugin.
This change make gce plugin behave like Azure:
if user doesn't set discovery type to
gce
, ES would not load gce modules.if user does set discovery type to
gce
but without all parameters we need, es would fail to start.