How to allocate node to index shards

Hello Team,

Can we allocate particular node and to an index so all the shards created for that index would get created to the defined node.
I read about reroute API but could not find allocation option. can we define this in index setting.
Is there different option available to handle this if index exist and index does not exist.

Thank you,

Hi @adityaPsl

you could use index shard allocation here. See the documentation for it here.

index.routing.allocation.include. _name set to the node's name you want to force the index onto should do the trick in your case.

Hello Armin_Braun,
Thank you for your reply. I think this will work when index is not available or before creating the index. But if index is already created then do we have to use reroute api to move the existing data to the specific node? along with this setting?

Thank you,

No problem @adityaPsl

I think just updating the setting on an existing index should be enough. Unless the setting conflicts with any other routing constraints in your cluster it should be applied and result in shard relocations without a manual reroute.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.