Skip to content

elasticsearch backup and restore for telemetry and composite search to azure blob

G33tha edited this page Jan 4, 2019 · 1 revision

Backup:

#Install plugin:- sudo ES_PATH_CONF=/etc/elasticsearch/es-node-2 /usr/share/elasticsearch/bin/elasticsearch-plugin install repository-azure

#change the configuration: sudo nano /etc/elasticsearch/es-node-2/elasticsearch.yml cloud.azure.storage.default.account: xxxxxxxxxxx cloud.azure.storage.default.key: xxxxxx

#Restart ES Service: sudo systemctl restart es-node-2_elasticsearch.service

#create Repo: curl -XPUT 'http://localhost:9200/_snapshot/azurebackup' -H 'Content-Type: application/json' -d '{ "type": "azure", "settings": { "container": "elasticsearch-snapshots", "base_path": "sunbirddevtele"} }'

#create Snapshot: curl -XPUT 'http://localhost:9200/_snapshot/azurebackup/snapshot_1' -H 'Content-Type: application/json' -d '{ "indices":"*","include_global_state":false }'

#check status of backup curl -XGET 'http://localhost:9200/_snapshot/azurebackup/_all'

Restore: #Install plugin:- sudo ES_PATH_CONF=/etc/elasticsearch/es-node-2 /usr/share/elasticsearch/bin/elasticsearch-plugin install repository-azure

#change the configuration: sudo nano /etc/elasticsearch/es-node-2/elasticsearch.yml cloud.azure.storage.default.account: xxxxxxxxxxx cloud.azure.storage.default.key: xxxxxx

#Restart ES Service: sudo systemctl restart es-node-2_elasticsearch.service

#create Repo: curl -XPUT 'http://localhost:9200/_snapshot/azurebackup' -H 'Content-Type: application/json' -d '{ "type": "azure", "settings": { "container": "elasticsearch-snapshots", "base_path": "sunbirddevtele"} }'

#Delete unwanted indices curl -XDELETE http://localhost:9200/_all

#Restore from snapshot curl -XPOST 'http://localhost:9200/_snapshot/azurebackup/snapshot_1/_restore'

Clone this wiki locally