Skip to content

Instantly share code, notes, and snippets.

@cinhtau
Last active November 14, 2019 12:20
Show Gist options
  • Save cinhtau/a25590ca9e2e29d1c31dc8c5959bb4e3 to your computer and use it in GitHub Desktop.
Save cinhtau/a25590ca9e2e29d1c31dc8c5959bb4e3 to your computer and use it in GitHub Desktop.
Elasticsearch S3 Repository Quick Sheet

Installation

Step 1: Install Plugin

sudo bin/elasticsearch-plugin install repository-s3

Configuration

Example settings

cloud:
    aws:
        access_key: AAAABBBB1234CCCC5678
        secret_key: Ahfk380HqZR7sUYdeH2Xw*ZxyY8fwlF5QVQoxiJ$
        s3.region: eu-central

Or use elasticsearch.keystore with above settings.

Restart Elasticsearch nodes

Repository Management

  • create
  • verify

Create Repository

PUT _snapshot/s3
{
    "type" : "s3",
    "settings" : {
      "bucket" : "your-bucket-name",
      "base_path" : "elasticsearch",
      "region" : "eu-central-1",
      "compress" : "true"
    }
}

Verify Repository

Verify snaphost repository

POST /_snapshot/s3/_verify

Snapshots

  • check
  • create
  • restore

Check snapshots

GET _snapshot/s3/_all

Create snapshots

PUT /_snapshot/s3/bike-rental
{
  "indices": "bike-rental-*,rental-stations",
  "ignore_unavailable": false,
  "include_global_state": false
}

Restore snapshots

POST /_snapshot/s3/bike-rental/_restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment