简体   繁体   English

mongodb 3.2.4中的分片集群身份验证

[英]Sharded Cluster authentication in mongodb 3.2.4

I have 6 mongod server. 我有6个mongod服务器。

2 shard with replica set of two servers each(totally 4 mongod server) 2 config server 2 mongos which will run on shard server itself 2个具有两个服务器副本集的分片(总共4个mongod服务器)2个配置服务器2个mongos,它们将在分片服务器本身上运行

I would like to enable authentication on sharded cluster. 我想在分片群集上启用身份验证。 I tried enabling --auth while starting the 6 mongod instances but it throwing below error. 我在启动6个mongod实例时尝试启用--auth,但是它抛出以下错误。

SHARDING [mongosMain] Error initializing sharding state, sleeping for 2 seconds and trying again :: caused by :: Unauthorized: could not get updated shard list from config server due to not authorized for query on config.shards SHARDING [mongosMain]初始化分片状态时出现错误,休眠2秒钟,然后重试::由::导致::未经授权:由于未授权对config.shards进行查询而无法从配置服务器获取更新的分片列表

How to enable authentication in sharded cluster? 如何在分片群集中启用身份验证? I'm using mongodb 3.2.4 version. 我正在使用mongodb 3.2.4版本。

How config server will communicate internally with other mongod server? 配置服务器如何与其他mongod服务器进行内部通信?

Do i need to create user on each mongod separately in admin db? 我是否需要在管理数据库中分别在每个mongod上创建用户?

Please help me to understand this. 请帮助我理解这一点。

-Thanks in advance. -提前致谢。

For shared cluster, you have to use keyfile or x.509 certificate authentication for inter cluster communication. 对于共享群集,必须使用密钥文件或x.509证书身份验证进行群集间通信。

Please refer to this link: https://docs.mongodb.com/manual/core/security-internal-authentication/ 请参考以下链接: https : //docs.mongodb.com/manual/core/security-internal-authentication/

To create users, connect to the mongos and add the users. 要创建用户,请连接到mongos并添加用户。 Since version 2.6+, MongoDB stores user login data in the admin database of the config servers, so you don't have to create user on each mongod separately. 从2.6+版本开始,MongoDB将用户登录数据存储在配置服务器的admin数据库中,因此您不必在每个mongod上分别创建用户。 Also you can refer to these links: 您也可以参考以下链接:

http://pe-kay.blogspot.in/2016/02/update-existing-mongodb-replica-set-to.html http://pe-kay.blogspot.in/2016/02/update-existing-mongodb-replica-set-to.html

http://pe-kay.blogspot.in/2016/02/securing-mongodb-using-x509-certificate.html http://pe-kay.blogspot.in/2016/02/securing-mongodb-using-x509-certificate.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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