# pmm2 for sharded mongodb

**URL:** https://forums.percona.com/t/pmm2-for-sharded-mongodb/8118
**Category:** PMM 2.x
**Tags:** pmm, mongodb
**Created:** [October 8, 2020, 7:23pm UTC](https://forums.percona.com/t/pmm2-for-sharded-mongodb/8118 "2020-10-08T19:23:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![arash\_moosavi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/arash_moosavi/32/4292_2.png) [@arash\_moosavi](https://forums.percona.com/u/arash_moosavi)
#### Post date: [October 8, 2020, 7:23pm UTC](https://forums.percona.com/t/pmm2-for-sharded-mongodb/8118/1 "2020-10-08T19:23:47Z")

</div>

Hi,

I have installed PMM 2.10.1 and Configured cluster of MongoDB 4.4.0 with this structure:

Server1:

mongo-router-01:27017

mongo-config-01:27021

mongo-shard-01-node-a:27018

mongo-shard-01-node-b:27019

mongo-shard-01-node-c:27020

Server2:

mongo-router-02:27017

mongo-config-02:27021

mongo-shard-02-node-a:27018

mongo-shard-02-node-b:27019

mongo-shard-02-node-c:27020

Server3:

mongo-router-03:27017

mongo-config-03:27021

mongo-shard-03-node-a:27018

mongo-shard-03-node-b:27019

mongo-shard-03-node-c:27020

I just added mongo-router-01:27017 to pmm-admin with following command and it is OK:

sudo pmm-admin add mongodb --cluster someMongoCluster --username=mongodb\_exporter --password=SomeStrongPassword

But when I try to add mongo-shard-01-node-a with the following command:

sudo pmm-admin add mongodb --cluster someMongoCluster --replication-set=mongo-shard-01 --username=mongodb\_exporter --password=SomeStrongPassword mongo-shard-01-node-a mongo-shard-01-node-a:27018

Following Error has occurred:

Connection check failed: connection() : auth error: sasl conversation error: unable to authenticate using mechanism “SCRAM-SHA-1”: (AuthenticationFailed) Authentication failed…

l am sure username and password are correct.

What is the problem?

Why Percona has not provide an straightforward get start about fully implementation of PMM 2 for Secured Clustered MongoDB?

---

<div class="post-metadata">

### Author: ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)
#### Post date: [October 9, 2020, 2:51am UTC](https://forums.percona.com/t/pmm2-for-sharded-mongodb/8118/2 "2020-10-09T02:51:25Z")

</div>

Hi Arash,

Could you try the same command but setting the password between single quotes?

… --password=‘SomeStrongPassword’ …

---

<div class="post-metadata">

### Author: ![arash\_moosavi](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/arash_moosavi/32/4292_2.png) [@arash\_moosavi](https://forums.percona.com/u/arash_moosavi)
#### Post date: [October 9, 2020, 2:57am UTC](https://forums.percona.com/t/pmm2-for-sharded-mongodb/8118/3 "2020-10-09T02:57:06Z")

</div>

I tried it, it doesn’t worked.

I don’t have space and any special character in my password. [a-zA-Z0-9]

---

<div class="post-metadata">

### Author: ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)
#### Post date: [October 9, 2020, 5:18am UTC](https://forums.percona.com/t/pmm2-for-sharded-mongodb/8118/4 "2020-10-09T05:18:58Z")

</div>

Are you able connect to the mongod instance by using user mongodb\_exporter?

mongo -u mongodb\_exporter -p ‘s3cR#tpa$$worD’ --port=27018 --host=mongo-shard-01-node-a

 ![Screenshot_20201009_134508.png](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/1X/e82ddca3be7057797a86f1ff90383a9ac35ab62b.png)
