We are testing out various configurations. What we currently have is a one server replica set with a mongod(configsvr) process running on that server. Then we have 2 application servers app1 and app2. App1 has a mongos process running on it. I tried to set up a mongos process on app2, but I cannot get it to work. I am stuck with a permissions issue. I try to run the db.addUser command on app2 and it fails. I then try to run the db.runCommand(
{addShard:"NH_Data_01/t01-vm-nsdb01:27018"}) command on the app2 server and it fails with unauthorized. The whole system is running with a keyFile as well, if that matters. The error code is below.
> use admin
switched to db admin
> db.addUser("Username","Password")
Tue Feb 21 18:30:15 uncaught exception: error
> show users
Tue Feb 21 18:30:26 uncaught exception: error:
> db.auth("Same Username that I tried to add above","Password") – thought that maybe I added it earlier and forgot, not the case...
0
>
> db.runCommand(
)
{ "ok" : 0, "errmsg" : "unauthorized" }>