Loading

Allow Elasticsearch to allocate the index

Stack

The allocation of data can be controlled using the enable allocation configuration. In certain circumstances users might want to temporarily disable or restrict the allocation of data.

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

In order to get the shards assigned we’ll need to change the value of the configuration that restricts the assignment of the shards 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 index.routing.allocation.enable index setting for the index with unassigned shards:

    				GET /my-index-000001/_settings/index.routing.allocation.enable?flat_settings
    		

    The response will look like this:

    {
      "my-index-000001": {
        "settings": {
          "index.routing.allocation.enable": "none"
        }
      }
    }
    		
    1. Represents the current configured value that controls if the index is allowed to be partially or totally allocated.
  2. Change the configuration value to allow the index to be fully allocated:

    				PUT /my-index-000001/_settings
    					{
      "index" : {
        "routing.allocation.enable" : "all"
      }
    }
    		
    1. The new value for the allocation.enable configuration for the my-index-000001 index is changed to allow all the shards to be allocated.