Opendistro for Elasticsearch - ISM 未触发作业
Opendistro for Elasticsearch - ISM is not triggering jobs
我正在尝试在 AWS Elasticsearch Service v7.8 上将 ISM 与 opendistro 结合使用。我正在尝试设置一个基本的 rollover/delete 政策,但该政策似乎没有触发。我假设我做错了什么,但我似乎无法追踪它...我正在使用每小时滚动一次并在 6 小时后删除进行测试...
这是我的 ISM 策略,我将其命名为“测试”:
{
"policy": {
"policy_id": "test",
"description": "A test policy",
"last_updated_time": 1605196195481,
"schema_version": 1,
"error_notification": null,
"default_state": "active",
"states": [{
"name": "active",
"actions": [{
"rollover": {
"min_index_age": "1h"
}
}],
"transitions": [{
"state_name": "delete",
"conditions": {
"min_index_age": "6h"
}
}]
},
{
"name": "delete",
"actions": [{
"delete": {}
}],
"transitions": []
}
]
}
}
我创建了一个模板来维护索引创建等。这是模板。请注意,我正在添加翻转别名“atest”,但 policy_id 是“test”。我没有将索引添加到此模板中的任何别名:
PUT /_template/atest
{
"index_patterns" : [
"atest-*"
],
"settings" : {
"index" : {
"opendistro" : {
"index_state_management" : {
"policy_id" : "test",
"rollover_alias" : "atest"
}
},
"analysis" : {
}
}
},
"mappings" : {
},
"aliases" : { }
}
然后我使用模板中的索引模式创建一个索引,将其添加到我在上面定义为翻转别名的内容中:
PUT /atest-000001
{
"aliases": {"atest": {}}
}
然后我可以在 opendistro-ism-config 索引中看到文档:
{
"_index": ".opendistro-ism-config",
"_type": "_doc",
"_id": "T_k8jMI5RvuWRaLp1tY_hg",
"_version": 2,
"_score": null,
"_source": {
"managed_index": {
"name": "atest-000001",
"enabled": true,
"index": "atest-000001",
"index_uuid": "T_k8jMI5RvuWRaLp1tY_hg",
"schedule": {
"interval": {
"start_time": 1605200587242,
"period": 30,
"unit": "Minutes"
}
},
"last_updated_time": 1605200587242,
"enabled_time": 1605200587242,
"policy_id": "test",
"policy_seq_no": 422,
"policy_primary_term": 111,
"policy": {
"policy_id": "test",
"description": "A test policy",
"last_updated_time": 1605196195481,
"schema_version": 1,
"error_notification": null,
"default_state": "active",
"states": [
{
"name": "active",
"actions": [
{
"rollover": {
"min_index_age": "1h"
}
}
],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "6h"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
]
},
"change_policy": null
}
},
"fields": {
"managed_index.last_updated_time": [
"2020-11-12T17:03:07.242Z"
],
"policy.last_updated_time": [],
"policy.states.actions.notification.destination.last_update_time": [],
"policy.error_notification.destination.last_update_time": [],
"managed_index.schedule.interval.start_time": [
"2020-11-12T17:03:07.242Z"
],
"managed_index.enabled_time": [
"2020-11-12T17:03:07.242Z"
]
},
"sort": [
1605200587242
]
}
在某些时候,我看到托管索引信息从“正在初始化”变为
{
"message": "Successfully initialized policy: test"
}
此时,没有任何反应。 kibana 中 ISM 控制台中“atest-000001”的行表示“状态”为“活动”,“操作”为“-”,“作业状态”为“运行”。它会保持这样几天......
我也试过:
PUT _cluster/settings
{
"persistent": {
"opendistro.index_state_management.enabled" : true
}
}
仍然没有触发。我做错了什么?
原来这是一个内部的 AWS ES 东西。更新到 R20201117 解决了这个问题。
我正在尝试在 AWS Elasticsearch Service v7.8 上将 ISM 与 opendistro 结合使用。我正在尝试设置一个基本的 rollover/delete 政策,但该政策似乎没有触发。我假设我做错了什么,但我似乎无法追踪它...我正在使用每小时滚动一次并在 6 小时后删除进行测试...
这是我的 ISM 策略,我将其命名为“测试”:
{
"policy": {
"policy_id": "test",
"description": "A test policy",
"last_updated_time": 1605196195481,
"schema_version": 1,
"error_notification": null,
"default_state": "active",
"states": [{
"name": "active",
"actions": [{
"rollover": {
"min_index_age": "1h"
}
}],
"transitions": [{
"state_name": "delete",
"conditions": {
"min_index_age": "6h"
}
}]
},
{
"name": "delete",
"actions": [{
"delete": {}
}],
"transitions": []
}
]
}
}
我创建了一个模板来维护索引创建等。这是模板。请注意,我正在添加翻转别名“atest”,但 policy_id 是“test”。我没有将索引添加到此模板中的任何别名:
PUT /_template/atest
{
"index_patterns" : [
"atest-*"
],
"settings" : {
"index" : {
"opendistro" : {
"index_state_management" : {
"policy_id" : "test",
"rollover_alias" : "atest"
}
},
"analysis" : {
}
}
},
"mappings" : {
},
"aliases" : { }
}
然后我使用模板中的索引模式创建一个索引,将其添加到我在上面定义为翻转别名的内容中:
PUT /atest-000001
{
"aliases": {"atest": {}}
}
然后我可以在 opendistro-ism-config 索引中看到文档:
{
"_index": ".opendistro-ism-config",
"_type": "_doc",
"_id": "T_k8jMI5RvuWRaLp1tY_hg",
"_version": 2,
"_score": null,
"_source": {
"managed_index": {
"name": "atest-000001",
"enabled": true,
"index": "atest-000001",
"index_uuid": "T_k8jMI5RvuWRaLp1tY_hg",
"schedule": {
"interval": {
"start_time": 1605200587242,
"period": 30,
"unit": "Minutes"
}
},
"last_updated_time": 1605200587242,
"enabled_time": 1605200587242,
"policy_id": "test",
"policy_seq_no": 422,
"policy_primary_term": 111,
"policy": {
"policy_id": "test",
"description": "A test policy",
"last_updated_time": 1605196195481,
"schema_version": 1,
"error_notification": null,
"default_state": "active",
"states": [
{
"name": "active",
"actions": [
{
"rollover": {
"min_index_age": "1h"
}
}
],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "6h"
}
}
]
},
{
"name": "delete",
"actions": [
{
"delete": {}
}
],
"transitions": []
}
]
},
"change_policy": null
}
},
"fields": {
"managed_index.last_updated_time": [
"2020-11-12T17:03:07.242Z"
],
"policy.last_updated_time": [],
"policy.states.actions.notification.destination.last_update_time": [],
"policy.error_notification.destination.last_update_time": [],
"managed_index.schedule.interval.start_time": [
"2020-11-12T17:03:07.242Z"
],
"managed_index.enabled_time": [
"2020-11-12T17:03:07.242Z"
]
},
"sort": [
1605200587242
]
}
在某些时候,我看到托管索引信息从“正在初始化”变为
{
"message": "Successfully initialized policy: test"
}
此时,没有任何反应。 kibana 中 ISM 控制台中“atest-000001”的行表示“状态”为“活动”,“操作”为“-”,“作业状态”为“运行”。它会保持这样几天...... 我也试过:
PUT _cluster/settings
{
"persistent": {
"opendistro.index_state_management.enabled" : true
}
}
仍然没有触发。我做错了什么?
原来这是一个内部的 AWS ES 东西。更新到 R20201117 解决了这个问题。