# Fixing yellow health of cluster due to permission error

**URL:** <https://discuss.elastic.co/t/fixing-yellow-health-of-cluster-due-to-permission-error/221548>\
**Category:** Elasticsearch\
**Created:** [March 1, 2020, 12:29am UTC](https://discuss.elastic.co/t/fixing-yellow-health-of-cluster-due-to-permission-error/221548 "2020-03-01T00:29:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbhaxor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbhaxor/32/63588_2.png) [@tbhaxor](https://discuss.elastic.co/u/tbhaxor)\
**Post date:** [March 1, 2020, 12:29am UTC](https://discuss.elastic.co/t/fixing-yellow-health-of-cluster-due-to-permission-error/221548/1 "2020-03-01T00:29:40Z")

</div>

In my elastic search cluster, some nodes are red while some of them are yellow. The point is only beats indices are affected. So i executed `curl localhost:9200/_cluster/allocation/explain`

The output

```json
{
	"index": "filebeat-7.6.0-2020.02.22",
	"shard": 0,
	"primary": false,
	"current_state": "unassigned",
	"unassigned_info": {
		"reason": "CLUSTER_RECOVERED",
		"at": "2020-02-29T23:19:30.698Z",
		"last_allocation_status": "no_attempt"
	},
	"can_allocate": "no",
	"allocate_explanation": "cannot allocate because allocation is not permitted to any of the nodes",
	"node_allocation_decisions": [
		{
			"node_id": "THJOod5tSUGcF23uhLuKfw",
			"node_name": "node-1",
			"transport_address": "192.168.43.22:9300",
			"node_attributes": {
				"ml.machine_memory": "4136235008",
				"xpack.installed": "true",
				"ml.max_open_jobs": "20"
			},
			"node_decision": "no",
			"deciders": [
				{
					"decider": "same_shard",
					"decision": "NO",
					"explanation": "the shard cannot be allocated to the same node on which a copy of the shard already exists [[filebeat-7.6.0-2020.02.22][0], node[THJOod5tSUGcF23uhLuKfw], [P], s[STARTED], a[id=1jY1u__lRNKYGDibSFoWcg]]"
				}
			]
		}
	]
}

```

Screenshor of some indices

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/d/3d1f3f7d32b71832e076a0bc09af1e1eac4cfef5.png)

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [March 1, 2020, 1:47am UTC](https://discuss.elastic.co/t/fixing-yellow-health-of-cluster-due-to-permission-error/221548/2 "2020-03-01T01:47:29Z")

</div>

@tbhaxor The error from the [cluster allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-allocation-explain.html) is pretty clear. The replica shard for index `filebeat-7.6.0-2020.02.22` cannot be allocated on any nodes. It looks like your cluster is a one-node cluster and in this case the primary shard and its copy (replica shard) cannot be allocated on the same node.

This also explains why some of your indices are green because they do not have any replica shards configured.

Two options to move forward:

- [Add new nodes](https://www.elastic.co/guide/en/elasticsearch/reference/current/add-elasticsearch-nodes.html) in your cluster so that the replica shards can be allocated. This would be the recommended approach.
- Set the `index.number_of_replicas` to `0` for the respective indices. You can use the [update index settings API](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html). We generally recommend **not to do this** because you could be facing data loss if any failures happen with the nodes in your cluster.

I hope that helps.

---

<div class="post-metadata">

**Author:** ![tbhaxor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbhaxor/32/63588_2.png) [@tbhaxor](https://discuss.elastic.co/u/tbhaxor)\
**Post date:** [March 1, 2020, 8:16am UTC](https://discuss.elastic.co/t/fixing-yellow-health-of-cluster-due-to-permission-error/221548/3 "2020-03-01T08:16:38Z")

</div>

Ok so in `X/Y`, the `X` is the number of shards and `Y` is the number of replica sets?

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [March 2, 2020, 9:48am UTC](https://discuss.elastic.co/t/fixing-yellow-health-of-cluster-due-to-permission-error/221548/4 "2020-03-02T09:48:53Z")

</div>

Yes @tbhaxor - that's right.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 30, 2020, 9:48am UTC](https://discuss.elastic.co/t/fixing-yellow-health-of-cluster-due-to-permission-error/221548/5 "2020-03-30T09:48:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
