繁体   English   中英

如何检查ElasticSearch是否正常运行

[英]How to check if ElasticSearch is running properly

我是ElasticSearch的新手,并且在连接ElasticSearch时遇到问题。 请找到以下详细信息:

  1. hq插件和head插件显示不同的结果:
    HQ插件的输出: 总部插件输出
    头插件输出: 头插件输出

  2. 当我尝试从我的scala代码进行连接时,出现以下错误:

     org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [] at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:305) at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:200) at org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106) at org.elasticsearch.client.support.AbstractClient.index(AbstractClient.java:102) at org.elasticsearch.client.transport.TransportClient.index(TransportClient.java:340) at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$$anonfun$apply$1.apply(IndexDsl.scala:23) at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$$anonfun$apply$1.apply(IndexDsl.scala:23) at com.sksamuel.elastic4s.Executable$class.injectFuture(Executable.scala:21) at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.injectFuture(IndexDsl.scala:20) at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.apply(IndexDsl.scala:23) at com.sksamuel.elastic4s.IndexDsl$IndexDefinitionExecutable$.apply(IndexDsl.scala:20) at com.sksamuel.elastic4s.ElasticClient.execute(ElasticClient.scala:28) 

这是我用于连接的代码:

val settings = ImmutableSettings.settingsBuilder()
                                .put("cluster.name", "elasticsearch")
                                .build()
val client = ElasticClient.remote(settings, ElasticsearchClientUri("elasticsearch://10.50.xxx.xxx:9300"))
  1. 我还检查了连接,我能够在9200和9300端口上成功telnet 10.50.xxx.xxx

  2. 我在某个地方读到问题可能出在http.cors ,所以我在服务器上的/etc/elasticsearch/elasticsearch.yml文件中添加了以下几行:

     http.cors.allow-origin: "/.*/" http.cors.enabled: true 


    请指出我做错了什么?

-更新-
感谢@ Evaldas Buinauskas,这是版本问题,我安装了弹性版本2.0,并使用版本1.7的库和插件。 我将Elastic降级到1.7版,一切正常!

问题来自不同的Elasticsearch,头插件和Scala客户端版本。

在2.0之前的版本中,Elasticsearch仍然支持不建议使用的_status端点(在1.2.0中不建议使用)

2.0版完全删除了它,并用_recovery替换了它。

Head和Scala都没有升级,并试图调用已删除的api。

暂无
暂无

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

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