Last active
November 25, 2022 06:51
-
-
Save nbigot/ff57d8fb73fac2de5012d7eed9b20b8f to your computer and use it in GitHub Desktop.
elasticsearch reindex from remote host example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
thanks for sharing some useful commands for elastic search