集群为红色

_cat/indices?v&health=red



health status index              uuid                   pri rep docs.count docs.deleted store.size pri.store.size

red    open   bp_code_2022-12-09 Oslg03YLSIinuR0-U8Ugvw  21   1   90106787            0       63gb         31.6gb



异常索引为bp_code_2022-12-09


_cat/shards/bp_code_2022-12-09?v


查看分片不成功的


_cat/shards/bp_code_2022-12-09?v



_cat/shards/bp_code_2022-12-09?v&h=n,index,shard,prirep,state,sto,sc,unassigned.reason,unassigned.details





找到原因

bp_code_2022-12-09 8     p      UNASSIGNED          ALLOCATION_FAILED failed shard on node [kiWYD9LhS5-0KveD8eo2UA]: shard failure, reason [failed to recover from translog], failure EngineException[failed to recover from translog]; nested: IllegalIndexShardStateException[CurrentState[CLOSED] operation only allowed when recovering, origin [LOCAL_TRANSLOG_RECOVERY]];  

                        bp_code_2022-12-09 8     r      UNASSIGNED          NODE_LEFT         node_left [Iijos8sSTq-q4TvFn3a2aA]



处理办法

POST /_cluster/reroute?retry_failed=true