red/yellow クラスタのトリアージ手順 (どのインデックス、どのシャード、なぜ)
Elasticsearchクラスタ / ノードコマンド
GET _cluster/health?filter_path=status,unassigned_shards,initializing_shards,delayed_unassigned_shards,number_of_pending_tasks
GET _health_report?verbose=false
GET _cat/indices?v&health=red&h=health,index,pri,rep,docs.count,store.size
GET _cat/indices?v&health=yellow&h=health,index,pri,rep
GET _cat/shards?v&h=index,shard,prirep,state,unassigned.reason,unassigned.for,node&s=state
# Without a body, the call explains the first unassigned shard:
GET _cluster/allocation/explain概要
クラスタの状態から問題のあるインデックス、未割り当てのシャード、それらが割り当てられない理由 (unassigned.reason、allocation explain) へと順に絞り込むトリアージ手順を示す。_health_report は、どの指標 (ディスク、シャードの可用性、master) が異常かを要約する。
使用する場面
クラスタが red または yellow になったときの初動対応として。
注意
red: 少なくとも 1 つのプライマリシャードが未割り当てであり、そのインデックスへの書き込みとそのシャードに当たる検索は失敗する。yellow: すべてのプライマリは存在するがレプリカが欠けており、データには到達できるが冗長性がない。単一ノードのクラスタでは、replicas > 0 のインデックスは恒常的に yellow のままとなる (same_shard の判定)。ノードが最近離脱した場合、delayed_unassigned_shards は index.unassigned.node_left.delayed_timeout (デフォルト 1m) が経過するまで意図的に保留される。