Tag Archives: shards

Reroute API explained

Send to Kindle

routeTill now, we didn’t talk about shard allocation process or ability to move shards around the cluster. If you recall what shard allocation is – the process of allocating shards to nodes which can happen during initial cluster start, during replicas allocation or when nodes are being removed or added to the cluster. However apart from the allocation mechanism control, sometimes it is crucial to be able to cancel shard allocation or move shards around inside the cluster. In order to do that ElasticSearch exposes the reroute API, which allows us to move shards, cancel their allocation and finally force the allocation. You can imagine a situation when you would like to take off a single node from your cluster for maintenance, but you have data on it and first you want to somehow move the data to some other node. This is where the reroute API can come in handy. So now, let’s discuss all the possibilities that give us.

Continue reading

Tagged , , ,

ElasticSearch 0.90 – Search Shards API

Send to Kindle

searchElasticSearch is designed to work with indices that are built of multiple shards and replicas and you probably have such indices in your cluster. Sometimes it may be handy to see which shard will the query be exectued at. Before ElasticSearch 0.90 you could run a query and check the stats to see that, but now we can use the Search Shards API. Let’s look on how we can use this API by using a simple example and queries that does and doesn’t use routing.

Continue reading

Tagged , , ,