Meteor 0.8.3 app拒绝连接到外部mongo服务器

时间:2014-08-08 07:17:17

标签: mongodb meteor

我有一个mongo副本集我使用MONGO_URL="mongodb://<user>:<pass>/host:27017/db"连接到我的meteor应用程序。最近升级到流星0.8.3之后,奇怪地停止了工作。我也检查了回滚到0.8.2,它也没有在那里工作,所以我认为它不是meteor所做的事情,而且我的mongo服务器可能有问题。我之前能够使用相同的设置进行部署。我也可以在我的机器上使用mongo -u <user> -p <password> host:port/db运行mongo shell并连接到远程服务器。 Mongo用户具有读写权限。

之前有没有遇到过这个?如何连接远程mongo实例并运行我的meteor应用程序?

以下是我尝试在MONGO_URL设置为远程mongo实例的情况下运行meteor应用程序时显示的错误。

 /Users/charnjitsingh/.meteor/tools/cef2bcd356/lib/node_modules/fibers/future.js:206
W20140808-09:35:09.241(5.5)? (STDERR)                       throw(ex);
W20140808-09:35:09.241(5.5)? (STDERR)                             ^
W20140808-09:35:09.260(5.5)? (STDERR) MongoError: not authorized for query on celebvidy.system.dummy
W20140808-09:35:09.260(5.5)? (STDERR)     at Object.Future.wait (/Users/charnjitsingh/.meteor/tools/cef2bcd356/lib/node_modules/fibers/future.js:326:15)
W20140808-09:35:09.261(5.5)? (STDERR)     at _.extend._nextObject (packages/mongo-livedata/mongo_driver.js:858)
W20140808-09:35:09.261(5.5)? (STDERR)     at _.extend.forEach (packages/mongo-livedata/mongo_driver.js:892)
W20140808-09:35:09.261(5.5)? (STDERR)     at _.extend.map (packages/mongo-livedata/mongo_driver.js:902)
W20140808-09:35:09.262(5.5)? (STDERR)     at _.extend.fetch (packages/mongo-livedata/mongo_driver.js:926)
W20140808-09:35:09.262(5.5)? (STDERR)     at Cursor.(anonymous function) [as fetch] (packages/mongo-livedata/mongo_driver.js:741)
W20140808-09:35:09.262(5.5)? (STDERR)     at MongoConnection.findOne (packages/mongo-livedata/mongo_driver.js:647)
W20140808-09:35:09.262(5.5)? (STDERR)     at Object.Package (packages/collection-hooks/findone.js:23)
W20140808-09:35:09.263(5.5)? (STDERR)     at Object.collection.(anonymous function) [as findOne] (packages/collection-hooks/collection-hooks.js:102)
W20140808-09:35:09.264(5.5)? (STDERR)     at _.extend.findOne (packages/mongo-livedata/collection.js:238)
W20140808-09:35:09.264(5.5)? (STDERR)     - - - - -
W20140808-09:35:09.264(5.5)? (STDERR)     at Object.toError (/Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/utils.js:110:11)
W20140808-09:35:09.265(5.5)? (STDERR)     at /Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/cursor.js:686:54
W20140808-09:35:09.265(5.5)? (STDERR)     at Cursor.close (/Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/cursor.js:969:5)
W20140808-09:35:09.265(5.5)? (STDERR)     at commandHandler (/Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/cursor.js:686:21)
W20140808-09:35:09.266(5.5)? (STDERR)     at /Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/db.js:1843:9
W20140808-09:35:09.266(5.5)? (STDERR)     at Server.Base._callHandler (/Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/connection/base.js:445:41)
W20140808-09:35:09.266(5.5)? (STDERR)     at /Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/connection/server.js:468:18
W20140808-09:35:09.266(5.5)? (STDERR)     at MongoReply.parseBody (/Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
W20140808-09:35:09.267(5.5)? (STDERR)     at null.<anonymous> (/Users/charnjitsingh/.meteor/packages/mongo-livedata/4821944ffe/npm/node_modules/mongodb/lib/mongodb/connection/server.js:426:20)
W20140808-09:35:09.267(5.5)? (STDERR)     at emit (events.js:95:17)
=> Exited with code: 8

1 个答案:

答案 0 :(得分:0)

根据https://github.com/gterrono/houston/issues/205,我确认这确实是特定于休斯顿的错误。

解决方案:暂时使用repo的分叉版本,a)删除对Houston的smart.json中的1.0.7 repo的引用,b)包括删除虚拟引用的提交。我已经证实这对Modulus有效。

在您的项目中smart.lock:

删除: "tag": "v1.0.7",

变化: "git": "https://github.com/gterrono/houston.git",

要: "git": "https://github.com/chadokruse/houston.git",(或您自己的分叉回购)

然后改变: "commit": "a27e9e42d03764f09a6681a98945787fe1f6303d"

要: "commit": "4f13530c2fafd1c3aac98f787a5598b3e04b150f"(或您自己的分支回购中的最新提交)

注意:只要他们将休斯顿更新为&gt; 1.0.7,您就会想要切换回来。

如果您对错误修复的详细信息感兴趣,请查看提交本身:https://github.com/gterrono/houston/commit/ecce96e6c8ed1b38f0d330c141135c47fc52ec58