简体   繁体   English

集群中的MongoDB身份验证

[英]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.

相关问题 mongodb 3.2.4中的分片集群身份验证 - Sharded Cluster authentication in mongodb 3.2.4 Windows分片群集上的MongoDB身份验证 - MongoDB authentication on Windows Sharded Cluster 带有身份验证错误的 MongoDB Atlas 集群连接问题 - MongoDB Atlas Cluster Connection Problem with Authentication Error mongodb集群:使用keyFile进行身份验证后,它报告碎片的套接字异常 - mongodb cluster:after use keyFile for authentication ,it report socket exception for shard 连接到MongoDB服务集群时出错:SASL身份验证步骤上服务器返回错误:身份验证错误身份验证失败 - error connecting to MongoDB service cluster: server returned error on SASL authentication step: bad auth Authentication failed 尝试连接 MongoDB Kubernetes 集群(使用 MongoDB 社区 Z301136395F0181737 创建)时,mongo-express 的身份验证问题 - Authentication Problem with mongo-express when trying to connect with MongoDB Kubernetes Cluster (created with MongoDB Community Kubernetes Operator) Mongodb --身份验证 - Mongodb --authentication 身份验证MongoDB - Authentication MongoDB 当从 Kubernetes 集群内部而不是从外部调用时,MongoDB 会忽略身份验证 - MongoDB ignores authentication when called from inside Kubernetes cluster but not from outside 如何连接到作为副本分片集群成员的mongodb身份验证实例? - How to connect to mongodb authentication instance which is one member of replica shard cluster?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM