Created
December 3, 2013 19:03
-
-
Save creg/7775457 to your computer and use it in GitHub Desktop.
Repro UnavailableShardsException when number of replicas greater than number of nodes
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
# clean up test index | |
curl -XDELETE "http://localhost:9200/toomanyreplicas" | |
# create index | |
curl -XPOST "http://localhost:9200/toomanyreplicas" -d ' | |
{ | |
"index" : { | |
"analysis" : { | |
"analyzer" : { | |
"language_analyzer" : { | |
"type" : "snowball", | |
"language" : "English" | |
} | |
} | |
}, | |
"number_of_shards": 5, | |
"number_of_replicas": 2 | |
} | |
} | |
' | |
#create mapping | |
curl -XPOST "http://localhost:9200/toomanyreplicas/Document/_mapping" -d ' | |
{ | |
"Document": { | |
"_source": { | |
"compress": false, | |
"excludes": [ | |
"fileAttachment" | |
] | |
}, | |
"properties": { | |
"fileAttachment": { | |
"type": "attachment", | |
"path": "full", | |
"fields": { | |
"fileAttachment": { | |
"type": "string", | |
"term_vector": "with_positions_offsets", | |
"index_analyzer": "language_analyzer", | |
"search_analyzer": "language_analyzer" | |
}, | |
"author": { | |
"type": "string", | |
"store": true | |
}, | |
"title": { | |
"type": "string", | |
"store": true, | |
"index_analyzer": "language_analyzer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"date": { | |
"type": "date", | |
"format": "dateOptionalTime" | |
}, | |
"keywords": { | |
"type": "string" | |
}, | |
"content_type": { | |
"type": "string", | |
"store": true | |
}, | |
"content_length": { | |
"type": "integer" | |
} | |
} | |
}, | |
"id": { | |
"type": "string" | |
}, | |
"currentVersionId": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
' | |
# Attempt to index the document | |
curl -XPOST "http://localhost:9200/toomanyreplicas/testdocument" -d ' | |
{ | |
"fileAttachment" : "ZmlnaHRpbmc=" | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment