Meteor can't connect to remote mongodb server

653 views
Skip to first unread message

Ralph Emerson Iligan

unread,
Oct 16, 2014, 3:30:19 AM10/16/14
to meteo...@googlegroups.com
I raise this question in stackoverflow but was not able to get a good answer so I try this here.

I'm am using Phusion Passenger Standalone to deploy my application in our LAN. If my application and mongodb are all in the same server then there's no problem. Here's How I did it

meteor bundle .  and after do npm install
export MONGO_URL='mongodb://localhost:27017/meteor'
export MONGO_OPLOG_URL='mongodb://localhost:27017/local'
export ROOT_URL='http://www.my-app.com'

Start Phusion Passenger

sudo -E passenger start --port 80 --user someusername --environment production --daemonize --sticky-sessions --app-type node --startup-file main.js

However when I wanted to separate them so I can have a dedicated Mongodb Server, my application cannot connect to it. Here's the what I did

export MONGO_URL='mongodb://192.168.xxx.xx:27017/meteor'
export MONGO_OPLOG_URL='mongodb://192.168.xxx.xx:27017/local'
export ROOT_URL='http://www.my-app.com'

What am I missing here to be able to run my Meteor application using a remote server?





Marin Pranjić

unread,
Oct 16, 2014, 3:38:43 AM10/16/14
to meteo...@googlegroups.com
What is your mongod.conf? Do you have "bind_ip = 127.0.0.1" somewhere?
Are you able to connect from the console? (from non-mongo server)

Marin

--
You received this message because you are subscribed to the Google Groups "meteor-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meteor-talk...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ralph Emerson Iligan

unread,
Oct 16, 2014, 4:07:09 AM10/16/14
to meteo...@googlegroups.com
Yes the mongod.conf have the  "bind_ip = 127.0.0.1"...

on your second question, are you referring to browser console?
 

Marin Pranjić

unread,
Oct 16, 2014, 4:27:24 AM10/16/14
to meteo...@googlegroups.com
Hi,

no I was referring to the server console. That would rule out any meteor-specific code.

Anyway, if you remove bind_ip completely, you should be able to connect to it.
However, that will open the database to the public.

You have a few options here:
1. set bind_ip to the private address if your servers share the private network
2. keep binding to localhost and use ssh tunneling (never tried this but it should work)
3. compile mongo with SSL support
(this works on ubuntu: https://github.com/bcessa/mongodb-ssl, and with some modifications it runs on debian)

Marin

On Thu, Oct 16, 2014 at 10:07 AM, Ralph Emerson Iligan <ralphe...@gmail.com> wrote:
Yes the mongod.conf have the  "bind_ip = 127.0.0.1"...

on your second question, are you referring to browser console?
 

--

Ralph Emerson Iligan

unread,
Oct 16, 2014, 5:21:32 AM10/16/14
to meteo...@googlegroups.com
i commented the bind_ip and the port but still my application cannot connect to the moongodb server..

> Are you able to connect from the console?
    what should i do in my server console to connect to the mongodb server? should i install mongodb-clients?

 
Reply all
Reply to author
Forward
0 new messages