> For the complete documentation index, see [llms.txt](https://docs.elastiflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.elastiflow.com/additional-resources-reference-articles/faq/elasticsearch-opensearch-cluster-in-yellow-state.md).

# Elasticsearch / OpenSearch cluster in yellow state

## Background

A yellow health status indicates that at least one replica shard cannot be allocated in the cluster.  All primary shards will be allocated, so all data is available in this state, but data availability is at risk if a node goes down.

The health status of the cluster can be checked with the following API call:

```
GET /_cluster/health
```

## Troubleshooting and resolving a yellow health status

If the status is yellow, you can use the following API call to get information on why a shard is unallocated:

```
GET /_cluster/allocation/explain
```

The allocation explain API without a body will return information on the first unallocated shard it finds.  If you need to find details for a specific shard, you will need to include the shard information in the request body.  For further details, please see the API documentation.

* Elasticsearch:  <https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain>
* OpenSearch:  <https://docs.opensearch.org/latest/api-reference/cluster-api/cluster-allocation/>

There are many possible causes for shards being unallocated, so you will need to take action tailored to the reason listed in the allocation explain API output.

## Single node clusters

Replica shards cannot allocate to the same node that the primary shard resides on, so a single node setup with replicas enabled will always be in a yellow state.

For a single node cluster, replicas must be set to 0 on all indices to achieve a green status.  First, the replicas should be set to 0 in the flow collector configuration with the following settings:

* Elasticsearch:  EF\_OUTPUT\_ELASTICSEARCH\_INDEX\_TEMPLATE\_REPLICAS
* OpenSearch:  EF\_OUTPUT\_OPENSEARCH\_INDEX\_TEMPLATE\_REPLICAS

This will cause any new indices to be created with 0 replicas.  Then, the replicas for existing indices will need to be updated to 0.  For example, to change the replicas for all flow indices using codex:

```
PUT /elastiflow-flow-codex-2.5-rollover-*
{
  "settings": {
    "number_of_replicas": 0
  }
}
```

The `elastiflow-flow-codex-2.5-rollover-*` index name can be updated as needed.  Wildcards are allowed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.elastiflow.com/additional-resources-reference-articles/faq/elasticsearch-opensearch-cluster-in-yellow-state.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
