Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jhidalgo3/38fce604cb55ece1844967d7397ddc60 to your computer and use it in GitHub Desktop.
Save jhidalgo3/38fce604cb55ece1844967d7397ddc60 to your computer and use it in GitHub Desktop.
elasticsearch reindex from remote host example
# show indices on this host
curl 'localhost:9200/_cat/indices?v'
# edit elasticsearch configuration file to allow remote indexing
sudo vi /etc/elasticsearch/elasticsearch.yml
## copy the line below somewhere in the file
>>>
# --- whitelist for remote indexing ---
reindex.remote.whitelist: my-remote-machine.my-domain.com:9200
<<<
# restart elaticsearch service
sudo systemctl restart elasticsearch
# run reindex from remote machine to copy the index named filebeat-2016.12.01
curl -XPOST 127.0.0.1:9200/_reindex?pretty -d'{
"source": {
"remote": {
"host": "http://my-remote-machine.my-domain.com:9200"
},
"index": "filebeat-2016.12.01"
},
"dest": {
"index": "filebeat-2016.12.01"
}
}'
# verify index has been copied
curl 'localhost:9200/_cat/indices?v'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment