我在Kubernetes集群中使用Helm安装了mongodb . https://github.com/kubernetes/charts/tree/master/stable/mongodb

它工作正常,让我连接到数据库 . 但是一旦我登录到mongo服务器,我就无法进行任何操作 . 这是我尝试查看集合时遇到的错误 .

> show collections;
2018-04-19T18:03:59.818+0000 E QUERY    [js] Error: listCollections failed: {
    "ok" : 0,
    "errmsg" : "not authorized on test to execute command { listCollections: 1.0, filter: {}, $db: \"test\" }",
    "code" : 13,
    "codeName" : "Unauthorized"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:942:1
DB.prototype.getCollectionInfos@src/mongo/shell/db.js:954:19
DB.prototype.getCollectionNames@src/mongo/shell/db.js:965:16
shellHelper.show@src/mongo/shell/utils.js:836:9
shellHelper@src/mongo/shell/utils.js:733:15
@(shellhelp2):1:1

我以root用户身份登录

mongo -p password

我不知道为什么即使root用户也无权做任何事情 .