我正在使用 Elasticsearch Curator 来管理我的索引。我想缩小/重新索引给定索引,然后将其重命名为原始索引名称。我可以手动执行此操作,因为我知道索引名称,但使用 Curator 很难执行此操作。这就是我现在所拥有的:
actions:
1:
action: shrink
description: "Shrink index to have a different number of shards"
options:
disable_action: False
ignore_empty_list: True
shrink_node: DETERMINISTIC
node_filters:
permit_masters: False
number_of_shards: 1
number_of_replicas: 0
shrink_prefix:
shrink_suffix: '-shrink' # adds the shrink suffix which later I want to remove
delete_after: True
post_allocation:
allocation_type: include
key: node_tag
value: cold
wait_for_active_shards: 1
extra_settings:
settings:
index.codec: best_compression
wait_for_completion: True
wait_for_rebalance: True
wait_interval: 9
max_wait: -1
filters:
- filtertype: pattern
kind: prefix
value: myindex-
2:
action: reindex
description: "Reindexing index to the original name"
options:
disable_action: False
ignore_empty_list: True
wait_for_active_shards: all
wait_for_completion: True
wait_interval: 9
max_wait: -1
request_body:
source:
index: REINDEX_SELECTION
dest:
index: index2 # not sure what to write here. I want to basically get rid of the suffix 'shrink'
filters:
- filtertype: pattern
kind: suffix
value: -shrink
现在,我不能使用别名,所以我想缩小/重新索引回原始索引
弹性搜索版本:7.2 策展人版本:5.8
谢谢!