Skip to content

Instantly share code, notes, and snippets.

@nik9000
Last active December 19, 2015 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nik9000/6028478 to your computer and use it in GitHub Desktop.
Save nik9000/6028478 to your computer and use it in GitHub Desktop.
Can't reopen index if you closed it without enough nodes to host half the lucene indexes in each shard
# Launch two nodes
curl -XDELETE "http://localhost:9200/test_close?pretty=true"
# Create more replicas then we have nodes
curl -XPOST "http://localhost:9200/test_close?pretty=true" -d '{
"settings": {
"number_of_shards": 5,
"number_of_replicas": 3
}
}'
# Wait until all the shards that are going to allocate have allocated
sleep 5
curl -XGET "http://localhost:9200/_cluster/health?pretty=true"
# Close the index
curl -XPOST "http://localhost:9200/test_close/_close?pretty=true"
# Wait a bit and open it
sleep 2
curl -XPOST "http://localhost:9200/test_close/_open?pretty=true"
watch -d curl -s -XGET "http://localhost:9200/_cluster/health?pretty=true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment