How to create user in Shard server

Hi @sree_hari1,

There are two scopes of user authentication:

  • Sharded cluster users that you create via mongos and use for all data access. This user information is saved in the sharded cluster config servers.

  • Shard Local Users that can be used to connect directly to a shard mongod for maintenance operations.

Per the Sharded Cluster Users documentation:

These shard local users are completely independent from the users added to the sharded cluster via mongos . Shard local users are local to the shard and are inaccessible by mongos .

Direct connections to a shard should only be for shard-specific maintenance and configuration. In general, clients should connect to the sharded cluster through the mongos .

Regards,
Stennie