Last active
December 16, 2015 19:59
-
-
Save Lothiraldan/5488931 to your computer and use it in GitHub Desktop.
Timing issue with aliases and index status
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
{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true} | |
[u'test.1.1'] | |
[u'test.1.1'] | |
{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true} | |
[u'test.1.2'] | |
[u'test.1.2'] | |
{"ok":true,"acknowledged":true}% |
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
curl -XPUT 'http://localhost:9200/test.1.1' | |
curl -XPOST 'http://localhost:9200/_aliases' -d ' | |
{ | |
"actions" : [ | |
{ "add" : { "index" : "test.1.1", "alias" : "test.write" } } | |
] | |
}' | |
curl -XPOST 'http://localhost:9200/_aliases' -d ' | |
{ | |
"actions" : [ | |
{ "add" : { "index" : "test.1.1", "alias" : "test.read" } } | |
] | |
}' | |
curl -XGET 'localhost:9200/test.write/_status' | python -c "import json; import sys; x = json.load(sys.stdin); print x['indices'].keys()" | |
curl -XGET 'localhost:9200/test.read/_status' | python -c "import json; import sys; x = json.load(sys.stdin); print x['indices'].keys()" | |
curl -XPUT 'http://localhost:9200/test.1.2' | |
curl -XPOST 'http://localhost:9200/_aliases' -d ' | |
{ | |
"actions" : [ | |
{ "remove" : { "index" : "test.1.1", "alias" : "test.write" } }, | |
{ "add" : { "index" : "test.1.2", "alias" : "test.write" } } | |
] | |
}' | |
curl -XPOST 'http://localhost:9200/_aliases' -d ' | |
{ | |
"actions" : [ | |
{ "remove" : { "index" : "test.1.1", "alias" : "test.read" } }, | |
{ "add" : { "index" : "test.1.2", "alias" : "test.read" } } | |
] | |
}' | |
curl -XGET 'localhost:9200/test.write/_status' | python -c "import json; import sys; x = json.load(sys.stdin); print x['indices'].keys()" | |
curl -XGET 'localhost:9200/test.read/_status' | python -c "import json; import sys; x = json.load(sys.stdin); print x['indices'].keys()" | |
curl -XDELETE 'http://localhost:9200/_all' |
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
./test_es.sh | |
{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true} | |
[u'test.1.1'] | |
[u'test.1.1'] | |
{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true}{"ok":true,"acknowledged":true} | |
[] | |
[] | |
{"ok":true,"acknowledged":true} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment