aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-06-06 15:21:19 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-06-06 15:21:19 -0700
commit90bd77ec0fca0031cf9b099d39925896da3c3fa2 (patch)
tree7efe497a503e5837ed9bcaf7d3f0934b0ef3f539
parent0ea9489c8c9ec6ef7b7b33747d36cc7ae9df9b0b (diff)
downloadfatcat-90bd77ec0fca0031cf9b099d39925896da3c3fa2.tar.gz
fatcat-90bd77ec0fca0031cf9b099d39925896da3c3fa2.zip
elasticsearch index alias howto
-rw-r--r--extra/elasticsearch/README.md17
1 files changed, 16 insertions, 1 deletions
diff --git a/extra/elasticsearch/README.md b/extra/elasticsearch/README.md
index 60469250..3a48a178 100644
--- a/extra/elasticsearch/README.md
+++ b/extra/elasticsearch/README.md
@@ -69,7 +69,22 @@ a new index and then cut over with no downtime.
http put :9200/fatcat_release_v03 < release_schema.json
-TODO: more docs for actual cut-over
+To replace a "real" index with an alias pointer, do two actions (not truely
+zero-downtime, but pretty fast):
+
+ http delete :9200/fatcat_release
+ http put :9200/fatcat_release_v03/_alias/fatcat_release
+
+To do an atomic swap from one alias to a new one ("zero downtime"):
+
+ http post :9200/_aliases << EOF
+ {
+ "actions": [
+ { "remove": { "index": "fatcat_release_v03", "alias": "fatcat_release" }},
+ { "add": { "index": "fatcat_release_v04", "alias": "fatcat_release" }}
+ ]
+ }
+ EOF
## Full-Text Querying