# Frequent shards failure remediation

**URL:** <https://discuss.elastic.co/t/frequent-shards-failure-remediation/358746>\
**Category:** Elasticsearch\
**Created:** [May 4, 2024, 7:38pm UTC](https://discuss.elastic.co/t/frequent-shards-failure-remediation/358746 "2024-05-04T19:38:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jhankar\_jha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jhankar_jha/32/134127_2.png) [@Jhankar\_jha](https://discuss.elastic.co/u/Jhankar_jha)\
**Post date:** [May 4, 2024, 7:38pm UTC](https://discuss.elastic.co/t/frequent-shards-failure-remediation/358746/1 "2024-05-04T19:38:24Z")

</div>

Hii Folks,  
Does anyone can help if there exists an api command to get the number of used, unused and total shards of my elasticsearch cluster?  
Additionally, How can i increase the total number of shards of my multi node elasticsearch cluster.

Any suggestions on this would be very helpful.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 6, 2024, 4:37am UTC](https://discuss.elastic.co/t/frequent-shards-failure-remediation/358746/2 "2024-05-06T04:37:54Z")

</div>

What is the problem you are trying to solve? Why are the shards failing? It would help if you could elaborate and describe the issue in detail.

There is also some additional information that is generally useful:

- Which version of Elasticsearch are you using?
- What is the full output of the [cluster stats API](https://www.elastic.co/guide/en/elasticsearch/reference/8.13/cluster-stats.html)?
- What is the hardware specification of the cluster? What type of storage are you using?

---

<div class="post-metadata">

**Author:** ![Jhankar\_jha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jhankar_jha/32/134127_2.png) [@Jhankar\_jha](https://discuss.elastic.co/u/Jhankar_jha)\
**Post date:** [May 6, 2024, 6:46am UTC](https://discuss.elastic.co/t/frequent-shards-failure-remediation/358746/3 "2024-05-06T06:46:16Z")

</div>

My shards are getting filled very often, so i wanted to add one more node to my three-node cluster Elasticsearch to increase the number of shards. Currently I have three nodes all three are assigned to be master as well as data node. Please let me know if adding one more node will be a good approach to get the number of shards increased and so that my shards doesn't gets full too quickly bringing down the cluster. If there is any better approach which we can try, then please share it with me. Also, before increasing the shards i wanted to know the used and the unused shards count for the current cluster. Is there any Api to get this output?

---

<div class="post-metadata">

**Author:** ![Jhankar\_jha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jhankar_jha/32/134127_2.png) [@Jhankar\_jha](https://discuss.elastic.co/u/Jhankar_jha)\
**Post date:** [May 6, 2024, 9:58am UTC](https://discuss.elastic.co/t/frequent-shards-failure-remediation/358746/4 "2024-05-06T09:58:22Z")

</div>

#! Elasticsearch built-in security features are not enabled. Without authentication, your cluster could be accessible to anyone. See [Set up minimal security for Elasticsearch | Elasticsearch Guide [7.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.16/security-minimal-setup.html) to enable security.  
{  
"\_nodes" : {  
"total" : 3,  
"successful" : 3,  
"failed" : 0  
},  
"cluster\_name" : "elk-cluster-production",  
"cluster\_uuid" : "XXXXXXXXXXXXX",  
"timestamp" : 1714983938071,  
"status" : "green",  
"indices" : {  
"count" : 1552,  
"shards" : {  
"total" : 3104,  
"primaries" : 1552,  
"replication" : 1.0,  
"index" : {  
"shards" : {  
"min" : 2,  
"max" : 2,  
"avg" : 2.0  
},  
"primaries" : {  
"min" : 1,  
"max" : 1,  
"avg" : 1.0  
},  
"replication" : {  
"min" : 1.0,  
"max" : 1.0,  
"avg" : 1.0  
}  
}  
},  
"docs" : {  
"count" : 729063463,  
"deleted" : 464693  
},  
"store" : {  
"size\_in\_bytes" : 552320981936,  
"total\_data\_set\_size\_in\_bytes" : 552320981936,  
"reserved\_in\_bytes" : 0  
},  
"fielddata" : {  
"memory\_size\_in\_bytes" : 1775336,  
"evictions" : 0  
},  
"query\_cache" : {  
"memory\_size\_in\_bytes" : 8767640,  
"total\_count" : 154169445,  
"hit\_count" : 5443782,  
"miss\_count" : 148725663,  
"cache\_size" : 66,  
"cache\_count" : 117167,  
"evictions" : 117101  
},  
"completion" : {  
"size\_in\_bytes" : 0  
},  
"segments" : {  
"count" : 23513,  
"memory\_in\_bytes" : 211416880,  
"terms\_memory\_in\_bytes" : 159837328,  
"stored\_fields\_memory\_in\_bytes" : 13902232,  
"term\_vectors\_memory\_in\_bytes" : 0,  
"norms\_memory\_in\_bytes" : 18654656,  
"points\_memory\_in\_bytes" : 0,  
"doc\_values\_memory\_in\_bytes" : 19022664,  
"index\_writer\_memory\_in\_bytes" : 845634784,  
"version\_map\_memory\_in\_bytes" : 7376535,  
"fixed\_bit\_set\_memory\_in\_bytes" : 118083096,  
"max\_unsafe\_auto\_id\_timestamp" : 1714971640400,  
"file\_sizes" : { }  
},  
"mappings" : {  
"field\_types" : [  
{  
"name" : "alias",  
"count" : 666,  
"index\_count" : 48,  
"script\_count" : 0  
},  
{  
"name" : "boolean",  
"count" : 6150,  
"index\_count" : 52,  
"script\_count" : 0  
},  
{  
"name" : "constant\_keyword",  
"count" : 297,  
"index\_count" : 99,  
"script\_count" : 0  
},  
{  
"name" : "date",  
"count" : 11652,  
"index\_count" : 1540,  
"script\_count" : 0  
},  
{  
"name" : "double",  
"count" : 1988,  
"index\_count" : 48,  
"script\_count" : 0  
},  
{  
"name" : "flattened",  
"count" : 2016,  
"index\_count" : 46,  
"script\_count" : 0  
},  
{  
"name" : "float",  
"count" : 3736,  
"index\_count" : 981,  
"script\_count" : 0  
},  
{  
"name" : "geo\_point",  
"count" : 474,  
"index\_count" : 48,  
"script\_count" : 0  
},  
{  
"name" : "ip",  
"count" : 7909,  
"index\_count" : 101,  
"script\_count" : 0  
},  
{  
"name" : "keyword",  
"count" : 237609,  
"index\_count" : 1541,  
"script\_count" : 0  
},  
{  
"name" : "long",  
"count" : 74942,  
"index\_count" : 464,  
"script\_count" : 0  
},  
{  
"name" : "match\_only\_text",  
"count" : 2898,  
"index\_count" : 46,  
"script\_count" : 0  
},  
{  
"name" : "nested",  
"count" : 786,  
"index\_count" : 50,  
"script\_count" : 0  
},  
{  
"name" : "object",  
"count" : 42664,  
"index\_count" : 517,  
"script\_count" : 0  
},  
{  
"name" : "scaled\_float",  
"count" : 88,  
"index\_count" : 46,  
"script\_count" : 0  
},  
{  
"name" : "short",  
"count" : 9346,  
"index\_count" : 48,  
"script\_count" : 0  
},  
{  
"name" : "text",  
"count" : 24586,  
"index\_count" : 1541,  
"script\_count" : 0  
},  
{  
"name" : "version",  
"count" : 4,  
"index\_count" : 4,  
"script\_count" : 0  
},  
{  
"name" : "wildcard",  
"count" : 782,  
"index\_count" : 46,  
"script\_count" : 0  
}  
],  
"runtime\_field\_types" : [  
{  
"name" : "keyword",  
"count" : 3307,  
"index\_count" : 733,  
"scriptless\_count" : 0,  
"shadowed\_count" : 2367,  
"lang" : [  
"painless"  
],  
"lines\_max" : 1,  
"lines\_total" : 3307,  
"chars\_max" : 488,  
"chars\_total" : 916096,  
"source\_max" : 2,  
"source\_total" : 4471,  
"doc\_max" : 1,  
"doc\_total" : 940  
}  
]  
},  
"analysis" : {  
"char\_filter\_types" : ,  
"tokenizer\_types" : ,  
"filter\_types" : ,  
"analyzer\_types" : ,  
"built\_in\_char\_filters" : ,  
"built\_in\_tokenizers" : ,  
"built\_in\_filters" : ,  
"built\_in\_analyzers" :   
},  
"versions" : [  
{  
"version" : "7.16.3",  
"index\_count" : 1552,  
"primary\_shard\_count" : 1552,  
"total\_primary\_bytes" : 276118945897  
}  
]  
},  
"nodes" : {  
"count" : {  
"total" : 3,  
"coordinating\_only" : 0,  
"data" : 3,  
"data\_cold" : 3,  
"data\_content" : 3,  
"data\_frozen" : 3,  
"data\_hot" : 3,  
"data\_warm" : 3,  
"ingest" : 3,  
"master" : 3,  
"ml" : 3,  
"remote\_cluster\_client" : 3,  
"transform" : 3,  
"voting\_only" : 0  
},  
"versions" : [  
"7.16.3"  
],  
"os" : {  
"available\_processors" : 280,  
"allocated\_processors" : 280,  
"names" : [  
{  
"name" : "Linux",  
"count" : 3  
}  
],  
"pretty\_names" : [  
{  
"pretty\_name" : "CentOS Linux 7 (Core)",  
"count" : 3  
}  
],  
"architectures" : [  
{  
"arch" : "amd64",  
"count" : 3  
}  
],  
"mem" : {  
"total\_in\_bytes" : 2975974805504,  
"free\_in\_bytes" : 1485729288192,  
"used\_in\_bytes" : 1490245517312,  
"free\_percent" : 50,  
"used\_percent" : 50  
}  
},  
"process" : {  
"cpu" : {  
"percent" : 0  
},  
"open\_file\_descriptors" : {  
"min" : 7527,  
"max" : 7934,  
"avg" : 7706  
}  
},  
"jvm" : {  
"max\_uptime\_in\_millis" : 3264434007,  
"versions" : [  
{  
"version" : "17.0.1",  
"vm\_name" : "OpenJDK 64-Bit Server VM",  
"vm\_version" : "17.0.1+12",  
"vm\_vendor" : "Eclipse Adoptium",  
"bundled\_jdk" : true,  
"using\_bundled\_jdk" : true,  
"count" : 3  
}  
],  
"mem" : {  
"heap\_used\_in\_bytes" : 20455240400,  
"heap\_max\_in\_bytes" : 96636764160  
},  
"threads" : 1253  
},  
"fs" : {  
"total\_in\_bytes" : 105553116266496,  
"free\_in\_bytes" : 41639504805888,  
"available\_in\_bytes" : 41639504805888  
},  
"plugins" : ,  
"network\_types" : {  
"transport\_types" : {  
"security4" : 3  
},  
"http\_types" : {  
"security4" : 3  
}  
},  
"discovery\_types" : {  
"zen" : 3  
},  
"packaging\_types" : [  
{  
"flavor" : "default",  
"type" : "rpm",  
"count" : 3  
}  
],  
"ingest" : {  
"number\_of\_pipelines" : 6,  
"processor\_stats" : {  
"conditional" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 0  
},  
"date" : {  
"count" : 133432,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 30813  
},  
"geoip" : {  
"count" : 133432,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 5376  
},  
"grok" : {  
"count" : 41655730,  
"failed" : 41388866,  
"current" : 1,  
"time\_in\_millis" : 76074665  
},  
"gsub" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 0  
},  
"remove" : {  
"count" : 133432,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 1013  
},  
"rename" : {  
"count" : 81,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 3  
},  
"script" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 0  
},  
"set" : {  
"count" : 81,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 14  
},  
"uri\_parts" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 0  
},  
"user\_agent" : {  
"count" : 0,  
"failed" : 0,  
"current" : 0,  
"time\_in\_millis" : 0  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![Jhankar\_jha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jhankar_jha/32/134127_2.png) [@Jhankar\_jha](https://discuss.elastic.co/u/Jhankar_jha)\
**Post date:** [May 9, 2024, 3:18pm UTC](https://discuss.elastic.co/t/frequent-shards-failure-remediation/358746/5 "2024-05-09T15:18:17Z")

</div>

Can anyone please suggest
