單節點Elasticsearch狀態檢查為yellow


原因:單點單節點部署Elasticsearch, 集群狀態可能為yellow, 因為單點部署Elasticsearch, 默認的分片副本數目配置為1,而相同的分片不能在一個節點上,所以就存在副本分片指定不明確的問題,所以顯示為yellow,可以通過在Elasticsearch集群上添加一個節點來解決問題,如果不想這么做,可以刪除那些指定不明確的副本分片(當然這不是一個好辦法)但是作為測試和解決辦法還是可以嘗試的,下面試一下刪除副本分片的辦法:

 

[root@web-01 ~]# curl -X PUT "10.88.0.92:9200/_settings" -H 'Content-Type: application/json' -d'
{"number_of_replicas":0}'
# 返回
{"acknowledged":true}

 

再次查看 Elasticsearch health,已經轉為 green:

{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 931,
  "active_shards" : 931,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
} 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM