gpt4 book ai didi

elasticsearch - 删除旧索引的索引生命周期策略

转载 作者:行者123 更新时间:2023-12-03 02:17:12 25 4
gpt4 key购买 nike

我已阅读以下教程:
https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index-lifecycle-management.html
经过几次它的阶段,我仍然停留在得到同样的错误。
我想自动删除具有一定年龄的旧索引。
我在AWS上有几个实例,每个实例都在 Elasticsearch 上写入自己的索引,例如:
索引名称-

filebeat-log-centralization-ds-test-2020.08.09
映射到索引模板
{
"filebeat-template" : {
"order" : 0,
"index_patterns" : [
"filebeat-*"
],
"settings" : {
"index" : {
"lifecycle" : {
"name" : "logs-deletion-policy",
"rollover_alias" : "filebeat"
},
"number_of_shards" : "1",
"number_of_replicas" : "0"
}
},
"mappings" : {
"_meta" : { },
"_source" : { },
"properties" : { /*** some mappings ***/
"aliases" : { }
}
}
ILM政策:
PUT _ilm/policy/logs-deletion-policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_size": "50GB",
"max_age": "1m"
}
}
},
"delete": {
"min_age": "0d",
"actions": {
"delete": {}
}
}
}
}
}
我已经引导了过渡别名索引:
PUT filebeat-000001
{
"aliases": {
"filebeat": {
"is_write_index": true
}
}
}
filebeat-0000N索引(我刚刚创建的过渡别名索引)正在翻转并被删除,
但是 "filebeat-log-centralization-ds-test-2020.08.09"显示错误:
illegal_argument_exception: index.lifecycle.rollover_alias [filebeat] 
does not point to index [filebeat-log-centralization-ds-test-2020.08.09]
我不知道我在做什么错,并试图重复本教程,但没有成功。
我想念什么?
编辑:
我尝试将filebeat别名添加到索引模板。
GET /filebeat-log-centralization-ds-test-2020.08.09/_alias/
{
"filebeat-log-centralization-ds-test-2020.08.09" : {
"aliases" : {
"filebeat" : { }
}
}
}
导致 filebeat-log-centralization-ds-test-2020.08.09索引错误 illegal_argument_exception: Rollover alias [filebeat] can point to multiple indices, found duplicated alias [[filebeat]] in index template [filebeat-template]

最佳答案

您的alias创建的filebeat似乎没有指向要删除的索引,该索引在异常消息中被突出显示。

index.lifecycle.rollover_alias [filebeat] does not point to index[filebeat-log-centralization-ds-test-2020.08.09]


您可以使用 GET alias API进行确认,如果没有链接,可以使用 use update alias APIfilebeat别名链接到 filebeat-log-centralization-ds-test-2020.08.09

关于elasticsearch - 删除旧索引的索引生命周期策略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63324172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com