I would like a my meteor app to connect to a remote database. I thought I could deploy two apps, one that sets up the database on a server and another that hosts the app but connects to the database on the other server. I am having trouble getting this to work, but I am also wondering if this is recommended or not? Should I setup a mongodb database on a server without mup/meteor or can I use mup to set that up for me?
What I have tried and cannot get to work:
I am using two amazon ec2 instances (ubuntu 14.04). I have made the following security inbound rules for both instances:
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
In the mup.json file for the app trying to access the remote database, I have added "MONGO_URL": "mongodb://db-instance-public-ip:27017/db" under "env" and db is the name of the app on that instance.
The meteor app hosting the database deploys successfully but the meteor app hosting the app does not. The deployment fails during the "Invoking deployment process" and here is the STDERR/STDOUT: (XXX.XXX.XXX.XXX is the public IP address of the instance)
x Invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] 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]
----------------------------------------------------------------------------
Let me know if more information is needed. Question is also posted here: https://github.com/arunoda/meteor-up/issues/450