尝试配置GCE Discovery。
在elasticsearch.yml
中有这个cloud:
gce:
project_id: ..........
zone: us-west1-a
discovery:
type: gce
查看日志消息:
loaded plugin [discovery-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]
这到底是怎么回事?有什么建议吗?
答案 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