Search code examples
javaelasticsearchallocationsharding

How disable shard relocation between nodes for one index?


I need that elasticsearch creates index shards once and do not relocates existing shard from nodes untill it receives manual command for that. Is it possible to do that without disabling shard allocation for whole cluster?


Solution

  • Yes, it's called index.routing.allocation.enable and can be run for a single index and it's dynamically updateable:

    PUT /my_index/_settings
    {
        "index" : {
            "routing.allocation.enable" : "none"
        }
    }