Skip to content

Instantly share code, notes, and snippets.

@georgegoh
Last active November 14, 2017 03:46
Show Gist options
  • Save georgegoh/1bac380095f9507112eb76e814341b6a to your computer and use it in GitHub Desktop.
Save georgegoh/1bac380095f9507112eb76e814341b6a to your computer and use it in GitHub Desktop.
Set up backup path for Elasticsearch
oc rsh `oc get po -l component=es --show-labels -o name|head -n 1` \
curl --cacert /etc/elasticsearch/secret/admin-ca \
--cert /etc/elasticsearch/secret/admin-cert \
--key /etc/elasticsearch/secret/admin-key \
-XPUT 'https://logging-es:9200/_snapshot/log_backup?pretty' -H 'Content-Type: application/json' -d'
{
"type": "fs",
"settings": {
"location": "/elasticsearch/backup",
"compress": true
}
}
'
oc rsh `oc get po -l component=es --show-labels -o name|head -n 1` \
curl --cacert /etc/elasticsearch/secret/admin-ca \
--cert /etc/elasticsearch/secret/admin-cert \
--key /etc/elasticsearch/secret/admin-key \
-XGET 'https://logging-es:9200/_snapshot/log_backup?pretty'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment