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不匹配所致,單機單實例請參考:https://www.cnblogs.com/heyang78/p/15922514.html
END