I hope my question is clear enough.
I'm setting up a sharded cluster, 3 members, each running as a replica set. So, on each shard there are 3 mongod running as replica sets.
My question is what should be the time during the setup process to create users&roles and on what instance of mongod? I know about the localhost exception on a mongo db deployment, but it's not clear from the documentation what would be the best way to do it in a sharded cluster.
I have the following users:
- useradmin -> able to create new users only -> role userAdminAnyDatabase (to create new users)
- manager -> use to manage the cluster -> role clusterAdmin
- root -> root access/roles -> role root
- appuser -> role readWriteAnyDatabase
So the options I see are:
- On each replica set mongod, using localhost exception, before it's added to the sharded cluster, add all users from above?
- At the end of setup, only once in the config replica set?
- At the end, connecting to the sharded cluster?
- Create initial users only with createUser role on each mongodbs and then create the others connecting at the end to the sharded cluster?
I did using 1st option, but I feel something is not right.