ism不会触发工作

lf5gs5x2  于 2021-06-10  发布在  ElasticSearch
关注(0)|答案(1)|浏览(479)

我尝试在aws elasticsearch服务v7.8上使用ism和opendistro。我正在尝试设置一个基本的滚动/删除策略,但该策略似乎没有触发。我想我做错了什么,但我似乎找不到答案。。。我正在测试它使用滚动每小时和删除后6小时。。。
这是我的ism政策,我把它恰当地命名为“测试”:

  1. {
  2. "policy": {
  3. "policy_id": "test",
  4. "description": "A test policy",
  5. "last_updated_time": 1605196195481,
  6. "schema_version": 1,
  7. "error_notification": null,
  8. "default_state": "active",
  9. "states": [{
  10. "name": "active",
  11. "actions": [{
  12. "rollover": {
  13. "min_index_age": "1h"
  14. }
  15. }],
  16. "transitions": [{
  17. "state_name": "delete",
  18. "conditions": {
  19. "min_index_age": "6h"
  20. }
  21. }]
  22. },
  23. {
  24. "name": "delete",
  25. "actions": [{
  26. "delete": {}
  27. }],
  28. "transitions": []
  29. }
  30. ]
  31. }
  32. }

我已经创建了一个模板来维护索引创建等。注意,我添加了滚动别名“atest”,但是策略id是“test”。我不会将索引添加到此模板中的任何别名:

  1. PUT /_template/atest
  2. {
  3. "index_patterns" : [
  4. "atest-*"
  5. ],
  6. "settings" : {
  7. "index" : {
  8. "opendistro" : {
  9. "index_state_management" : {
  10. "policy_id" : "test",
  11. "rollover_alias" : "atest"
  12. }
  13. },
  14. "analysis" : {
  15. }
  16. }
  17. },
  18. "mappings" : {
  19. },
  20. "aliases" : { }
  21. }

然后,我使用模板中的索引模式创建一个索引,将其添加到我在上面定义的滚动别名中:

  1. PUT /atest-000001
  2. {
  3. "aliases": {"atest": {}}
  4. }

然后我可以在opendistro ism配置索引中看到文档:

  1. {
  2. "_index": ".opendistro-ism-config",
  3. "_type": "_doc",
  4. "_id": "T_k8jMI5RvuWRaLp1tY_hg",
  5. "_version": 2,
  6. "_score": null,
  7. "_source": {
  8. "managed_index": {
  9. "name": "atest-000001",
  10. "enabled": true,
  11. "index": "atest-000001",
  12. "index_uuid": "T_k8jMI5RvuWRaLp1tY_hg",
  13. "schedule": {
  14. "interval": {
  15. "start_time": 1605200587242,
  16. "period": 30,
  17. "unit": "Minutes"
  18. }
  19. },
  20. "last_updated_time": 1605200587242,
  21. "enabled_time": 1605200587242,
  22. "policy_id": "test",
  23. "policy_seq_no": 422,
  24. "policy_primary_term": 111,
  25. "policy": {
  26. "policy_id": "test",
  27. "description": "A test policy",
  28. "last_updated_time": 1605196195481,
  29. "schema_version": 1,
  30. "error_notification": null,
  31. "default_state": "active",
  32. "states": [
  33. {
  34. "name": "active",
  35. "actions": [
  36. {
  37. "rollover": {
  38. "min_index_age": "1h"
  39. }
  40. }
  41. ],
  42. "transitions": [
  43. {
  44. "state_name": "delete",
  45. "conditions": {
  46. "min_index_age": "6h"
  47. }
  48. }
  49. ]
  50. },
  51. {
  52. "name": "delete",
  53. "actions": [
  54. {
  55. "delete": {}
  56. }
  57. ],
  58. "transitions": []
  59. }
  60. ]
  61. },
  62. "change_policy": null
  63. }
  64. },
  65. "fields": {
  66. "managed_index.last_updated_time": [
  67. "2020-11-12T17:03:07.242Z"
  68. ],
  69. "policy.last_updated_time": [],
  70. "policy.states.actions.notification.destination.last_update_time": [],
  71. "policy.error_notification.destination.last_update_time": [],
  72. "managed_index.schedule.interval.start_time": [
  73. "2020-11-12T17:03:07.242Z"
  74. ],
  75. "managed_index.enabled_time": [
  76. "2020-11-12T17:03:07.242Z"
  77. ]
  78. },
  79. "sort": [
  80. 1605200587242
  81. ]
  82. }

在某个时刻,我看到托管索引信息从“初始化”变为

  1. {
  2. "message": "Successfully initialized policy: test"
  3. }

在这一点上,什么也没有发生。kibana中ism控制台中“atest-000001”的行表示“state”为“active”,“action”为“-”,“job status”为“running”。它会像这样持续好几天。。。我也尝试过:

  1. PUT _cluster/settings
  2. {
  3. "persistent": {
  4. "opendistro.index_state_management.enabled" : true
  5. }
  6. }

还是没有什么触发。我做错什么了?

rqdpfwrv

rqdpfwrv1#

原来是内部的事情。更新到r20201117解决了问题。

相关问题