3 题: 检查服务器状态时出现Elasticsearch 503错误

在...创建的问题 Tue, Sep 3, 2013 12:00 AM

我一直在使用elasticsearch作为我的Rails应用程序的搜索引擎,但由于我无法理解的原因,它已停止正常工作。当向elasticsearch服务器发出curl请求时,我收到503错误。

 
curl -XGET http://localhost:9200
{
  "ok" : true,
  "status" : 503,
  "name" : "Killpower",
  "version" : {
    "number" : "0.90.3",
    "build_hash" : "5c38d6076448b899d758f29443329571e2522410",
    "build_timestamp" : "2013-08-06T13:18:31Z",
    "build_snapshot" : false,
    "lucene_version" : "4.4"
  },
  "tagline" : "You Know, for Search"
}

我试图通过重新加载elasticsearch服务并安装新版本来解决问题,但没有任何成功。

以下是我在日志中找到的内容

 
[2013-09-03 12:31:45,320][INFO ][node                     ] [Killpower] version[0.90.3], 
pid[4222], build[5c38d60/2013-08-06T13:18:31Z]
[2013-09-03 12:31:45,321][INFO ][node                     ] [Killpower] initializing ...
[2013-09-03 12:31:45,327][INFO ][plugins                  ] [Killpower] loaded [], sites []
[2013-09-03 12:31:47,248][INFO ][node                     ] [Killpower] initialized
[2013-09-03 12:31:47,248][INFO ][node                     ] [Killpower] starting ...
[2013-09-03 12:31:47,313][INFO ][transport                ] [Killpower] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/172.20.46.32:9300]}
[2013-09-03 12:31:51,443][INFO ][discovery.zen            ] [Killpower] master_left [[Amphibion][IMB4uACSTyOx3MO2u-FsWg][inet[/fe80:0:0:0:52e5:49ff:fec2:9718%2:9300]]], reason [do not exists on master, act as master failure]
[2013-09-03 12:31:51,446][INFO ][discovery                ] [Killpower] elasticsearch/iavpGrMtRHmWLHMTNpscGQ
[2013-09-03 12:31:51,483][INFO ][http                     ] [Killpower] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/172.20.46.32:9200]}
[2013-09-03 12:31:51,484][INFO ][node                     ] [Killpower] started
[2013-09-03 12:31:54,712][WARN ][transport.netty          ] [Killpower] exception caught on transport layer [[id: 0xa929f24d, /127.0.0.1:50456 => /127.0.0.1:9300]], closing connection

之后也是一个很长的java堆栈跟踪。我该如何解决这个问题?

    
26
  1. 2013-11-06 09:44:49Z
  2. 醇>
    3答案                              3 跨度>                         

    本地网络中可能有另一个实例,其中有弹性搜索服务器启动并运行。由于elasticsearch中的分片在框中工作并且默认启用,因此可能存在主节点冲突。请查看您的elasticsearch.log文件。如果有类似

    的话  
    {"error":"MasterNotDiscoveredException[waited for [30s]]","status":503} 
    

    您应该转到配置文件/etc/elasticsearch/elasticsearch.yml并添加以下行:

     
    discovery.zen.ping.multicast.enabled: false
    
        
    31
    2014-07-03 22:38:55Z

    另外检查

    的值  
    discovery.zen.ping.unicast.hosts
    

    因为有必要发现弹性节点

        
    2
    2016-10-23 12:29:17Z

    安装头,以便您可以更详细地查看状态。我认为当群集无法正常恢复时,503可以出现在状态中,例如丢失/不可恢复的碎片

    在elasticsearch目录中:

     
    bin/plugin -install mobz/elasticsearch-head
    

    然后在浏览器中:

     
    http://127.0.0.1:9200/_plugin/head/
    
        
    - 3
    2013-09-03 15:16:21Z
    1. 如果状态为503,则head plugin无法从服务器获取信息。您只能读取日志文件。
      2014-03-14 15:00:30Z
    2. 醇>
来源放置 这里