我创建了一个角色为 userAdminAnyDatabase 的用户,但我无法使用此帐户访问配置数据库
mongos> use admin;
switched to db admin
mongos> show users;
{
"_id" : ObjectId("51a075cf35978c6326c6350f"),
"user" : "clustersa",
"pwd" : "e76cbe5c62d704fa4074a7047fa165f5",
"roles" : [
"userAdminAnyDatabase"
]
}
mongos> db.auth('clustersa','clustersa')
1
mongos> use config
switched to db config
mongos> db.runCommand( { listshards : 1 } );
{ "ok" : 0, "errmsg" : "access denied - use admin db" }