我在mongoDBMap集里设置了一个副本。
我可以使用mongosh
连接到群集,但无法执行rs.status()
甚至show users
等命令。我收到以下错误:
Atlas atlas-lmkye1-shard-0 [primary] wtlive-staging> rs.status()
MongoServerError: not authorized on admin to execute command { replSetGetStatus: 1, lsid: { id: UUID("d888f98f-5b92-4fdf-836d-8c8ad86df659") }, $clusterTime: { clusterTime: Timestamp(1674659350, 1), signature: { hash: BinData(0, 611CAD1FEBDB879CD8C71265AF6CD769AFDC37DA), keyId: 7160608903690977282 } }, $db: "admin" }
Atlas atlas-lmkye1-shard-0 [primary] wtlive-staging> show dbs
admin 424.00 KiB
config 220.00 KiB
local 13.37 GiB
monstache 160.00 KiB
wtlve-staging 18.23 GiB
Atlas atlas-lmkye1-shard-0 [primary] wtlive-staging> show users
MongoServerError: not authorized on waiter-staging to execute command { usersInfo: 1, lsid: { id: UUID("d888f98f-5b92-4fdf-836d-8c8ad86df659") }, $clusterTime: { clusterTime: Timestamp(1674659934, 11), signature: { hash: BinData(0, 4BA4C6CC9223F392114A1148663017143E15D3CD), keyId: 7160608903690977282 } }, $db: "wtlive-staging" }
Atlas atlas-lmkye1-shard-0 [primary] wtlive-staging>
我的onpremise MondbDB没有这个问题。你知道是什么问题吗?
1条答案
按热度按时间jvlzgdj91#
仔细查看内置角色:读写任意数据库
操作
replSetGetStatus
需要群集管理器操作
usersInfo
需要用户管理员