# How to modify ES cluster and repair when unassigned?

**URL:** <https://discuss.elastic.co/t/how-to-modify-es-cluster-and-repair-when-unassigned/9421>\
**Category:** Elasticsearch\
**Created:** [October 19, 2012, 11:21am UTC](https://discuss.elastic.co/t/how-to-modify-es-cluster-and-repair-when-unassigned/9421 "2012-10-19T11:21:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chenryn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chenryn/32/44917_2.png) [@chenryn](https://discuss.elastic.co/u/chenryn)\
**Post date:** [October 19, 2012, 11:21am UTC](https://discuss.elastic.co/t/how-to-modify-es-cluster-and-repair-when-unassigned/9421/1 "2012-10-19T11:21:04Z")

</div>

Hi all:  
I hava an ES cluster running on two node with ten shards and zero  
replica. Onetime I find my page error and then enter es\_head and find one  
shard was unassigned.  
I check es.log but nothing there. At last I found that ES was error  
three hours ago by grep my webserver.log  
So, is there some scrpt like nagios check\_elasticsearch?  
And, Is there some way to repair my cluster?

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [October 19, 2012, 12:21pm UTC](https://discuss.elastic.co/t/how-to-modify-es-cluster-and-repair-when-unassigned/9421/2 "2012-10-19T12:21:23Z")

</div>

Hello Chenlin,

On Fri, Oct 19, 2012 at 2:21 PM, chenlin rao [rao.chenlin@gmail.com](mailto:rao.chenlin@gmail.com) wrote:

> Hi all:  
> I hava an ES cluster running on two node with ten shards and zero  
> replica. Onetime I find my page error and then enter es\_head and find one  
> shard was unassigned.  
> I check es.log but nothing there. At last I found that ES was error  
> three hours ago by grep my webserver.log  
> So, is there some scrpt like nagios check\_elasticsearch?

Actually, there is one called just like that:

> **[GitHub - orthecreedence/check\_elasticsearch: Nagios script for checking elasticsearch sluter...](https://github.com/orthecreedence/check_elasticsearch)**
>
> Nagios script for checking elasticsearch sluter status

Or you can try to use check\_http or check\_http\_json with the Cluster Health API:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

and grep for "green" in the result, as suggested here:

> <https://stackoverflow.com/questions/10276989/how-to-monitor-elasticsearch-using-nagios>

I also wrote a couple of ES checks here:

> **[GitHub - radu-gheorghe/check-es: Nagios/Shinken plugins for Elasticsearch](https://github.com/radu-gheorghe/check-es)**
>
> Nagios/Shinken plugins for Elasticsearch

They report the total number of documents and the total number of  
inserts/sec between checks.

And if you want a more complete monitoring solution for your ES, I'd  
suggest you look at SPM for Elasticsearch:

> **[Elasticsearch - Sematext Documentation](https://sematext.com/docs/integration/elasticsearch-integration/)**
>
> Collect and monitor key Elasticsearch metrics such as request latency, indexing rate, and segment merges with built-in anomaly detection, threshold, and heartbeat alerts. Send notifications to email and various chatops messaging services, correlate...

> ```
> And, Is there some way to repair my cluster?
> 
> ```

It's strange that you don't get anything in the logs. I'd try to  
increase the logging verbosity (if you installed from the Debian  
package that should be in /etc/elasticsearch/logging.yml), then  
restart the node with the unassigned shard and see what the logs say  
then regarding that shard.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--

---

<div class="post-metadata">

**Author:** ![Daniel\_Maher\_3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel_maher_3/32/2014_2.png) [@Daniel\_Maher\_3](https://discuss.elastic.co/u/Daniel_Maher_3)\
**Post date:** [October 25, 2012, 4:08pm UTC](https://discuss.elastic.co/t/how-to-modify-es-cluster-and-repair-when-unassigned/9421/3 "2012-10-25T16:08:56Z")

</div>

On 12-10-19 2:21 PM, Radu Gheorghe wrote:

> Or you can try to use check\_http or check\_http\_json with the Cluster Health API:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-cluster-health.html)

I highly recommend check\_http\_json, mostly because I wrote it for this  
exact purpose (monitoring Elasticsearch). 🙂 The big selling point is  
that it can easily drill down into nested JSON structures and can be  
used to monitor totally arbitrary values.

> **[GitHub - phrawzty/check\_http\_json: Nagios plugin to parse JSON from an HTTP...](https://github.com/phrawzty/check_http_json)**
>
> Nagios plugin to parse JSON from an HTTP response. - GitHub - phrawzty/check\_http\_json: Nagios plugin to parse JSON from an HTTP response.

Enjoy !

--  
dan (phrawzty).  
mozilla webops; european outpost.

--

---

<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:** [July 6, 2017, 3:07am UTC](https://discuss.elastic.co/t/how-to-modify-es-cluster-and-repair-when-unassigned/9421/4 "2017-07-06T03:07:11Z")

</div>


