1

I am using Elasticsearch Curator to manage my indices. I want to shrink / reindex a given index and then rename it back to the original index name. I can do this manually because I know the indices name, but it's hard to do this using Curator. This is what I have right now:

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

For now, I can't use aliases so I want to shrink / reindex back to the original index

Elastic Search version: 7.2 Curator version: 5.8

Thanks!

alina
  • 291
  • 2
  • 9
  • Why can't you use aliases? In Elasticsearch, an alias can behave exactly like an index, even permitting writes in some cases. I cannot think of a good reason why not use an alias here, so I would like to hear your reasoning. – untergeek Jun 08 '20 at 17:23
  • @untergeek at the end, I resolved to using aliases because there was no other way I could think of to rename the indices back to their original names using curator :/ – alina Jun 08 '20 at 18:34

0 Answers0