试试搜索一下吧

elasticsearch IllegalArgumentException[Operation term is newer than the current term; current term[2

Elasticsearch | 作者 yimusidian | 发布于2022年02月08日 | 阅读数:567

ES集群重启后,出现索引分片分配异常的情况,请大佬们帮忙指导下:
[root@Master ~]# curl "localhost:31600/_cluster/allocation/explain?pretty"
{
"index" : "event20220127_v11",
"shard" : 0,
"primary" : false,
"current_state" : "unassigned",
"unassigned_info" : {
"reason" : "ALLOCATION_FAILED",
"at" : "2022-02-08T09:20:43.369Z",
"failed_allocation_attempts" : 5,
"details" : "failed shard on node [rjiKYNAmShCTl4lBDZCkiA]: failed recovery, failure RecoveryFailedException[[event20220127_v11][0]: Recovery failed from {jQPHEkd}{jQPHEkdMT12fSoacK0gN5A}{Fy20RC1XS0S-YJQjAhfZtg}{19.19.19.3}{19.19.19.3:31701}{rack_id=rack_two, xpack.installed=true} into {rjiKYNA}{rjiKYNAmShCTl4lBDZCkiA}{WPpYwxstT46TazKFnJBjyA}{19.19.19.2}{19.19.19.2:31701}{rack_id=rack_one, xpack.installed=true}]; nested: RemoteTransportException[[jQPHEkd][19.19.19.3:31701][internal:index/shard/recovery/start_recovery]]; nested: TranslogException[Failed to write operation [Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; nested: IllegalArgumentException[Operation term is newer than the current term; current term[2], operation term[Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; ",
"last_allocation_status" : "no_attempt"
},
"can_allocate" : "no",
"allocate_explanation" : "cannot allocate because allocation is not permitted to any of the nodes",
"node_allocation_decisions" : [
{
"node_id" : "H1iEUvGNQfm_asyYbiDUuw",
"node_name" : "H1iEUvG",
"transport_address" : "19.19.19.2:31700",
"node_attributes" : {
"rack_id" : "rack_one",
"xpack.installed" : "true"
},
"node_decision" : "no",
"deciders" : [
{
"decider" : "max_retry",
"decision" : "NO",
"explanation" : "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[2022-02-08T09:20:43.369Z], failed_attempts[5], delayed=false, details[failed shard on node [rjiKYNAmShCTl4lBDZCkiA]: failed recovery, failure RecoveryFailedException[[event20220127_v11][0]: Recovery failed from {jQPHEkd}{jQPHEkdMT12fSoacK0gN5A}{Fy20RC1XS0S-YJQjAhfZtg}{19.19.19.3}{19.19.19.3:31701}{rack_id=rack_two, xpack.installed=true} into {rjiKYNA}{rjiKYNAmShCTl4lBDZCkiA}{WPpYwxstT46TazKFnJBjyA}{19.19.19.2}{19.19.19.2:31701}{rack_id=rack_one, xpack.installed=true}]; nested: RemoteTransportException[[jQPHEkd][19.19.19.3:31701][internal:index/shard/recovery/start_recovery]]; nested: TranslogException[Failed to write operation [Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; nested: IllegalArgumentException[Operation term is newer than the current term; current term[2], operation term[Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; ], allocation_status[no_attempt]]]"
}
]
},
{
"node_id" : "Xxy_3ed1QlW5U4ajP8VEtQ",
"node_name" : "Xxy_3ed",
"transport_address" : "19.19.19.3:31700",
"node_attributes" : {
"rack_id" : "rack_two",
"xpack.installed" : "true"
},
"node_decision" : "no",
"deciders" : [
{
"decider" : "max_retry",
"decision" : "NO",
"explanation" : "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[2022-02-08T09:20:43.369Z], failed_attempts[5], delayed=false, details[failed shard on node [rjiKYNAmShCTl4lBDZCkiA]: failed recovery, failure RecoveryFailedException[[event20220127_v11][0]: Recovery failed from {jQPHEkd}{jQPHEkdMT12fSoacK0gN5A}{Fy20RC1XS0S-YJQjAhfZtg}{19.19.19.3}{19.19.19.3:31701}{rack_id=rack_two, xpack.installed=true} into {rjiKYNA}{rjiKYNAmShCTl4lBDZCkiA}{WPpYwxstT46TazKFnJBjyA}{19.19.19.2}{19.19.19.2:31701}{rack_id=rack_one, xpack.installed=true}]; nested: RemoteTransportException[[jQPHEkd][19.19.19.3:31701][internal:index/shard/recovery/start_recovery]]; nested: TranslogException[Failed to write operation [Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; nested: IllegalArgumentException[Operation term is newer than the current term; current term[2], operation term[Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; ], allocation_status[no_attempt]]]"
},
{
"decider" : "awareness",
"decision" : "NO",
"explanation" : "there are too many copies of the shard allocated to nodes with attribute [rack_id], there are [2] total configured shard copies for this shard id and [2] total attribute values, expected the allocated shard count per attribute [2] to be less than or equal to the upper bound of the required number of shards per attribute [1]"
}
]
},
{
"node_id" : "jQPHEkdMT12fSoacK0gN5A",
"node_name" : "jQPHEkd",
"transport_address" : "19.19.19.3:31701",
"node_attributes" : {
"rack_id" : "rack_two",
"xpack.installed" : "true"
},
"node_decision" : "no",
"deciders" : [
{
"decider" : "max_retry",
"decision" : "NO",
"explanation" : "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[2022-02-08T09:20:43.369Z], failed_attempts[5], delayed=false, details[failed shard on node [rjiKYNAmShCTl4lBDZCkiA]: failed recovery, failure RecoveryFailedException[[event20220127_v11][0]: Recovery failed from {jQPHEkd}{jQPHEkdMT12fSoacK0gN5A}{Fy20RC1XS0S-YJQjAhfZtg}{19.19.19.3}{19.19.19.3:31701}{rack_id=rack_two, xpack.installed=true} into {rjiKYNA}{rjiKYNAmShCTl4lBDZCkiA}{WPpYwxstT46TazKFnJBjyA}{19.19.19.2}{19.19.19.2:31701}{rack_id=rack_one, xpack.installed=true}]; nested: RemoteTransportException[[jQPHEkd][19.19.19.3:31701][internal:index/shard/recovery/start_recovery]]; nested: TranslogException[Failed to write operation [Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; nested: IllegalArgumentException[Operation term is newer than the current term; current term[2], operation term[Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; ], allocation_status[no_attempt]]]"
},
{
"decider" : "same_shard",
"decision" : "NO",
"explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[event20220127_v11][0], node[jQPHEkdMT12fSoacK0gN5A], [P], s[STARTED], a[id=mF9M5kv9TbCSOopLoIamBg]]"
},
{
"decider" : "awareness",
"decision" : "NO",
"explanation" : "there are too many copies of the shard allocated to nodes with attribute [rack_id], there are [2] total configured shard copies for this shard id and [2] total attribute values, expected the allocated shard count per attribute [2] to be less than or equal to the upper bound of the required number of shards per attribute [1]"
}
]
},
{
"node_id" : "rjiKYNAmShCTl4lBDZCkiA",
"node_name" : "rjiKYNA",
"transport_address" : "19.19.19.2:31701",
"node_attributes" : {
"rack_id" : "rack_one",
"xpack.installed" : "true"
},
"node_decision" : "no",
"deciders" : [
{
"decider" : "max_retry",
"decision" : "NO",
"explanation" : "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[2022-02-08T09:20:43.369Z], failed_attempts[5], delayed=false, details[failed shard on node [rjiKYNAmShCTl4lBDZCkiA]: failed recovery, failure RecoveryFailedException[[event20220127_v11][0]: Recovery failed from {jQPHEkd}{jQPHEkdMT12fSoacK0gN5A}{Fy20RC1XS0S-YJQjAhfZtg}{19.19.19.3}{19.19.19.3:31701}{rack_id=rack_two, xpack.installed=true} into {rjiKYNA}{rjiKYNAmShCTl4lBDZCkiA}{WPpYwxstT46TazKFnJBjyA}{19.19.19.2}{19.19.19.2:31701}{rack_id=rack_one, xpack.installed=true}]; nested: RemoteTransportException[[jQPHEkd][19.19.19.3:31701][internal:index/shard/recovery/start_recovery]]; nested: TranslogException[Failed to write operation [Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; nested: IllegalArgumentException[Operation term is newer than the current term; current term[2], operation term[Index{id='7972048913201064', type='event', seqNo=19468465, primaryTerm=3, version=1, autoGeneratedIdTimestamp=-1}]]; ], allocation_status[no_attempt]]]"
}
]
}
]
}
[root@Master ~]#
已邀请:

locatelli

赞同来自:

这个shard是一个replica,你应该先查看primary为什么不能allocate
 
GET /_cluster/allocation/explain { "index": "event20220127_v11", "shard": 0, "primary": true }

要回复问题请先登录注册