简体   繁体   English

具有Play 2配置的ElasticSearch

[英]ElasticSearch with Play 2 configuration

I am trying to use the ElasticSearch module ( https://github.com/cleverage/play2-elasticsearch ) with my Play 2 application. 我正在尝试在我的Play 2应用程序中使用ElasticSearch模块( https://github.com/cleverage/play2-elasticsearch )。 In the readme, it says I should add the following to my application.conf: 在自述文件中,它说我应该将以下内容添加到我的application.conf中:

    ## define local mode or not
elasticsearch.local=false

## list clients
elasticsearch.client="192.168.0.46:9300"
# ex : elasticsearch.client="192.168.0.46:9300,192.168.0.47:9300"

What is local mode? 什么是本地模式? What is my client URL supposed to be? 我的客户网址应该是什么? I can not find any information on what these options should be. 我找不到有关这些选项应该是什么的任何信息。 With my current options, I get a NoNodeAvailableException. 使用当前的选项,我得到一个NoNodeAvailableException。

Some people suggest: 有人建议:

elasticsearch.local=false elasticsearch.client=mynode1:9200,mynode2:9200

But what is mynode1 and mynode2? 但是mynode1和mynode2是什么? It doesn't work with my application. 它不适用于我的应用程序。 Can anyone help? 有人可以帮忙吗? Thanks 谢谢

What is local mode? 什么是本地模式?

If elaticsearch.local=true, a elasticsearch node is started in your application ( embedded ) 如果elaticsearch.local = true,则在您的应用程序(嵌入式)中启动一个Elasticsearch节点

What is my client URL supposed to be? 我的客户网址应该是什么?

It's your host:port, but the port is the tcp transport define on your elasticsearch node. 它是您的host:port,但是端口是您的elasticsearch节点上定义的tcp传输。 By default, the port start on 9300 ( http://www.elasticsearch.org/guide/reference/modules/transport.html ) 默认情况下,端口从9300开始( http://www.elasticsearch.org/guide/reference/modules/transport.html

I can not find any information on what these options should be. 我找不到有关这些选项应该是什么的任何信息。 With my current options, I get a NoNodeAvailableException. 使用当前的选项,我得到一个NoNodeAvailableException。

I think you have a problem on port number. 我认为您在端口号上有问题。

mynode1 and mynode2 are elasticsearch nodes. mynode1和mynode2是elasticsearch节点。

Do you have any Elasticsearch node running? 您是否正在运行任何Elasticsearch节点? On which IP address? 在哪个IP地址上?

Can you try to connect on these nodes using curl, for example: 您是否可以尝试使用curl连接这些节点,例如:

curl localhost:9200

Or 要么

curl YOURIPADDRESS:9200

If one of this is successful, then configure your play app using YOURIPADDRESS:9300 as Nicolas Boire wrote before. 如果其中之一成功,则使用Nicolas Boire之前写的YOURIPADDRESS:9300配置您的播放应用。 If no one is successful, check that you have installed Elasticsearch and launched it before. 如果没有人成功,请检查是否已经安装并启动了Elasticsearch。

HTH 高温超导

I've just had the same problem, be sure that you respect the version requirements written in the table : https://github.com/cleverage/play2-elasticsearch 我遇到了同样的问题,请确保您遵守表中写的版本要求: https : //github.com/cleverage/play2-elasticsearch

At the beginning, I set up the latest version of the plugin 0.8.1 but my ElasticSearch version was 1.0.2 . 一开始,我设置了插件0.8.1的最新版本,但我的ElasticSearch版本是1.0.2 By starting ES with version 0.9.13 , it worked. 通过以0.9.13版启动ES,它可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM