Skip to content

Instantly share code, notes, and snippets.

@outoftime
Created March 6, 2012 17:00
Show Gist options
  • Save outoftime/1987485 to your computer and use it in GitHub Desktop.
Save outoftime/1987485 to your computer and use it in GitHub Desktop.
Reduction: error when attempting to re-map alias that points to read-only index
curl -XDELETE http://localhost:9200/test1?pretty=true
echo ''
curl -XDELETE http://localhost:9200/test2?pretty=true
echo ''
curl -XPUT http://localhost:9200/test1?pretty=true -d '{}'
echo ''
curl -XPOST http://localhost:9200/_aliases?pretty=true -d '{"actions":[{"add":{"index":"test1","alias":"test"}}]}'
echo ''
curl -XPUT http://localhost:9200/test2?pretty=true -d '{}'
echo ''
curl -XPUT http://localhost:9200/test1/_settings?pretty=true -d '{"index":{"blocks":{"read_only":true}}}'
echo ''
curl -XPOST http://localhost:9200/_aliases?pretty=true -d '{"actions":[{"remove":{"index":"test1","alias":"test"}},{"add":{"index":"test2","alias":"test"}}]}'
echo ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment