Can you give some more information about how this happens? So you create a
new index, insert ~100K docs to it, and when you're done you delete the old
index?
I have a python script that uses the elasticsearch REST api. First creates
the index with a unique name then uses the _bulk call to index documents
(400 max per call). When the process finishes if it was successful it uses
the elasticsearch atomic actions operation to remove the alias from the old
version of the index and give the alias to the new version of the index.
lastly it deletes the old index.
Do you see any clues in the logs when shards aren't assigned?
I don't see anything in the logs as to why it is not being assigned. On one
node I see "[acindex_1357639208] creating index, cause [api], shards
[1]/[3], mappings [entry]" however I don't see anything else from any of
the other nodes
Do you have any non-default settings to your cluster? Expecially around
index creation (dynamic index creation, templates, custom mappings...), and
around shard allocation and indexing (routing, allocation limits, etc)?
When I create the index I use the following settings. Where edgeAnalyzer is
a custom edgeNGram analyzer. No other suspicious settings are being used
"settings": {
"number_of_shards": number_of_shards,
"number_of_replicas": number_of_replicas,
"analysis": self.__get_analyzer()
},
"mappings":{
'entry': {
'_boost': { 'name': '_boost', 'null_value': .0001 },
'_id' : { 'index': 'not_analyzed', 'store': 'no' },
'index_analyzer': "standard",
'search_analyzer': "standard",
'properties':{
'symbol': {
'type':'string',
'index': 'analyzed',
'index_analyzer': "edgeAnalyzer",
'search_analyzer': "whitespace"
},
'ticker': {
'type':'string',
'index': 'analyzed',
'index_analyzer': "edgeAnalyzer",
'search_analyzer': "whitespace"
},
'name': {
'type':'string',
'index': 'analyzed',
'index_analyzer': "edgeAnalyzer",
'search_analyzer': "whitespace"
},
'privilege':{
'type' :'string',
'include_in_all': False,
'index': 'not_analyzed'
}
}
}
}
}
On Tuesday, January 8, 2013 5:23:34 PM UTC-5, Keith L wrote:
I have a job that creates a new version on an index every morning then
deletes the old version of the index when it is done. About 3/7 days per
week this job fails. What I am observing is that sometimes when trying to
create the new index shards are either not being assigned at all or taking
a long time to be assigned (around 10 minutes).
The index is small (~100k entries) and cluster setup is really simple.
There are 4 data nodes in the cluster and the index is 1 shard with 3
replicas. So there should be one primary shard and one replica on each of
the rest of the 3 remaining nodes in the cluster.
Any insight on why this is happening would be greatly appreciated. Thanks!
--