我已经成功地部署了一个mongo复制集,在我的三个节点之间共享一个密钥文件。它很好,问题是当我尝试启动操作经理服务时:
[root@xxx:/etc]# service mongodb-mms start
Starting pre-flight checks
Failure to connect to configured mongo instance:
Config{loadBalance=false, encryptedCredentials=false, ssl='false',
dbNames='[mmsdb, mmsdbprovisionlog, mmsdbautomation, mmsdbserverlog,
mmsdbpings, mmsdbprofile, mmsdbrrd, mmsdbconfig, mmsdblogcollection,
mmsdbjobs, mmsdbagentlog, mmsdbbilling, backuplogs, automationcore,
monitoringstatus, mmsdbautomationlog, automationstatus, cloudconf, backupdb,
mmsdbprovisioning, mmsdbqueues]', uri=mongodb://xxx1:27017,xxx2:27017,xxx3:27017} Error: Command failed with
error 13: 'not authorized on admin to execute command { listDatabases: 1,
$db: "admin" }' on server xxx1:27017. The full response is { "operationTime"
: { "$timestamp" : { "t" : 1517416044, "i" : 1 } }, "ok" : 0.0, "errmsg" :
"not authorized on admin to execute command { listDatabases: 1, $db:
\"admin\" }", "code" : 13, "codeName" : "Unauthorized", "$clusterTime" : {
"clusterTime" : { "$timestamp" : { "t" : 1517416044, "i" : 1 } }, "signature" : { "hash" : { "$binary" : "fh+qyjJ0L8c8zCx0U672aJdZdUw=", "$type" : "00" }, "keyId" : { "$numberLong" : "6516848947321896961" } } } }
Pre-flight checks failed. Service can not start.我没有得到数据库管理的授权..。
我尝试配置另一个repl集,我在其中注释了mongod.conf文件的这一部分。
security:
keyFile: /opt/mongo/mongo-keyfile我可以正确地开始服务。怎么啦?
发布于 2018-01-31 17:22:38
您的MongoDB服务器启动时启用了身份验证,但是ops管理器服务试图连接和管理服务器(从listDatabases命令开始),而不进行身份验证。
MongoDB文档包括一个关于在副本集中强制密钥文件访问控制的有用教程,其中包括以下相关评论:
使用--keyFile命令行选项或security.keyFile配置文件设置运行内部认证和基于角色的访问控制。
https://stackoverflow.com/questions/48547530
复制相似问题