Skip to content

Instantly share code, notes, and snippets.

@nbigot
Last active April 1, 2025 20:06
Show Gist options
  • Select an option

  • Save nbigot/ff57d8fb73fac2de5012d7eed9b20b8f to your computer and use it in GitHub Desktop.

Select an option

Save nbigot/ff57d8fb73fac2de5012d7eed9b20b8f 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'
@Furqanameen
Copy link
Copy Markdown

thanks for sharing some useful commands for elastic search

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment