[英]MongoDB authentication in a cluster
I managed to configure a MongoDB cluster with authentication. 我设法通过身份验证配置了MongoDB集群。 By that I mean I activated the authorization: enabled on all mongod in my data replica set and on all mongod in the configuration replica set using the localhost exception mechanism.
我的意思是说,我激活了授权:使用本地主机异常机制对数据副本集中的所有mongod和配置副本集中的所有mongod 启用了授权 。 My problem is with mongos now.
我的问题是现在的蒙哥斯 。 When I start a mongos instance I have several errors regarding authentication like these ones:
当我启动mongos实例时,我会遇到一些关于身份验证的错误,例如:
[replSetDistLockPinger] pinging failed for distributed lock pinger :: caused by :: Unauthorized: not authorized on config to execute command { findAndModify: "lockpings", query: { _id: "as-nscl-01:27017:1475328403:-980595768" }, update: { $set: { ping: new Date(1476088485351) } }, upsert: true, writeConcern: { w: "majority", wtimeout: 15000 }, maxTimeMS: 30000 }
[UserCacheInvalidator] An error occurred while fetching current user cache generation to check if user cache needs invalidation: Unauthorized: not authorized on admin to execute command { _getUserCacheGeneration: 1, maxTimeMS: 30000 }
My problem is that I don't know what to do now. 我的问题是我现在不知道该怎么办。 I don't see anything related to this in the documentation.
我在文档中没有看到与此相关的任何内容。 Maybe I need to create a special user for mongos with some rights ?
也许我需要为拥有某些权利的mongos创建一个特殊用户?
Thanks for your help 谢谢你的帮助
I finally managed to make it work. 我终于设法使它起作用。 In fact, the problem was from the configuration file which was declaring security.authorization: enabled .
实际上,问题出在声明security.authorization:enabled的配置文件中。 This parameter is forbidden for a mongos instance and it was preventing the daemon to start.
mongos实例禁止使用此参数,它阻止了守护程序启动。 Removing the parameter solves the problem.
删除参数即可解决问题。 The errors I had was from previous runs.
我的错误来自先前的运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.