Elasticsearch index placement on specific nodes

Hi all,

I know that we can set 'cluster.routing.allocation.awareness.attributes' to route shards and replicas based on this configuration. However, I need a configuration where indices created with a specific template, say with name test_index_<date>, and its replicas be allocated to only a specific set of nodes and not on others.

For example, if i have node1-node5 in a cluster, I want the shards replicas of test_index_<date> to be only allocated to node4 and node5. Is this possible?

You can place all shards belonging to an index on a specific set of nodes through shard allocation filtering but you can not control where primaries or replicas within an index go.

What is the high level problem you are trying to solve?

1 Like

We have some indices, say index_type1 that get queries from automation and sometimes faulty automation or excessive querying result in huge resource usage on the nodes where these indices are allocated.

We also have some other indices, say index_type2, that another application uses for searching from UI. We want to avoid the impact of above mentioned automation and related problems on the UI searches. So if we could have them on separate nodes, I think it would limit the problem to only the automation related indices.

You can use the shard allocation filtering I linked to to designate some nodes as zone1 and other nodes as zone2. You can then place indices (primaries and replicas) in one of these zones and that way ensure they do not overlap and affect eachother.

1 Like

Great this sounds like the right solution for us. Sometimes its difficult to find the right solution in a sea of different features and documentation we have. Appreciate all your inputs :handshake: