简体   繁体   中英

MongoDB Error: “not authorized for query on admin.system.users”

How to setup authentication on MongoDB using the following configuration ?

2 mongoD instances, sharded collections.
1 mongoS instance on another server.
1 mongoD as a config server.

Whenever a turn on auth on mongod, i'm not enabled to logon on any servers, the users are created but i still can't login. The following error appear when trying to logon on mongoS instance:

If you have a problem like I had it is likely that you could not query anything (with similar messages that you are not authorized).

By accident I noticed if I run two different versions of mongo daemon (win7/ent) second daemon starts but does not care if other mongo is listening, so it is unclear which daemon takes requests.

When I stopped all daemons and started one, everything started working. (for me)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM