﻿---
title: Warning: Not enough nodes to allocate all shard replicas
description: Distributing copies of the data (index shard replicas) on different nodes can parallelize processing requests, speeding up search queries. To achieve...
url: https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4391/troubleshoot/elasticsearch/increase-tier-capacity
products:
  - Elasticsearch
---

# Warning: Not enough nodes to allocate all shard replicas
Distributing copies of the data (index shard replicas) on different nodes can parallelize processing requests, speeding up search queries. To achieve this, increase the number of replica shards up to the maximum value (total number of nodes minus one), which also protects against hardware failure. If the index has a preferred tier, Elasticsearch will only place the copies of the data for that index on nodes in the target tier.
If a warning is encountered with not enough nodes to allocate all shard replicas, you can influence this behavior by adding more nodes to the cluster (or tier), or by reducing the [`index.number_of_replicas`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/elasticsearch/index-settings/index-modules#dynamic-index-number-of-replicas) index setting.
To accomplish this, complete the following steps:
<tab-set>
  <tab-item title="Elastic Cloud Hosted">
    One way to get the replica shards assigned is to add an availability zone. This will increase the number of data nodes in the Elasticsearch cluster so that the replica shards can be assigned. This can be done by editing your deployment. But first you need to discover which tier an index is targeting for assignment. Do this using Kibana.**Use Kibana**
    1. Log in to the [Elastic Cloud console](https://cloud.elastic.co?page=docs&placement=docs-body).
    2. On the **Hosted deployments** panel, click the name of your deployment.
       <note>
       If the name of your deployment is disabled your Kibana instances might be unhealthy, in which case contact [Elastic Support](https://support.elastic.co). If your deployment doesn’t include Kibana, all you need to do is [enable it first](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4391/deploy-manage/deploy/elastic-cloud/access-kibana).
       </note>
    3. Open your deployment’s side navigation menu (placed under the Elastic logo in the upper left corner) and go to **Dev Tools > Console**.
       ![](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4391/troubleshoot/images/elasticsearch-reference-kibana-console.png)
    To inspect which tier an index is targeting for assignment, use the [get index setting](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings) API to retrieve the configured value for the `index.routing.allocation.include._tier_preference` setting:
    ```json
    ```
    The response will look like this:
    ```json
    {
      "my-index-000001": {
        "settings": {
          "index.routing.allocation.include._tier_preference": "data_warm,data_hot" 
        }
      }
    }
    ```
    Now that you know the tier, you want to increase the number of nodes in that tier so that the replicas can be allocated. To do this you can either increase the size per zone to increase the number of nodes in the availability zone(s) you were already using, or increase the number of availability zones. Go back to the deployment’s landing page by clicking on the three horizontal bars on the top left of the screen and choosing **Manage this deployment**. On that page click the **Manage** button, and choose **Edit deployment**. Note that you must be logged in to [https://cloud.elastic.co/](https://cloud.elastic.co/) in order to do this. In the Elasticsearch section, find the tier where the replica shards could not be assigned.
    ![Kibana Console](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4391/troubleshoot/images/elasticsearch-reference-ess-advanced-config-data-tiers.png)

    - Option 1: Increase the size per zone
      - Look at the values in the **Size per zone** drop down. One node is created in each zone for every 64 GB of RAM you select here. If you currently have 64 GB RAM or less selected, you have one node in each zone. If you select 128 GB RAM, you will get 2 nodes per zone. If you select 192 GB RAM, you will get 3 nodes per zone, and so on. If the value is less than the maximum possible, you can choose a higher value for that tier to add more nodes.
    - Option 2: Increase the number of availability zones
      - Find the **Availability zones** selection. If it is less than 3, you can select a higher number of availability zones for that tier.
    If it is not possible to increase the size per zone or the number of availability zones, you can reduce the number of replicas of your index data. We’ll achieve this by inspecting the [`index.number_of_replicas`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/elasticsearch/index-settings/index-modules#dynamic-index-number-of-replicas) index setting index setting and decreasing the configured value.
    1. Access Kibana as described above.
    2. Inspect the [`index.number_of_replicas`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/elasticsearch/index-settings/index-modules#dynamic-index-number-of-replicas) index setting.
       ```json
       ```
       The response will look like this:
       ```json
       {
         "my-index-000001" : {
           "settings" : {
             "index" : {
               "number_of_replicas" : "2" 
             }
           }
         }
       }
       ```
    3. Use the `_cat/nodes` API to find the number of nodes in the target tier:
       ```json
       ```
       The response will look like this, containing one row per node:
       ```json
       himrst
       mv
       himrst
       ```
       You can count the rows containing the letter representing the target tier to know how many nodes you have. See [Query parameters](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodes) for details. The example above has two rows containing `h`, so there are two nodes in the hot tier.
    4. [Decrease](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings) the value for the total number of replica shards required for this index. As replica shards cannot reside on the same node as primary shards for [high availability](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4391/deploy-manage/production-guidance/availability-and-resilience), the new value needs to be less than or equal to the number of nodes found above minus one. Since the example above found 2 nodes in the hot tier, the maximum value for `index.number_of_replicas` is 1.
       ```json

       {
         "index" : {
           "number_of_replicas" : 1 <1>
         }
       }
       ```
  </tab-item>

  <tab-item title="Self-managed">
    In order to get the replica shards assigned you can add more nodes to your Elasticsearch cluster and assign the index’s target tier [node role](/elastic/docs-content/pull/4391/manage-data/lifecycle/index-lifecycle-management/migrate-index-allocation-filters-to-node-roles#assign-data-tier) to the new nodes.To inspect which tier an index is targeting for assignment, use the [get index setting](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings) API to retrieve the configured value for the `index.routing.allocation.include._tier_preference` setting:
    ```json
    ```
    The response will look like this:
    ```json
    {
      "my-index-000001": {
        "settings": {
          "index.routing.allocation.include._tier_preference": "data_warm,data_hot" 
        }
      }
    }
    ```
    Alternatively, if adding more nodes to the Elasticsearch cluster is not desired, inspect the [`index.number_of_replicas`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/elasticsearch/index-settings/index-modules#dynamic-index-number-of-replicas) index setting and decrease the configured value:
    1. Inspect the [`index.number_of_replicas`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/elasticsearch/index-settings/index-modules#dynamic-index-number-of-replicas) index setting for the index with unassigned replica shards:
       ```json
       ```
       The response will look like this:
       ```json
       {
         "my-index-000001" : {
           "settings" : {
             "index" : {
               "number_of_replicas" : "2" 
             }
           }
         }
       }
       ```
    2. Use the `_cat/nodes` API to find the number of nodes in the target tier:
       ```json
       ```
       The response will look like this, containing one row per node:
       ```json
       himrst
       mv
       himrst
       ```
       You can count the rows containing the letter representing the target tier to know how many nodes you have. See [Query parameters](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodes) for details. The example above has two rows containing `h`, so there are two nodes in the hot tier.
    3. [Decrease](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings) the value for the total number of replica shards required for this index. As replica shards cannot reside on the same node as primary shards for [high availability](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4391/deploy-manage/production-guidance/availability-and-resilience), the new value needs to be less than or equal to the number of nodes found above minus one. Since the example above found 2 nodes in the hot tier, the maximum value for `index.number_of_replicas` is 1.
       ```json

       {
         "index" : {
           "number_of_replicas" : 1 <1>
         }
       }
       ```
  </tab-item>
</tab-set>

<admonition title="Simplify monitoring with AutoOps" applies-to="{ ess:, ece:, eck:, self:, "serverless": "ga" }">
  AutoOps is a monitoring tool that simplifies cluster management through performance recommendations, resource utilization visibility, and real-time issue detection with resolution paths. Learn more about [AutoOps](https://docs-v3-preview.elastic.dev/elastic/docs-content/pull/4391/deploy-manage/monitor/autoops).
</admonition>