未知发现类型[gce]

时间:2018-01-16 09:21:11

标签: elasticsearch

尝试配置GCE Discovery

在elasticsearch.yml

中有这个
cloud:
  gce:
      project_id: ..........
      zone: us-west1-a
discovery:
      type: gce

查看日志消息:

  • loaded plugin [discovery-gce]
  • 但也会因未知发现类型[gce]
  • 而失败

[2018-01-16T09:11:25,247][INFO ][o.e.p.PluginsService     ] [elasticsearch-cluster-2-node-2] loaded plugin [discovery-gce]
[2018-01-16T09:11:27,019][ERROR][o.e.b.Bootstrap          ] Exception
java.lang.IllegalArgumentException: Unknown discovery type [gce]
        at org.elasticsearch.discovery.DiscoveryModule.<init>(DiscoveryModule.java:110) ~[elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.node.Node.<init>(Node.java:441) ~[elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.node.Node.<init>(Node.java:245) ~[elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:212) ~[elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:322) [elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:130) [elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:121) [elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:69) [elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-6.0.0.jar:6.0.0]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) [elasticsearch-6.0.0.jar:6.0.0]

这到底是怎么回事?有什么建议吗?

1 个答案:

答案 0 :(得分:1)

显然是EL维护团队did a BWC change

在5.1中,我们引入了discovery.zen.hosts_provider设置以更好地反映它。此PR删除了那些插件(包括GCE)中的BWC代码,因为它不再需要了。

- .put("discovery.type", "gce")
+ .put("discovery.zen.hosts_provider", "gce")

所以正确的elasticsearch.yml配置应该引用

discovery:
      zen.hosts_provider: gce