Type to search.

Allow Elasticsearch to allocate the data in the system

Stack

The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.

Availability

  • Generally available

    This functionality is generally available and ready for production usage.

Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.

This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.

The allocation of data in an Elasticsearch deployment can be controlled using the enable cluster allocation configuration. In certain circumstances users might want to temporarily disable or restrict the allocation of data in the system.

Forgetting to re-allow all data allocations can lead to unassigned shards.

To get the shards assigned we need to change the value of the configuration that restricts the assignment of the shards to allow all shards to be allocated.

We achieve this by inspecting the system-wide cluster.routing.allocation.enable cluster setting and changing the configured value to all.

To allow all data to be allocated, follow these steps.

You can run the following steps using either API console or direct Elasticsearch API calls.

  1. Inspect the cluster.routing.allocation.enable cluster setting:

    JSON
    GET /_cluster/settings?flat_settings

    The response will look like this:

    JSON
    {
      "persistent": {
        "cluster.routing.allocation.enable": "none"
      },
      "transient": {}
    }
    
    1. Represents the current configured value that controls if data is partially or fully allowed to be allocated in the system.
  2. Change the configuration value to allow all the data in the system to be fully allocated:

    JSON
    PUT _cluster/settings
    {
      "persistent" : {
        "cluster.routing.allocation.enable" : "all"
      }
    }
    1. The new value for the allocation.enable system-wide configuration is changed to allow all the shards to be allocated.