curl -X GET 10.10.161.1:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason| grep UNASSIGNED
返回结果:
1 2 3 4
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 51215 100 51215 0 0 479k 0 --:--:-- --:--:-- --:--:-- 480k test_index 3 r UNASSIGNED ALLOCATION_FAILED
{ "state":"INITIALIZING", "primary":false, "node":"KbRtC52uQWS_6C5l1kocKA", "relocating_node":null, "shard":3, "index":"test_index", "recovery_source":{ "type":"PEER" }, "allocation_id":{ "id":"V6ePWlEBSCGve4sIXXWm1w" }, "unassigned_info":{ "reason":"ALLOCATION_FAILED", "at":"2019-09-12T06:38:16.568Z", "failed_attempts":5, "delayed":false, "details":"failed recovery, failure RecoveryFailedException[[test_index][3]: Recovery failed from {5cCOK1o}{5cCOK1oWT_KrCgerQGfcaA}{Lk2vCAhzQJK6r5C6UzXLZw}{10.10.161.102}{10.10.161.102:9300} into {KbRtC52}{KbRtC52uQWS_6C5l1kocKA}{0KKoe57ATfyA6oKehRoArw}{10.10.161.103}{10.10.161.103:9300}]; nested: RemoteTransportException[[5cCOK1o][10.10.161.102:9300][internal:index/shard/recovery/start_recovery]]; nested: RecoveryEngineException[Phase[1] phase1 failed]; nested: RecoverFilesRecoveryException[Failed to transfer [0] files with total size of [0b]]; nested: IllegalStateException[try to recover [test_index][3] from primary shard with sync id but number of docs differ: 4609345 (5cCOK1o, primary) vs 4609267(KbRtC52)]; ", "allocation_status":"no_attempt" } }
{ "error": { "root_cause": [ { "type": "remote_transport_exception", "reason": "[5cCOK1o][10.10.161.102:9300][cluster:admin/reroute]" } ], "type": "illegal_argument_exception", "reason": "[allocate_replica] allocation of [test_index][3] on node {KbRtC52}{KbRtC52uQWS_6C5l1kocKA}{0KKoe57ATfyA6oKehRoArw}{10.10.161.103}{10.10.161.103:9300} is not allowed, reason: [NO(shard has exceeded the maximum number of retries [5] on failed allocation attempts - manually call [/_cluster/reroute?retry_failed=true] to retry, [unassigned_info[[reason=ALLOCATION_FAILED], at[2019-09-12T09:02:57.343Z], failed_attempts[6], delayed=false, details[failed recovery, failure RecoveryFailedException[[test_index][3]: Recovery failed from {5cCOK1o}{5cCOK1oWT_KrCgerQGfcaA}{Lk2vCAhzQJK6r5C6UzXLZw}{10.10.161.102}{10.10.161.102:9300} into {KbRtC52}{KbRtC52uQWS_6C5l1kocKA}{0KKoe57ATfyA6oKehRoArw}{10.10.161.103}{10.10.161.103:9300}]; nested: RemoteTransportException[[5cCOK1o][10.10.161.102:9300][internal:index/shard/recovery/start_recovery]]; nested: RecoveryEngineException[Phase[1] phase1 failed]; nested: RecoverFilesRecoveryException[Failed to transfer [0] files with total size of [0b]]; nested: IllegalStateException[try to recover [test_index][3] from primary shard with sync id but number of docs differ: 4609345 (5cCOK1o, primary) vs 4609267(KbRtC52)]; ], allocation_status[no_attempt]]])][YES(primary shard for this replica is already active)][YES(explicitly ignoring any disabling of allocation due to manual allocation commands via the reroute API)][YES(target node version [5.2.2] is the same or newer than source node version [5.2.2])][YES(the shard is not being snapshotted)][YES(node passes include/exclude/require filters)][YES(the shard does not exist on the same node)][YES(enough disk for shard on node, free: [3tb], shard size: [0b], free after allocating shard: [3tb])][YES(below shard recovery limit of outgoing: [0 < 2] incoming: [0 < 2])][YES(total shard limits are disabled: [index: -1, cluster: -1] <= 0)][YES(allocation awareness is not enabled, set cluster setting [cluster.routing.allocation.awareness.attributes] to enable it)]" }, "status": 400 }
test_index 3 p STARTED 4609345 1.3gb 10.10.161.102 5cCOK1o test_index 2 p STARTED 4609050 1.6gb 10.10.161.103 KbRtC52 test_index 1 p STARTED 4607156 1.5gb 10.10.161.103 KbRtC52 test_index 4 p STARTED 4596510 1.3gb 10.10.161.102 5cCOK1o test_index 0 p STARTED 4605846 1.4gb 10.10.161.102 5cCOK1o