Commit 155244f7 authored by tobinski's avatar tobinski
Browse files

Update readme and add description for snapshot creation

parent 59dba832
Pipeline #6182 passed with stages
in 2 minutes and 51 seconds
......@@ -3,5 +3,44 @@ This is a custom elasticsearch image with the elastic image as a base and the s3
## Build
```bash
docker build --build-arg elasticsearch_version=7
docker build --build-arg elasticsearch_version=7.9.3
```
## Snapshot key
We use keystore to store s3 key and secrete as [recommended by elastic](https://github.com/elastic/helm-charts/blob/master/elasticsearch/README.md#how-to-use-the-keystore). Check the deployment of the es-cluster to see how we use the secrets.
```
kubectl create secret generic s3-access-key --from-literal=s3.client.default.access_key=''
kubectl create secret generic s3-secret-key --from-literal=s3.client.default.secret_key=''
```
## Config Snapshots S3
To use the [s3 plugin](https://www.elastic.co/guide/en/elasticsearch/plugins/6.8/repository-s3-repository.html) with Digital Ocean we need to configure a s3 repository for the backup. We use the official helm repo. Checkout the docu for [snapshots](https://github.com/elastic/helm-charts/tree/master/elasticsearch#how-to-enable-snapshotting).
```bash
kubectl port-forward service/elasticsearch-master-headless 9200:9200
curl --location --request PUT 'localhost:9200/_snapshot/metagrid-backup-es-7' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "s3",
"settings": {
"endpoint": "fra1.digitaloceanspaces.com",
"bucket": "metagrid-backup-es-7"
}
}'
```
## Take a snapshot S3
To use the s3 plugin with Digital Ocean we need to configure a s3 repository for the backup.
```bash
kubectl port-forward service/elasticsearch-master-headless 9200:9200
curl --location --request PUT 'localhost:9200/_snapshot/metagrid-backup-es-7/%3Csnapshot-%7Bnow%2Fd%7D%3E' \
--header 'Content-Type: application/json'
```
## Check snapshot status
You may want to know when the snapshot is finished.
```bash
curl --location --request GET 'localhost:9200/_snapshot/metagrid-backup-es-7/%3Csnapshot-%7Bnow%2Fd%7D%3E' \
--header 'Content-Type: application/json'
```
You should log into Digital ocean Dashboard and check the spaces if there are new files.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment