5

我正在尝试将ElasticSearch用于我正在构建的应用程序,并将其托管在Rackspace服务器上。但是,该auto-discovery功能不起作用。我认为这是因为auto-discovery使用广播和多播来查找具有匹配集群名称的其他节点。我发现这篇文章说 Rackspace 现在通过他们的新云网络功能支持多播和广播。然后按照文章的说明,我创建了一个网络,并将该网络添加到运行节点的两台服务器上。然后我尝试ElasticSearch在两个节点上重新启动,但它们没有找到彼此,并且每个都将自己声明为“主节点”(这是日志的输出):

[2013-04-03 22:14:03,516][INFO ][node                     ] [Nemesis] {0.20.6}[2752]: initializing ...
[2013-04-03 22:14:03,530][INFO ][plugins                  ] [Nemesis] loaded [], sites []
[2013-04-03 22:14:07,873][INFO ][node                     ] [Nemesis] {0.20.6}[2752]: initialized
[2013-04-03 22:14:07,873][INFO ][node                     ] [Nemesis] {0.20.6}[2752]: starting ...
[2013-04-03 22:14:08,052][INFO ][transport                ] [Nemesis] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/166.78.177.149:9300]}
[2013-04-03 22:14:11,117][INFO ][cluster.service          ] [Nemesis] new_master [Nemesis][3ih_VZsNQem5W4csDk-Ntg][inet[/166.78.177.149:9300]], reason: zen-disco-join (elected_as_master)
[2013-04-03 22:14:11,168][INFO ][discovery                ] [Nemesis] elasticsearch/3ih_VZsNQem5W4csDk-Ntg
[2013-04-03 22:14:11,202][INFO ][http                     ] [Nemesis] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/166.78.177.149:9200]}
[2013-04-03 22:14:11,202][INFO ][node                     ] [Nemesis] {0.20.6}[2752]: started
[2013-04-03 22:14:11,275][INFO ][gateway                  ] [Nemesis] recovered [0] indices into cluster_state

另一个节点的日志:

[2013-04-03 22:13:54,538][INFO ][node                     ] [Jaguar] {0.20.6}[3364]: initializing ...
[2013-04-03 22:13:54,546][INFO ][plugins                  ] [Jaguar] loaded [], sites []
[2013-04-03 22:13:58,825][INFO ][node                     ] [Jaguar] {0.20.6}[3364]: initialized
[2013-04-03 22:13:58,826][INFO ][node                     ] [Jaguar] {0.20.6}[3364]: starting ...
[2013-04-03 22:13:58,977][INFO ][transport                ] [Jaguar] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/166.78.63.101:9300]}
[2013-04-03 22:14:02,041][INFO ][cluster.service          ] [Jaguar] new_master [Jaguar][WXAO9WOoQDuYQo7Z2GeAOw][inet[/166.78.63.101:9300]], reason: zen-disco-join (elected_as_master)
[2013-04-03 22:14:02,094][INFO ][discovery                ] [Jaguar] elasticsearch/WXAO9WOoQDuYQo7Z2GeAOw
[2013-04-03 22:14:02,129][INFO ][http                     ] [Jaguar] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/166.78.63.101:9200]}
[2013-04-03 22:14:02,129][INFO ][node                     ] [Jaguar] {0.20.6}[3364]: started
[2013-04-03 22:14:02,211][INFO ][gateway                  ] [Jaguar] recovered [0] indices into cluster_state

添加网络还不够吗(Rackspace 还给了我这个网络的 IP)?使用多播查找其他节点时,是否需要以某种方式在 conf 文件中指定以检查该网络?

我还发现这篇文章提供了一种不同的方法。根据文章的说明,我将其放入/config/elasticsearch.yml

cloud:
    account: account #
    key: account key
    compute:
        type: rackspace
discovery:
    type: cloud

但是,当我尝试重新启动时,ElasticSearch我得到了这个:

Stopping ElasticSearch...
Stopped ElasticSearch.
Starting ElasticSearch...
Waiting for ElasticSearch.......
WARNING: ElasticSearch may have failed to start.

它确实无法启动。我检查了日志文件是否有任何错误,但这就是那里的全部:

[2013-04-03 22:31:00,788][INFO ][node                     ] [Chamber] {0.20.6}[4354]: initializing ...
[2013-04-03 22:31:00,797][INFO ][plugins                  ] [Chamber] loaded [], sites []

它停在那里没有任何错误,也没有继续。

以前有没有人成功地ElasticSearch在 Rackspace 云中工作过?我知道单播选项也可用,但我希望不必单独指定每个 IP 地址,因为我希望以后可以轻松添加其他节点。谢谢!

更新

我还没有解决这个问题,但经过一番搜索,我发现这篇文章说“旧”云插件已停止使用,并仅替换为亚马逊云的Ec2插件,这解释了为什么我对配置文件所做的更改确实如此不行。

4

1 回答 1

0

出于安全原因,在公共云上禁用了多播(可以用 验证ifconfig)。这是一篇文章,应该可以满足您的需求:

https://developer.rackspace.com/blog/elasticsearch-autodiscovery-on-the-rackspace-cloud/

于 2015-01-21T13:19:54.123 回答