[solved] What to use in MONGO_URL on mupx setup?


#1

Hi!

I’m trying to deploy on my digitalocean ubuntu 14.03 by using mupx.

Here is my mup.json:

{
  // Server authentication info
  "servers": [
    {
      "host": "178.62.193.206",
      "username": "root",
      "env": {}
    }
  ],

  // i have installed mongo manualy
  "setupMongo": false,

  "setupNode": true,
  "nodeVersion": "0.10.40",

  "appName": "appname",

  "app": "/Users/user/app",

  "env": {
    "PORT": 80,
    //the dns of this domain still looking to the old hosting
    "ROOT_URL": "http://Actual_URL"
    "MONGO_URL": "mongodb://username:password@127.0.0.1:27017/appname",
   "METEOR_ENV": "production"
  },

  "deployCheckWaitTime": 120,
  "enableUploadProgressBar": true
} 

When I run “mupx setup” smoothly:

Started TaskList: Setup (linux)
Installing Docker
Installing Docker: SUCCESS
Setting up Environment
Setting up Environment: SUCCESS

but gives me an error on “mupx deploy”:

~mupx logs --tail=50

Meteor Up: Production Quality Meteor Deployments
------------------------------------------------
Configuration file : mup.json
Settings file      : settings.json

[178.62.193.206] 						throw(ex);
[178.62.193.206] 						      ^
[178.62.193.206] Error: failed to connect to [127.0.0.1:27017]
[178.62.193.206]     at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:398:15)
[178.62.193.206]     at new MongoConnection (packages/mongo/packages/mongo.js:221:1)
[178.62.193.206]     at new MongoInternals.RemoteCollectionDriver (packages/mongo/packages/mongo.js:3352:1)
[178.62.193.206]     at Object.<anonymous> (packages/mongo/packages/mongo.js:3386:1)
[178.62.193.206]     at Object.defaultRemoteCollectionDriver (packages/underscore/packages/underscore.js:779:1)
[178.62.193.206]     at new Mongo.Collection (packages/mongo/packages/mongo.js:3503:1)
[178.62.193.206]     at AccountsServer.AccountsCommon (accounts_common.js:23:18)
[178.62.193.206]     at new AccountsServer (accounts_server.js:16:5)
[178.62.193.206]     at Package (globals_server.js:5:12)
[178.62.193.206]     at /bundle/bundle/programs/server/packages/accounts-base.js:1813:4
[178.62.193.206]     - - - - -
[178.62.193.206]     at [object Object].<anonymous> (/bundle/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:556:74)
[178.62.193.206]     at [object Object].emit (events.js:106:17)
[178.62.193.206]     at [object Object].<anonymous> (/bundle/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:156:15)
[178.62.193.206]     at [object Object].emit (events.js:98:17)
[178.62.193.206]     at Socket.<anonymous> (/bundle/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
[178.62.193.206]     at Socket.emit (events.js:95:17)
[178.62.193.206]     at net.js:441:14
[178.62.193.206]     at process._tickCallback (node.js:448:13)
[178.62.193.206] npm WARN package.json meteor-dev-bundle@0.0.0 No description
[178.62.193.206] npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
[178.62.193.206] npm WARN package.json meteor-dev-bundle@0.0.0 No README data
[178.62.193.206] => Starting meteor app on port:80
[178.62.193.206] 
[178.62.193.206] /bundle/bundle/programs/server/node_modules/fibers/future.js:278
[178.62.193.206] 						throw(ex);
[178.62.193.206] 						      ^
[178.62.193.206] Error: failed to connect to [127.0.0.1:27017]
[178.62.193.206]     at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:398:15)
[178.62.193.206]     at new MongoConnection (packages/mongo/packages/mongo.js:221:1)
[178.62.193.206]     at new MongoInternals.RemoteCollectionDriver (packages/mongo/packages/mongo.js:3352:1)
[178.62.193.206]     at Object.<anonymous> (packages/mongo/packages/mongo.js:3386:1)
[178.62.193.206]     at Object.defaultRemoteCollectionDriver (packages/underscore/packages/underscore.js:779:1)
[178.62.193.206]     at new Mongo.Collection (packages/mongo/packages/mongo.js:3503:1)
[178.62.193.206]     at AccountsServer.AccountsCommon (accounts_common.js:23:18)
[178.62.193.206]     at new AccountsServer (accounts_server.js:16:5)
[178.62.193.206]     at Package (globals_server.js:5:12)
[178.62.193.206]     at /bundle/bundle/programs/server/packages/accounts-base.js:1813:4
[178.62.193.206]     - - - - -
[178.62.193.206]     at [object Object].<anonymous> (/bundle/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:556:74)
[178.62.193.206]     at [object Object].emit (events.js:106:17)
[178.62.193.206]     at [object Object].<anonymous> (/bundle/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:156:15)
[178.62.193.206]     at [object Object].emit (events.js:98:17)
[178.62.193.206]     at Socket.<anonymous> (/bundle/bundle/programs/server/npm/npm-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
[178.62.193.206]     at Socket.emit (events.js:95:17)
[178.62.193.206]     at net.js:441:14
[178.62.193.206]     at process._tickCallback (node.js:448:13)

#2

hey how did you solve this?


#3

I’ve used it like that:
"MONGO_URL": "mongodb://login:password@Real_server_IP:27017/db_name",


#4

I dont think it is needed, just dont provide MONGO_URL and it will use that docker image.
Still I would expect if u provide MONGO_URL, u should also add that OPLOG variable
But I am not very reliable source :smiley:


#5

Has anybody successfully connected a mupx deployment to an external MONGO instance

Do you have to go through the Docker, or can you bypass that?


#6

Struggling here to have the same setup, do you have any updates ?


#7

I have had no success, actually I am even stuck on deploying anything on android store.

The app work fine in debug mode and dont initiate any connection in release mode


#8

I also wanted my docker container to use the Mongo installed on the host. To do that I changed docker to run in HOST mode instead of BRIDGE which is what MUP deploys with by default.

Now my docker images aren’t so segregated. They can both access the database without going through any virtual routing.

https://jamesloper.com/meteor-shared-mongodb


#9

I had the same issue and couldn’t get the external mongo URL to work, no matter what I did. I had to end up using a local MongoDB because it just wasn’t happening.


#10

this is my set up. and it worked for me on ec2.

{
 // Server authentication info
 "servers": [
   {
     "host": "54.200.165.177",
     "username": "ubuntu",
     // or pem file (ssh based authentication)
     // WARNING: Keys protected by a passphrase are not supported
     "pem": "~/Downloads/restaurant.pem"
     // Also, for non-standard ssh port use this
     //"sshOptions": { "port" : 49154 }
     // server specific environment variables
   }
 ],

 // Install MongoDB on the server. Does not destroy the local MongoDB on future setups
 "setupMongo": true,
 "nodeVersion": "0.10.40",
 // Application name (no spaces).
 "appName": "restaurant",

 // Location of app (local directory). This can reference '~' as the users home directory.
 // i.e., "app": "~/Desktop/restaurant-mobile",
 // This is the same as the line below.
 "app": "~/Desktop/restaurant-mobile",

 // Configure environment
 // ROOT_URL must be set to your correct domain (https or http)
 "env": {
   "PORT": 80,
   "ROOT_URL": "http://54.200.165.177"
 },

 // Meteor Up checks if the app comes online just after the deployment.
 // Before mup checks that, it will wait for the number of seconds configured below.
 "deployCheckWaitTime": 300,

 // show a progress bar while uploading.
 // Make it false when you deploy using a CI box.
 "enableUploadProgressBar": true
} 



#11

Hi,
Is there anyone who really found the solution?
This thread is marked as SOLVED but I can’t see any solution here.


#12

Ive solved this problem during forking mupx sources and add another one config parameter. It doesnt good solutions, but I`ve had only two variants:

  1. Learn and understand docker (I`am not experienced in it)
  2. Change mupx and continue to use it.

P.S. my problem was connect two applications with different names to one database.