【ElasticSearch错误】SERVICE_UNAVAILABLE/1/state not recovered


ES装好后,输入curl localhost:9200无错,从远程访问也OK,但创建文档时出错......

[hy@localhost ~]$ curl -H "Content-Type: application/json" -XPUT 'localhost:9200/moft/emp/1?pretty' -d' {"name":"...","age":"21","salary":"10000","hdate":"2002-1-1T12:12:12","title":".."}'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "cluster_block_exception",
        "reason" : "blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized, SERVICE_UNAVAILABLE/2/no master];",
        "suppressed" : [
          {
            "type" : "master_not_discovered_exception",
            "reason" : null
          }
        ]
      }
    ],
    "type" : "cluster_block_exception",
    "reason" : "blocked by: [SERVICE_UNAVAILABLE/1/state not recovered / initialized, SERVICE_UNAVAILABLE/2/no master];",
    "suppressed" : [
      {
        "type" : "master_not_discovered_exception",
        "reason" : null
      }
    ]
  },
  "status" : 503
}
[hy@localhost ~]$ 

经查明,出现此错是因为cluster.initial_master_nodes和node.name不匹配所致,单机单实例请参考:

END

相关