WebFaction
Community site: login faq

I've managed to set up a MongoDB server on my webfaction account, with a cron job keeping it running in the background. I can easily connect to this with mongo when I've ssh'ed into webfaction, but I can't connect remotely.

I've had the port opened up and been supplied with an IP, but the command:

mongo --host XX.XX.XX.XXX --port YYYYY

yields the error:

Thu Oct  3 11:24:37.513 Error: couldn't connect to server XX.XX.XX.XXXX:YYYYY at src/mongo/shell/mongo.js:147

Obviously, I could execute anything I do from there by simply connecting to the server and using mongo from there, but I'm trying to achieve a remote connection this way so that I can start connecting to the database from a Node.js app I'm developing locally.

Can you suggest what the problem might be?

Thanks

asked 03 Oct '13, 05:28

richsilv
1112
accept rate: 0%


You will need to open a support ticket at our support site to have the port opened for external access.

permanent link

answered 03 Oct '13, 08:44

timg ♦♦
1.3k4
accept rate: 30%

Thanks, but I've already done that as per the post.

(03 Oct '13, 09:42) richsilv

I've opened the required port for remote connection but still get the error when trying to connect remotely with mongo:

2015-01-10T18:01:39.125+0000 warning: Failed to connect to [serverip]:[port], reason: errno:61 Connection refused
2015-01-10T18:01:39.127+0000 Error: couldn't connect to server [serverhostname]:[port] ([serverip]), connection attempt failed at src/mongo/shell/mongo.js:148
exception: connect failed
permanent link

answered 10 Jan '15, 18:10

tomdriley
32
accept rate: 0%

Please make sure you are trying to connect to the shared ports IP Address. That gets added to your account when you check the "open port" and that address is the one that the port is opened on the firewall.

You can recognize the Shared ports IP address as it has "‡" after it in the Control panel when assigning an IP Address to a site.

(10 Jan '15, 18:18) aaront ♦♦

@aaront that was it - when I switch to that ip address, it works - thanks!

(10 Jan '15, 20:38) tomdriley

Glad that worked! You are welcome.

(10 Jan '15, 20:41) aaront ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×29

question asked: 03 Oct '13, 05:28

question was seen: 7,994 times

last updated: 10 Jan '15, 20:41

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM