Mongo 2.6 的 Meteor oplog [英] Meteor oplog for Mongo 2.6
问题描述
当我从 https://github.com/meteor/meteor 运行线路时/wiki/Oplog-Observe-Driver 我明白了
WARNING: The 'addUser' shell helper is DEPRECATED. Please use 'createUser' instead
2014-09-05T20:51:35.483-0400 Error: couldn't add user: "otherDBRoles" is not a valid argument to createUser at src/mongo/shell/db.js:1004
因为它是为 Mongo 2.4 创建的.有人设法让它在 Mongo 2.6.1 上工作吗?如果没有,我需要降级到 2.4 吗?如果是,我该如何轻松做到?
Because it was created for Mongo 2.4. Have someone managed to make it work on Mongo 2.6.1? If not, do I need to downgrade to 2.4? And if yes, how can I do it easily?
推荐答案
以这种方式创建您的用户,确保您已通过身份验证并在管理员 (docs) 数据库:
Create your user this way, make sure you are authenticated and in the admin (docs) database:
创建用户
oplogger
(文档)
db.createUser({ user: "<name>",
pwd: "<cleartext password>",
roles: []
});
创建 oplogger 角色(docs)
db.runCommand({ createRole: "oplogger", privileges: [ { resource: { db: 'local', collection: 'system.replset'}, actions: ['find']}, ], roles: [{role: 'find', db: 'local'}] })
授予用户角色 (docs一>)
db.runCommand({ grantRolesToUser: 'oplogger', roles: ['oplogger']})
使用 MONGO_OPLOG_URL 作为环境变量.不要忘记 authSource=admin
参数,否则它将无法工作.(文档)
Use the MONGO_OPLOG_URL as an environment variable. Don't forget the authSource=admin
parameter or it wont work. (docs)
MONGO_OPLOG_URL=mongodb://oplogger:<password>@server_ip/local?authSource=admin
2.6 还有一些问题没有解决:https://github.com/meteor/meteor/issues/2121 &https://github.com/meteor/meteor/issues/2278 虽然它仍然是非常好用.
There are also a few issues with 2.6 that aren't yet solved: https://github.com/meteor/meteor/issues/2121 & https://github.com/meteor/meteor/issues/2278 though it is still very usable.
这篇关于Mongo 2.6 的 Meteor oplog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!