rmongodb support for MongoDB 3

烈酒焚心 提交于 2019-12-01 20:30:36

rmongodb (as at 1.8.0) uses a legacy MongoDB C driver which doesn't have full support for MongoDB 3.0 yet. In particular, it will not support using the new SCRAM-SHA-1 default authentication or optional WiredTiger storage engine.

There's an rmongodb issue in Github tracking this: Compatibility with version 3.0 of MongoDB.

Until rmongodb is updated your options (in order of least to most hasslesome) include:

  • use a different driver which does have MongoDB 3.x support (i.e. RMongo 0.1.0 or newer)

  • use MongoDB 2.6

  • use MongoDB 3.x but downgrade to the older MONGO-CR auth (and do not use WiredTiger or any alternative storage engines)

Having just gone through this myself, I thought I'd add my two cents in case it helps someone.

@Stennie is right on target to with the authentication stuff. So if you want to use mongo 3 the way to get it going is as follows (this is from a ubuntu install).

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

should work now! I hope that helps someone...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!