Commit ae7f6f6b authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request redmic-project/elastic/curator!13
parents 527807b5 fee87607
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -5,7 +5,21 @@
In order to restore Elasticsearch indices, you must create a new pipeline to deploy 'curator-restore' service.
Define these environment variables to configure manual pipeline:

* **DD_SNAPSHOT_RESTORE_NAME**: Snapshot source name to restore indices. Leave it empty to use last snapshot.
* **DD_SNAPSHOT_RESTORE_INDICES**: Name/expression to filter indices to restore. Accepts wildcards.
* **DD_SNAPSHOT_RESTORE_NAME**: Snapshot source name to restore indices. Leave it empty to use last snapshot. Empty by default.
* **DD_SNAPSHOT_RESTORE_INDICES**: Name/expression to filter indices to restore. Accepts wildcards. Leave it empty to restore all indices. Default: `index.name`.
* **DD_SNAPSHOT_RESTORE_RENAME_PATTERN**: Expression to match indices names and prepare text groups to replace, in order to rename restored indices. Leave it empty to keep original names. Empty by default.
* **DD_SNAPSHOT_RESTORE_RENAME_REPLACEMENT**: Replacement for matched indices names, in order to rename restored indices. Leave it empty to keep original names. Empty by default.

Then, you can run deploy task manually.

### Restore with rename example

For example, to restore last snapshot of an index named `test` with a new name `restored_test`, you should define:

```sh
DD_SNAPSHOT_RESTORE_INDICES=test
DD_SNAPSHOT_RESTORE_RENAME_PATTERN=(.+)
DD_SNAPSHOT_RESTORE_RENAME_REPLACEMENT=restored_$$1 # Double dollar to avoid gitlab-ci replacement
```

Remember to use a renamed value which doesn't interfere with existing aliases.
+2 −0
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ SNAPSHOT_REPOSITORY=s3-backup
DELETE_OLD_SNAPSHOTS_DAYS_COUNT=90
SNAPSHOT_RESTORE_NAME=
SNAPSHOT_RESTORE_INDICES=index.name
SNAPSHOT_RESTORE_RENAME_PATTERN=
SNAPSHOT_RESTORE_RENAME_REPLACEMENT=
SNAPSHOT_RESTORE_INCLUDE_ALIASES=True
DELETE_OLD_LOGS_DISABLE=False
SNAPSHOT_DISABLE=False
+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ actions:
      name: ${SNAPSHOT_RESTORE_NAME}
      indices:
      - ${SNAPSHOT_RESTORE_INDICES}
      rename_pattern: ${SNAPSHOT_RESTORE_RENAME_PATTERN}
      rename_replacement: ${SNAPSHOT_RESTORE_RENAME_REPLACEMENT}
      include_aliases: ${SNAPSHOT_RESTORE_INCLUDE_ALIASES:True}
      ignore_unavailable: True
      wait_interval: 30
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ services:
      SNAPSHOT_REPOSITORY:
      SNAPSHOT_RESTORE_NAME:
      SNAPSHOT_RESTORE_INDICES:
      SNAPSHOT_RESTORE_RENAME_PATTERN:
      SNAPSHOT_RESTORE_RENAME_REPLACEMENT:
      SNAPSHOT_RESTORE_INCLUDE_ALIASES:
      DELETE_OLD_LOGS_DISABLE: 'True'
      SNAPSHOT_DISABLE: 'True'