Elasticsearch Tribe节点配置

维迪沙

我是Elasticsearch的新手,正在尝试在Elasticsearch中设置部落节点。抱歉,如果问题不是很聪明,但我需要帮助。

我正在使用在RHEL Server 6.6和Java 1.7.8上运行的Elasticserach 2.3.1。我有2个群集,每个群集中都有1个主节点和1个数据节点。

当我尝试在集群1中设置并启动部落节点时,出现错误消息:

我的部落节点设置为:

 tribe:
 sample-cluster1:
 cluster.name: sample-cluster1
 discovery.zen.ping.unicast.hosts: ["host1", "host2"]
 discovery.zen.ping.multicast.enabled: false 
 sample-cluster2: 
 cluster.name: sample-cluster2
 discovery.zen.ping.unicast.hosts: ["host3", "host4"]
 discovery.zen.ping.multicast.enabled: false 

我收到以下错误:

Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ElasticsearchParseException[duplicate settings key [cluster.name] found at line number [34], column number [16], previous value [sample-cluster1], current value [sample-cluster2]];
Likely root cause: ElasticsearchParseException[duplicate settings key [cluster.name] found at line number [34], column number [16], previous value [sample-cluster1], current value [sample-cluster2]]
        at org.elasticsearch.common.settings.loader.XContentSettingsLoader.serializeValue(XContentSettingsLoader.java:151)
        at org.elasticsearch.common.settings.loader.XContentSettingsLoader.serializeObject(XContentSettingsLoader.java:109)
        at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:67)
        at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:45)
        at org.elasticsearch.common.settings.loader.YamlSettingsLoader.load(YamlSettingsLoader.java:46)
        at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1071)
        at org.elasticsearch.common.settings.Settings$Builder.loadFromPath(Settings.java:1058)
        at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:88)
        at org.elasticsearch.bootstrap.Bootstrap.initialSettings(Bootstrap.java:202)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:241)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

但是,如果我在第二个群集设置中更改了配置,则不会出现错误,并且服务器将启动:

我的修改设置:

sample-cluster1:
 cluster.name: sample-cluster1
 discovery.zen.ping.unicast.hosts: ["host1", "host2"]
 discovery.zen.ping.multicast.enabled: false 
 sample-cluster2: 
 cluster.name1: sample-cluster2
 discovery.zen.ping.unicast.hosts1: ["host3", "host4"]
 discovery.zen.ping.multicast.enabled1: false 

我不确定我在第一个配置中缺少什么以及第二个配置是否正确。我假设我不能更改elasticsearch键:

cluster.name to cluster.name1
discovery.zen.ping.unicast.hosts to discovery.zen.ping.unicast.hosts1
discovery.zen.ping.multicast.enabled to discovery.zen.ping.multicast.enabled1
维迪沙

找到了修复程序,现在可以正常工作。这是一个愚蠢的错误。解决的办法是我必须为第二个群集配置中的所有参数添加一个额外的空格。

sample-cluster1:
 cluster.name: sample-cluster1
 discovery.zen.ping.unicast.hosts: ["host1", "host2"]
 discovery.zen.ping.multicast.enabled: false 
sample-cluster2: 
  cluster.name: sample-cluster2
  discovery.zen.ping.unicast.hosts: ["host3", "host4"]
  discovery.zen.ping.multicast.enabled: false 

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章