# Disable cluster setting: xpack.monitoring.enabled

**URL:** <https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505>\
**Category:** Elasticsearch\
**Created:** [April 4, 2020, 10:04am UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505 "2020-04-04T10:04:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Itay\_Bittan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itay_bittan/32/23527_2.png) [@Itay\_Bittan](https://discuss.elastic.co/u/Itay_Bittan)\
**Post date:** [April 4, 2020, 10:04am UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/1 "2020-04-04T10:04:31Z")

</div>

Setup: Elasticsearch 6.3.0 with 19 nodes:

12 data nodes  
4 client nodes  
3 master nodes

We have around:

Cluster size: ~820GB (~175GB of them are .monitoring indices)  
1,030,000,000 documents in the cluster (900,000,000 are in .monitoring documents)  
7,100 indices (7 of them are .monitoring indices)  
24,300 shards (14 of them are .monitoring shards)  
`xpack.monitoring.enabled` os set to true (default).  
Also my `xpack.monitoring.collection.enabled` is set to true (historically, I used Kibana to monitor but I'm not using it anymore).  
I am not using those indices and I want to set them both to false.

Both settings are static and raise the following questions:

- Every node contains elasticsearch.yml file. Which one is in charge of the cluster global settings? - will change the master node settings is enough?
- Is it safe to do it "one node at a time"? this is a production cluster and I can't afford downtime.
- Which one of those flags is responsible for this high document rate?

Thanks,  
Itay

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 6, 2020, 1:56pm UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/2 "2020-04-06T13:56:44Z")

</div>

That setting is a so called dynamic setting, which means it can be changed at runtime using the [Cluster Update Settings API](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/cluster-update-settings.html).

This way you can prevent changing the setting on every node and restarting (you still may want to change the configuration file in your VCS after running that change, just for clarity, however the persistent cluster state will always take precedence, even in a full cluster restart).

---

<div class="post-metadata">

**Author:** ![Itay\_Bittan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itay_bittan/32/23527_2.png) [@Itay\_Bittan](https://discuss.elastic.co/u/Itay_Bittan)\
**Post date:** [April 6, 2020, 6:34pm UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/3 "2020-04-06T18:34:29Z")

</div>

Hi @spinscale,

Thanks for your reply.  
Not sure how I missed that `xpack.monitoring.collection.enabled` is dynamic!  
Are you sure about `xpack.monitoring.enabled`?  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/monitoring-settings.html#general-monitoring-settings](https://www.elastic.co/guide/en/elasticsearch/reference/current/monitoring-settings.html#general-monitoring-settings)  
I don't see that it's dynamic settings and in `cerebro` it's mentioned as static settings:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/2/62517124d65cfa3c35865feedaac33f06d07d029.png)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 6, 2020, 8:38pm UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/4 "2020-04-06T20:38:37Z")

</div>

> [@Itay\_Bittan](#):
>
> 24,300 shards (14 of them are .monitoring shards)

Side note - That's wwwwwwaaaaaaayyyyyy too many. You really need to look at reducing that count.

---

<div class="post-metadata">

**Author:** ![Itay\_Bittan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itay_bittan/32/23527_2.png) [@Itay\_Bittan](https://discuss.elastic.co/u/Itay_Bittan)\
**Post date:** [April 7, 2020, 4:55am UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/5 "2020-04-07T04:55:28Z")

</div>

Noted, will do. Thanks @warkolm

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 7, 2020, 1:46pm UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/6 "2020-04-07T13:46:45Z")

</div>

That setting is not dynamic - but does it matter, when the collection can be disabled? I mean, you can just wait for the next node restart then, I would assume and disable the setting in that case?

---

<div class="post-metadata">

**Author:** ![Itay\_Bittan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itay_bittan/32/23527_2.png) [@Itay\_Bittan](https://discuss.elastic.co/u/Itay_Bittan)\
**Post date:** [April 7, 2020, 2:38pm UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/7 "2020-04-07T14:38:41Z")

</div>

I already disabled `xpack.monitoring.collection.enabled` thanks to your advice (I thought it static).  
Now I'm trying to understand how to disable `xpack.monitoring.enabled`.  
If the current value (in elasticsearch.yml) of `xpack.monitoring.enabled` is true and I'll change it in one single arbitrary instance (I will edit the elasticsearch.yml and set this value to false). Will it apply to the entire cluster?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 7, 2020, 2:41pm UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/8 "2020-04-07T14:41:53Z")

</div>

no, it will apply to each node and not be applied via cluster state. basically setting that setting to `false` will not start the internal collector services (not even instantiate the classes) or register any monitoring specific REST actions (things that are all done before any network connectivity is happening).

hope that helps.

---

<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:** [May 5, 2020, 2:54pm UTC](https://discuss.elastic.co/t/disable-cluster-setting-xpack-monitoring-enabled/226505/9 "2020-05-05T14:54:05Z")

</div>

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