[SERVER-7873] Cannot connect from a remote machine without specifying default port Created: 07/Dec/12  Updated: 15/Feb/13  Resolved: 09/Dec/12

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Edouard Perov Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Oracle Linux 64-bit


Participants:

 Description   

Hi,

I have a Replica Set running on three Linux machines ssvm41, ssvm42, and ssvm43
The connection without specifying the default port from a remote machine another one that listed above aka “Client” over network fails
UNIX> mongo ssvm41
MongoDB shell version: 2.2.2
connecting to: ssvm41
Fri Dec 7 12:47:50 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed

If I run the same on a member machine ssvm42 it works
UNIX> mongo ssvm41
MongoDB shell version: 2.2.2
connecting to: ssvm41
aba:SECONDARY>
!!! Remember it says SECONDARY !!!

Specifying the default port makes it working from “Client”
UNIX> mongo ssvm41:27017
MongoDB shell version: 2.2.2
connecting to: ssvm41:27017/test
aba:PRIMARY>
it says now connected to PRIMARY now.

Would you please explain this behavior.
Thanks,
Edouard



 Comments   
Comment by Eliot Horowitz (Inactive) [ 09/Dec/12 ]

You want mongo --host ssvm41
If you specify the port, it guesses its a host, not a dbname.

Generated at Thu Feb 08 03:15:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.