I have a Sharded Cluster and I am trying to access a specific member of a replica set within a shard.
When connecting to the mongos it is fine, but when using the same credentials on a member of the replica set I am unable to gain access even though my user has the role of root.
The error is:
SCRAM-SHA-1 authentication failed for root on admin from client 127.0.0.1:39356 ; UserNotFound: Could not find user root@admin
The mongos are started with:
mongos --configdb cfg/mongo-cfg0:27019,mongo-cfg1:27019,mongo-cfg2:27019 --bind_ip_all --keyFile "/etc/mongodb-keyfile"
The members of the replica set are started with:
mongod --auth --bind_ip_all --shardsvr --replSet a --smallfiles --oplogSize 50 --keyFile "/etc/mongodb-keyfile"
When connecting to the mongos I use the following locally:
mongo --port 27017 -u user -p password --authenticationDatabase admin
When connecting to the memnber of the replica set locally i try and use:
mongo --port 27018 -u user -p password --authenticationDatabase admin
I feel like there is something obvious that I am missing but I can not figure out what, any help would be greatly appreciated.