Last active
December 7, 2018 10:19
-
-
Save sursir/2119491cb72f36a6f034c931a7653e98 to your computer and use it in GitHub Desktop.
elasticsearch reindex 备份 迁移 migrate
This file contains hidden or 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
| reindex.remote.whitelist: "REMOTE_HOST:9200" |
This file contains hidden or 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
| # username 与 password 是 basic auth | |
| curl -X POST "localhost:9200/_reindex" -H 'Content-Type: application/json' -d' | |
| { | |
| "source": { | |
| "remote": { | |
| "host": "http://192.168.2.1:80/esmigrate", | |
| "username": "USERNAME", | |
| "password": "USERPASS" | |
| }, | |
| "index": "indexname-*" | |
| }, | |
| "dest": { | |
| "index": "indexname" | |
| }, | |
| "script": { | |
| "lang": "painless", | |
| "source": "ctx._index = \"indexname-\" + (ctx._index.substring(\"indexname-\".length(), ctx._index.length())) + \"-1\"" | |
| } | |
| } | |
| ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment