【问题标题】:play2-elastic does not work when ElasticSearch is installed on EC2 server在 EC2 服务器上安装 ElasticSearch 时 play2-elastic 不起作用
【发布时间】:2013-10-09 02:37:16
【问题描述】:

当我尝试使用 play2-elastic 插件从非本地机器连接到安装在 EC2 上的 ElasticSearch (elasticsearch-0.90.3) 时,它会引发以下异常(该插件在本地连接时工作正常)

error] application - ElasticSearch : No ElasticSearch node is available. Please check that your configuration is correct, that you ES server is up and reachable from the network. Index has not been created and prepared.
org.elasticsearch.client.transport.NoNodeAvailableException: No node available
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:205) ~[elasticsearch-0.90.3.jar:na]
at org.elasticsearch.client.transport.support.InternalTransportIndicesAdminClient.execute(InternalTransportIndicesAdminClient.java:85) ~[elasticsearch-0.90.3.jar:na]
at org.elasticsearch.client.support.AbstractIndicesAdminClient.exists(AbstractIndicesAdminClient.java:147) ~[elasticsearch-0.90.3.jar:na]
at org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequestBuilder.doExecute(IndicesExistsRequestBuilder.java:43) ~[elasticsearch-0.90.3.jar:na]
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:85) ~[elasticsearch-0.90.3.jar:na]
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:59) ~[elasticsearch-0.90.3.jar:na]

我使用了不同的方法来测试elasticsearch服务器是否启动并运行,示例:

curl -XGET '184.72.55.204:9300/_analyze?analyzer=standard' -d 'this is a test'
curl: (52) Empty reply from server


telnet 184.72.55.204 9300
Trying 184.72.55.204...
Connected to ec2-184-72-55-204.us-west-1.compute.amazonaws.com.
Escape character is '^]'.

在一些谷歌群组中,我也看到其他人有类似的问题,他们似乎能够通过关闭嗅探来解决问题,所以我的 application.conf 中有这个

elasticsearch.client="184.72.55.204:9300"
elasticsearch.sniff=false # I ADDED THIS BUT DID NOT HELP
elasticsearch.index.name="phonotags"
elasticsearch.index.settings="{ analysis: { analyzer: { my_analyzer: { type: \"custom\", tokenizer: \"standard\" } } } }"
elasticsearch.index.clazzs="indexing.*"
elasticsearch.index.show_request=true

我的 build.scala 文件包含这些:

"com.clever-age" % "play2-elasticsearch" % "0.7-SNAPSHOT"

resolvers += Resolver.url("play-plugin-releases", new URL("http://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns),
resolvers += Resolver.url("play-plugin-snapshots", new URL("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots/"))(Resolver.ivyStylePatterns)

感谢您的帮助。 谢谢

【问题讨论】:

    标签: amazon-ec2 playframework-2.0 elasticsearch


    【解决方案1】:

    您的节点似乎不可用

    curl -XPUT '184.72.55.204:9200/twitter/tweet/1' -d '{ "user": "kimchy", "post_date" : "2011-08-18T16:20:00", "message" : "trying out Elastic Search" }'
    

    你能检查一下吗?

    【讨论】:

    • curl -XPUT '184.72.55.204:9300/twitter/tweet/1' -d '{ "user": "kimchy", "post_date" : "2011-08-18T16:20:00 ", "message" : "trying out Elastic Search" }' curl: (52) 来自服务器的空回复
    • 我也用 telnet 测试了节点,它可以访问并且似乎工作正常
    • 使用插件节省 1 或 2 小时非常令人沮丧,但您最终会花费数天时间来计算插件! :)
    • 您使用什么 AMI?我尝试使用精确的 ubuntu,效果很好
    • 您好,我使用的是标准 Ubuntu 12.04.1 LTS
    猜你喜欢
    • 2014-05-13
    • 1970-01-01
    • 2016-10-13
    • 1970-01-01
    • 2012-06-24
    • 2023-03-08
    • 2013-03-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多