0

I have a master and slave on Linux (centOS 7). The rs.initiate(cfg) was done, but its shows the below output when trying to add secondary via rs.add:

genienational:PRIMARY> rs.add("localhost.localdomain:27017")  
{  
     "ok" : 0,  
     "errmsg" : "The hosts test.appraisergenie.com:27017 a  
nd localhost.localdomain:27017 all map to this node new co  
nfiguration version 2 for replica set genienational",  
     "code": 103  
}  
genienational:PRIMARY> use local  
switched to db local  

MongoDB

How do I resolve?

Version: The master is on Enterprise. I think 3.2 and the slave is on 2.6.

3
  • are these all mongo running on same machine? If yes, what are the different ports they are running on? Commented Apr 21, 2016 at 5:07
  • I guess adding same port of same machine you are using.. Commented Apr 21, 2016 at 10:01
  • Please change the port number which should work Commented Aug 21, 2019 at 7:13

2 Answers 2

1

The error message in your screenshot indicates you are trying to add identical members to your replica set under different names:

"The hosts x:27017 and y:27017 all map to this node in new configuration".

If you want to configure multiple replica set members on a single machine for testing purposes, all members need to use different ports and/or IP addresses.

Version: The master is on Enterprise. I think 3.2 and the slave is on 2.6.

Mixed-version replica sets are only supported for consecutive major versions (i.e. 3.2 and 3.0) and expected to be used transiently during a rolling upgrade to a new major version of MongoDB. A mixed replica set with 3.2 and 2.6 members is definitely not supported.

1

MongoDB uses the hostnames or IP addresses to identify replica set members.

It seems: test.appraisergenie.com and localhost.localdomain both resolve to the same IP address. You're trying to add both as separate members, MongoDB will reject the configuration because it sees them as duplicates.

Solution: Install a VM and setup a new mongo node in there and try again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.