我希望您的Meteor应用程序能够连接到远程数据库。我认为我可以部署两个应用程序,一个在服务器上设置数据库,另一个托管应用程序但连接到另一台服务器上的数据库。我遇到了一些问题,但我也想知道这是否推荐?我应该在没有MUP/Meteor的服务器上设置MongoDB数据库,还是可以使用MUP为我设置?
我尝试过但无法使其工作的内容:
我正在使用两个Amazon EC2实例(Ubuntu 14.04)。我已经为两个实例制定了以下安全入站规则:
在试图访问远程数据库的应用程序的mup.json文件中,我已经在“env”下添加了“MONGO_URL”:“mongodb://db-instance-public-ip:27017/db”,其中db是该实例上应用程序的名称。
托管数据库的meteor应用程序成功部署,但托管应用程序的meteor应用程序失败了。 部署过程在“调用部署过程”期间失败,以下是STDERR/STDOUT:(XXX.XXX.XXX.XXX是实例的公共IP地址)
x 调用部署过程:失败
我尝试过但无法使其工作的内容:
我正在使用两个Amazon 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是该实例上应用程序的名称。
托管数据库的meteor应用程序成功部署,但托管应用程序的meteor应用程序失败了。 部署过程在“调用部署过程”期间失败,以下是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