首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >对MongoDB 3的rmongodb支持

对MongoDB 3的rmongodb支持
EN

Stack Overflow用户
提问于 2015-06-26 04:54:20
回答 2查看 1.8K关注 0票数 3

我正在构建一个R脚本,在该脚本中,我需要通过身份验证连接到 MongoDB ,并使用瑞香草 package.For处理从数据库获取的数据,这些数据是我在版本3.0.4中创建了一个新的mongoDB用户,而连接到mongoDB的R脚本身份验证失败。此外,通过mongo成功地对用户进行身份验证。此外,当我对在MongoDB版本2.x中创建的用户进行身份验证时,身份验证工作正常。

下面是我们在R脚本中用来连接到Mongo数据库的代码片段。

mongo.create("127.0.0.1“、”用户“、"pass”、"db“、0L )

在执行上面的代码片段时,我们收到以下响应

错误:加载所需的包: rmongodb身份验证失败。

请建议我的适当解决方案,认证失败的问题,在rmongodb包。

EN

回答 2

Stack Overflow用户

发布于 2015-06-26 08:23:39

rmongodb (从1.8.0开始)使用了一个遗留的MongoDB C驱动程序,该驱动程序还没有完全支持MongoDB 3.0。特别是,它不支持使用新的SCRA-SHA-1默认身份验证或可选的WiredTiger存储引擎。

rmongodb跟踪中有一个问题:与MongoDB 3.0版的兼容性

在更新rmongodb之前,您的选项(对大多数麻烦来说是最少的)包括:

  • 使用具有MongoDB 3.x支持的不同驱动程序(即RMongo 0.1.0或更高版本)
  • 使用MongoDB 2.6
  • 使用MongoDB 3.x,但降级到较老的MongoDB(不使用WiredTiger或任何替代存储引擎)
票数 4
EN

Stack Overflow用户

发布于 2015-07-28 05:05:11

我自己刚经历过这件事,我想我应该加上我的两分钱,以防它对别人有帮助。

@Stennie正对目标进行身份验证。因此,如果您想使用mongo 3,它的运行方式如下(这是从一个ubuntu安装)。

1) sudo nano /etc/mongod.conf 2) Comment out the "auth=TRUE" line 3) sudo service mongod restart 4) login to mongo shell (now with no authentication so everything is open) 5) use admin 6) Execute the following: var schema = db.system.version.findOne({"_id" : "authSchema"}) schema.currentVersion = 3 db.system.version.save(schema) (the above 3 commands are from here: https://jira.mongodb.org/browse/SERVER-17459) 7) create your users in the appropriate database 8) to make sure the right credentials are set up, type db.system.users.find() and amke sure they have the MONGODB-CR credentials 9) quit mongo 10) ucomment out the authentication line in /etc/mongod.conf 11) restart mongodb using sudo service mongod restart

现在就该工作了!我希望这能帮到别人..。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31065196

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档