[SERVER-1785] Mongo does not work correctly when specifying ip address instead of host name Created: 13/Sep/10  Updated: 13/Sep/10  Resolved: 13/Sep/10

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

Type: Bug Priority: Minor - P4
Reporter: Jozef Sovcik Assignee: Kyle Banker
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: Linux
Participants:

 Description   

Mongo does not work properly while using it in environment with no DNS running.

While adding new member to replica set configuration using replSetReconfig mongo tries to convert explicitly specified ip address to a host name.
This fails in case there is no DNS running and adding rs member fails too.

I think that when explicitly specifying an ip address, mongo should not try to convert it to a host name.



 Comments   
Comment by Jozef Sovcik [ 13/Sep/10 ]

I'm sorry. My fault.
In one /etc/hosts file I had a hostname 'localhost' configured also for an external interface.

So it works as designed

There is a small issue with rs.initiate(), which obviously does not work correctly in this environment without providing initial rs config.

My steps (which proved it works):
1) create 3 VMs with no DNS configured and /etc/hosts containing row '127.0.0.1 localhost' only
2) run mongod on all three of them with --replSet set to 'testrs'
3) open mongo shell on one of them
4) create config = {_id : 'testrs', members: [ {_id : 0, host : <ip_address>}] }
5) perform rs.initiate(config)
6) rs.add('<ip_address2>')
7) rs.add(<ip_address3>')
8) ... all works

Sorry for bothering and thanks for help.

Comment by Jozef Sovcik [ 13/Sep/10 ]

OK, will try to prepare steps.

Comment by Kyle Banker [ 13/Sep/10 ]

Can you provide some more details, such as a test case, some log files or your shell session? This ought to be working.

If this is truly a driver issue, please relevant logs / scripts.

Generated at Thu Feb 08 02:58:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.