elasticsearch自动发现机架空间无法正常工作

时间:2013-04-03 22:48:41

标签: elasticsearch rackspace-cloud rackspace autodiscovery

我正在尝试将ElasticSearch用于我正在构建的应用程序,而我正在Rackspace服务器上托管它。但是,auto-discovery功能无效。我认为这是因为auto-discovery使用广播和多播来查找具有匹配群集名称的其他节点。我发现这个article说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文件中指定在使用多播查找其他节点时检查该网络?

我还发现这个article提供了不同的方法。根据文章的说明,我将其放入/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地址,因为我希望以后可以很容易地添加其他节点。谢谢!

更新

我还没有解决这个问题,但经过一番搜索后我发现这个post表示“旧”云插件已经停止使用,只替换为亚马逊云的Ec2插件,解释了为什么我对配置文件所做的更改不起作用。

1 个答案:

答案 0 :(得分:0)

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

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