我希望我的流星应用程序连接到远程数据库。我想我可以部署两个应用程序,一个在服务器上设置数据库,另一个托管应用程序但连接到另一台服务器上的数据库。我无法让它工作,但我也想知道这是否被推荐?我应该在没有 mup/meteor 的服务器上设置 mongodb 数据库,还是可以使用 mup 为我设置?
我已经尝试过但无法开始工作:
我正在使用两个亚马逊 ec2 实例(ubuntu 14.04)。我为这两个实例制定了以下安全入站规则:
Custom TCP Port: 27017 Source: instance-public-ip-1/32
Custom TCP Port: 27017 Source: instance-public-ip-2/32
HTTP Port: 80 Source: All Addresses
SSH Port: 22 Source: My IP
在尝试访问远程数据库的应用程序的 mup.json 文件中,我在“env”下添加了“MONGO_URL”:“mongodb://db-instance-public-ip:27017/db”,db 是该实例上的应用程序。
托管数据库的流星应用程序部署成功,但托管应用程序的流星应用程序没有。在“调用部署过程”期间部署失败,这里是 STDERR/STDOUT:(XXX.XXX.XXX.XXX 是实例的公共 IP 地址)
x 调用部署过程:失败
-----------------------------------STDERR-----------------------------------
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
/usr/lib/node_modules/wait-for-mongo/bin/wait-for-mongo:14
throw err;
^
Error: TIMEOUTED_WAIT_FOR_MONGO
at null._onTimeout (/usr/lib/node_modules/wait-for-mongo/lib/waitForMongo.js:20:14)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
-----------------------------------STDOUT-----------------------------------
56.145:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
wait-for-mongo: failed to connect to [XXX.XXX.XXX.XXX:27017]
----------------------------------------------------------------------------
如果需要更多信息,请告诉我。问题也在这里发布:https ://github.com/arunoda/meteor-up/issues/450