Connecting to a secondary won't allow me to shutdownServer

I’m trying to use in admin

db.shutdownServer() on a SECONDARY node, but it gives me back an error message saying that there are no users authenticated.

I did wrote rs.slaveOk() at the beginning, yet it doesn’t allow me to shut it down.

Any ideas?

Thank you.

“There are no users authenticated” means that you have to login with username/password just like you did in Chapter 1 labs.

But I didn’t made a user on this MongoD instance. I just ran it and connected it to the Replica Set on the primary.

It shouldn’t have a user.

Let’s see a screenshot. Plus you have authentication enabled.


The purpose of a replica set is to replicate the data, users included.


Ok I didn’t know that but it makes sense.

Thank you!


Please read our documentation on replication.

~ Shubham