galaxy.meteor 连接到 mlab.com mongo 数据库

galaxy.meteor connection to mlab.com mongo database

我在 galaxy.meteor.com 托管了一个 meteor 应用程序,并计划按照 galaxy 开发人员的建议,在此应用程序中使用 mongolab.com (mlab.com) 数据库。 不幸的是,我无法将我的应用程序连接到 mlab 数据库。以下是我的 settings.json 文件:

{   "galaxy.meteor.com": { 
          "env": { 
            "ROOT_URL": "http://<appname>.meteorapp.com/", 
            "MONGO_URL": "mongodb://<dbuser>:<dbpassword>@ds<123456>-a0.mlab.com:<123456>,<ds123456>-a1.mlab.com:<123456>/<dbname>?replicaSet=rs-ds<123456>",
            "MONGO_OPLOG_URL": "mongodb://<oplog-reader-name>:<oploguserpassword>@ds<123456>-a0.mlab.com:<123456>,ds<123456>-a1.mlab.com:<123456>/admin?replicaSet=rs-ds<123456>"
          }     
}}

Meteor 日志显示以下问题:

2xkx 2016-03-20 22:37:50+01:00 Exception in callback of async function: MongoError: auth failed 2xkx 2016-03-20 22:37:50+01:00 at Object.toError (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/utils.js:110:11) 2xkx 2016-03-20 22:37:50+01:00 at /app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/db.js:1128:31 2xkx 2016-03-20 22:37:50+01:00 at /app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/db.js:1843:9 2xkx 2016-03-20 22:37:50+01:00 at Server.Base._callHandler (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/base.js:445:41) 2xkx 2016-03-20 22:37:50+01:00 at /app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:468:18 2xkx 2016-03-20 22:37:50+01:00 at [object Object].MongoReply.parseBody (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5) 2xkx 2016-03-20 22:37:50+01:00 at [object Object]. (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:426:20) 2xkx 2016-03-20 22:37:50+01:00 at [object Object].emit (events.js:95:17) 2xkx 2016-03-20 22:37:50+01:00 at [object Object]. (/app/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13) 2xkx 2016-03-20 22:37:50+01:00 at [object Object].emit (events.js:98:17)

mongodb-logs 显示如下错误。

Failed to authenticate dbusername@dbname with mechanism MONGODB-CR: AuthenticationFailed MONGODB-CR credentials missing in the user document

有什么建议吗?谢谢

MONGO_OPLOG_URL大概应该是:

mongodb://<oplog-reader-name>:<oploguserpassword>@ds<123456>-a0.mlab.com:<123456>,ds<123456>-a1.mlab.com:<123456>/local?authSource=admin&replicaSet=rs-ds<123456>

问题已解决。银河支持团队的一名成员告诉我

There have been issues with mLab connections and certain older Meteor versions, meteor 1.0.4.2 or higher should work.

将 Meteor 更新到 1.2.1 后。部署的应用程序最终连接到数据库。

注意:当我简单地运行流星更新时,项目实际上并没有得到更新,即使没有显示错误。确保使用 meteor update --release x.x.x(x.x.x。替换为所需的版本)并检查是否之后更新与 meteor --version 一起工作。