Allow Elasticsearch to allocate the data in the system
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.
In order to (re)allow all data to be allocated follow these steps:
In order to get the shards assigned we’ll need to change the value of the configuration that restricts the assignemnt of the shards to allow all shards to be allocated.
We’ll achieve this by inspecting the system-wide cluster.routing.allocation.enable cluster setting and changing the configured value to all.
Use Kibana
- Log in to the Elastic Cloud console.
-
On the Elasticsearch Service panel, click the name of your deployment.
If the name of your deployment is disabled your Kibana instances might be unhealthy, in which case please contact Elastic Support. If your deployment doesn’t include Kibana, all you need to do is enable it first.
-
Open your deployment’s side navigation menu (placed under the Elastic logo in the upper left corner) and go to Dev Tools > Console.
-
Inspect the
cluster.routing.allocation.enablecluster setting:resp = client.cluster.get_settings( flat_settings=True, ) print(resp)response = client.cluster.get_settings( flat_settings: true ) puts response
const response = await client.cluster.getSettings({ flat_settings: "true", }); console.log(response);GET /_cluster/settings?flat_settings
The response will look like this:
{ "persistent": { "cluster.routing.allocation.enable": "none" }, "transient": {} }Represents the current configured value that controls if data is partially or fully allowed to be allocated in the system.
-
Change the configuration value to allow all the data in the system to be fully allocated:
resp = client.cluster.put_settings( persistent={ "cluster.routing.allocation.enable": "all" }, ) print(resp)response = client.cluster.put_settings( body: { persistent: { 'cluster.routing.allocation.enable' => 'all' } } ) puts responseconst response = await client.cluster.putSettings({ persistent: { "cluster.routing.allocation.enable": "all", }, }); console.log(response);PUT _cluster/settings { "persistent" : { "cluster.routing.allocation.enable" : "all" } }The new value for the
allocation.enablesystem-wide configuration is changed to allow all the shards to be allocated.
In order to get the shards assigned we’ll need to change the value of the configuration that restricts the assignemnt of the shards to allow all shards to be allocated.
We’ll achieve this by inspecting the system-wide cluster.routing.allocation.enable cluster setting and changing the configured value to all.
-
Inspect the
cluster.routing.allocation.enablecluster setting:resp = client.cluster.get_settings( flat_settings=True, ) print(resp)response = client.cluster.get_settings( flat_settings: true ) puts response
const response = await client.cluster.getSettings({ flat_settings: "true", }); console.log(response);GET /_cluster/settings?flat_settings
The response will look like this:
{ "persistent": { "cluster.routing.allocation.enable": "none" }, "transient": {} }Represents the current configured value that controls if data is partially or fully allowed to be allocated in the system.
-
Change the configuration value to allow all the data in the system to be fully allocated:
resp = client.cluster.put_settings( persistent={ "cluster.routing.allocation.enable": "all" }, ) print(resp)response = client.cluster.put_settings( body: { persistent: { 'cluster.routing.allocation.enable' => 'all' } } ) puts responseconst response = await client.cluster.putSettings({ persistent: { "cluster.routing.allocation.enable": "all", }, }); console.log(response);PUT _cluster/settings { "persistent" : { "cluster.routing.allocation.enable" : "all" } }The new value for the
allocation.enablesystem-wide configuration is changed to allow all the shards to be allocated.
© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/allow-all-cluster-allocation.html