1
votes

I have been setting up a server on a Digital Ocean droplet in order to host a couple of Meteor apps. I'm doing everything from scratch so I can learn as much as possible. I am trying to use "Meteor-Up" (mup) to deploy an app, but it is having problem communicating with MongoDB. When I run "mup setup" I get the following error:

Started TaskList: Setup (linux)
[Gibson] - Installing Docker
[Gibson] - Installing Docker: SUCCESS
[Gibson] - Setting up Environment
[Gibson] - Setting up Environment: SUCCESS
[Gibson] - Copying MongoDB configuration
[Gibson] - Copying MongoDB configuration: SUCCESS
[Gibson] - Installing MongoDB
[Gibson] x Installing MongoDB: FAILED

-----------------------------------STDERR-----------------------------------
docker: Error response from daemon: driver failed programming external connectivity on endpoint mongodb (1e188b51b171446cd22d96f40ceab1e696019e5ac33ca713d78827246ae37ec8): Error starting userland proxy: listen tcp 127.0.0.1:27017: bind: address already in use.
-----------------------------------STDOUT-----------------------------------
latest: Pulling from library/mongo
Digest: sha256:beff97308c36f7af664a1d04eb6ed09be1d14c17427065b2ec4b0de90967bb3f
Status: Image is up to date for mongo:latest
mongodb
c17e5ac9e9369b779da4aff639c16578dedbc7c357985f67d6e7b005d9cf3939
----------------------------------------------------------------------------

But I can't get from this any indication of what's going wrong. Is the problem with Mongo, Meteor, mup, or docker?

EDIT:

So far I understand from the message that "mup" is trying to connect to Mongo on port 27017 and is failing, I just don't understand why or how to fix it. I have a database that I want the app to connect to, which I moved onto the server from my local machine using mongodump and mongorestore. The thing I can't solve is how to connect my meteor app to that mongo DB.

1
It says some other application is already using port 27017. As 2 apps cannot share the same port, you have 2 options - shut down the one which is already running (a mongod ?) or change dockerfiles to use different port.Alex Blex
But Alex, my understanding is that MongoDB always runs on port 27017 and multiple meteor applications are always able to access it. What don't I get?Public Trust
When you run mup setup it installs docker, then installs mongodb container and tries to bind it to port 27017, fails, and report cause of the failure. What is not clear here?Alex Blex
I have had multiple meteor apps running on a single machine before - when I start (or deploy) one app, I don't have to stop or turn off MongoDB. The meteor app should be able find the existing database because it has the setting variable "MONGO_URL" set to "mongodb://localhost:27017/databaseName". But you are suggesting that i have to STOP mongod before I can deploy with mup. Which I have never done before.Public Trust
Look, I don't know what you did before, and what has changed since then. It's just what I see from the error you've posted.Alex Blex

1 Answers

0
votes

It does not just try to connect to mongod, but it installs mongod in a container and tries to bind port 27017 to local interface.

If you already have mongodb installed and prefer to use it instead, you need to disable installation of mongodb in mup.js, mup.json, or whatever configuration file is being used in your version of mup.