Auf Fedora23 funktioniert MongoDB nicht für Show-Dbs

469
tuxdna

Auf Fedora23 habe ich MongoDB mit installiert dnf.

sudo dnf install -y mongod sudo systemctl restart mongod 

Es funktioniert jedoch nicht für show dbs

$ mongo MongoDB shell version: 3.0.9 connecting to: test > show dbs 2016-03-08T14:45:58.188+0530 E QUERY Error: listDatabases failed:{ "ok" : 0, "errmsg" : "not authorized on admin to execute command { listDatabases: 1.0 }", "code" : 13 } at Error (<anonymous>) at Mongo.getDBs (src/mongo/shell/mongo.js:47:15) at shellHelper.show (src/mongo/shell/utils.js:630:33) at shellHelper (src/mongo/shell/utils.js:524:36) at (shellhelp2):1:1 at src/mongo/shell/mongo.js:47 >  

Das funktioniert auch nicht:

> db.createUser(]}) 2016-03-08T14:48:34.595+0530 E QUERY Error: couldn't add user: not authorized on test to execute command { createUser: "admin", pwd: "xxx", roles: [ { role: "root", db: "admin" } ], digestPassword: false, writeConcern: { w: "majority", wtimeout: 30000.0 } } at Error (<anonymous>) at DB.createUser (src/mongo/shell/db.js:1101:11) at (shell):1:4 at src/mongo/shell/db.js:1101 >  

Ref: https://stackoverflow.com/questions/23943651/mongodb-admin-user-not-authorized

Sogar bei sudo mongomir sehe ich dieselben Fehler.

Wie kann ich das beheben?

1
Haben Sie Selinux-Ablehnungen bei der Prüfung? Jakuje vor 8 Jahren 0
Überhaupt habe ich dieses Problem gelöst. Es hat nichts mit Selinux zu tun. Das Problem war, dass ich ein Docker-Container mit Ports ausgeführt habe, die demselben Port zugeordnet sind, den der Mongodb-Server verwenden würde. Der Fehler wurde tief in der Protokolldatei versteckt. tuxdna vor 8 Jahren 1

0 Antworten auf die Frage