# MongoDb Sharded Cluster with PMM2

**URL:** https://forums.percona.com/t/mongodb-sharded-cluster-with-pmm2/7961
**Category:** PMM 2.x
**Created:** [August 27, 2020, 8:24am UTC](https://forums.percona.com/t/mongodb-sharded-cluster-with-pmm2/7961 "2020-08-27T08:24:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![abadird](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/abadird/32/1383_2.png) [@abadird](https://forums.percona.com/u/abadird)
#### Post date: [August 27, 2020, 8:24am UTC](https://forums.percona.com/t/mongodb-sharded-cluster-with-pmm2/7961/1 "2020-08-27T08:24:08Z")

</div>

The mongodb cluster summary dashboard has the “amount of collection in shards” and “size of collections in shards” panels. &nbsp;If I add all the mongos servers to PMM2 the values in those charts is “Duplicate Matches”. &nbsp;We have several mongos servers for redundancy and we’d like them all monitored. &nbsp;Is there a way to have data present in those panels and have all mongos servers added with mongodb exporters? &nbsp;(after adding the first mongos the values are properly populated. &nbsp;After adding additional nodes the values change to “duplicate matches”).

---

<div class="post-metadata">

### Author: ![Akira\_Kurogane](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/akira_kurogane/32/1280_2.png) [@Akira\_Kurogane](https://forums.percona.com/u/Akira_Kurogane)
#### Post date: [September 11, 2020, 4:00am UTC](https://forums.percona.com/t/mongodb-sharded-cluster-with-pmm2/7961/2 "2020-09-11T04:00:37Z")

</div>

Hi.  
  
The point that a cluster might have 1, 2, or hundreds of mongos nodes is a tricky point for architecture of mongodb monitoring. There’s no final solution to this yet. Some people do want them, some people want none, but PMM requires at least 1, even though they add little that couldn’t be done with configsvr mongodb\_exporter nodes alone.  
  
In&nbsp;[[PMM-6361] Failed to execute find query on 'config.chunks' - Percona JIRA](https://jira.percona.com/browse/PMM-6361) it was noticed that the counting of chunks per shard can be very slow if you have a huge number of chunks, and multiplying that by mongodb\_exporter on many mongos nodes (more likely the large the cluster is) just increased the load on the configsvr nodes, which is where the mongos nodes route the aggregation query through to.  
  
So avoiding having a mongodb\_exporter on more than small number of mongos nodes is the best approach (1 or 2 only).  
  
For the issue of&nbsp;PMM-6361 a contributor’s patch recently added a flag (–suppress.collectshardingstatus) to mongodb\_exporter. That will go into v0.11.2 when it is released. Or if you build the master branch as of this commit [fix invalid memory address, added collect.shardingstatus flag (#199) · percona/mongodb\_exporter@af0a25f · GitHub](https://github.com/percona/mongodb_exporter/commit/af0a25f5a8964381c4f06415c945430d1d03815d) it might work already.  
  
Using this&nbsp;–suppress.collectshardingstatus as default for all your mongos node mongodb\_exporters (except 1 or 2 you manually keep as default) would be the second-best solution I think.  
  
New version warning. This information above applies to v0.11\*. Percona is intending to release a significantly updated version (maybe called v0.20) soon and things will change again. The names of metrics and flags will probably change at least.  
  
Akira
