简体   繁体   English

MongoDB 3.0.1的身份验证问题-RoboMongo

[英]MongoDB 3.0.1 problems with auth - RoboMongo

I have install MongoDB 3.0.1 in a server (Ubuntu14.04). 我已经在服务器(Ubuntu14.04)中安装了MongoDB 3.0.1。 I need to enable remote authentication for my MongoDB, so that it can only be seen by registered user. 我需要为MongoDB启用远程身份验证,以便只有注册用户才能看到它。 Once installed Mongo, I have run these commands: 安装Mongo后,我已经运行了以下命令:

> use admin
switched to db products
> db.createUser({user: "userAdmin", pwd: "admin1234", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]})

This is my /etc/mongod.conf": 这是我的/etc/mongod.conf“:

dbpath = /var/lib/mongodb
logpath = /var/log/mongodb/mongod.log
logappend = true
port = 27017
bind_ip = 127.0.0.1,SERVER_IP
auth = true

If I try to connect with RoboMongo, I get this message 如果我尝试连接RoboMongo,则会收到此消息

YES - Connected to SERVER_IP
NO - Authorization failed

If I try to access it from my browser ( http://SERVER_IP:3000/products ) I get this message: 如果尝试从浏览器( http:// SERVER_IP:3000 / products )访问它,则会收到以下消息:

null

If I change the configuration file this "auth = false" from the browser I can see this (which is correct) 如果我从浏览器中更改此配置文件“ auth = false”,则可以看到此信息(正确)

[]

But I can not login, someone can help me? 但是我无法登录,有人可以帮助我吗?

Via Robomongo.org homepage : 通过Robomongo.org主页

Note: We are working on an update with MongoDB 3.0 compatibility for the upcoming Robomongo 0.9.x release series.

Robomongo is currently on version 0.8.5 which only supports MongoDB 2.2 Robomongo当前版本为0.8.5 ,仅支持MongoDB 2.2

mongo 2.6 uses MONGODB-CR auth protocol and 3.0 uses MONGODB-SHA-1 by default. 默认情况下,mongo 2.6使用MONGODB-CR身份验证协议,而3.0使用MONGODB-SHA-1。 the work around would be to create your databes with a server running auth and version 2.6 then upgrade to 3.0 because both authMechanism can co-exist. 解决方法是使用运行auth和2.6版的服务器创建数据库,然后升级到3.0,因为两种authMechanism可以共存。 Any user created with MONGODB-CR will continue to use that authentication as long as you do not run a authSchemaUpgrdae after you have upgraded to 3.0. 只要升级到3.0后没有运行authSchemaUpgrdae,使用MONGODB-CR创建的任何用户都将继续使用该身份验证。

PS. PS。 robomongo and older versions of drivers uses MONGODB-CR. robomongo和较旧版本的驱动程序使用MONGODB-CR。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM