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  


How do I resolve?

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

  • are these all mongo running on same machine? If yes, what are the different ports they are running on? – Atish Apr 21 '16 at 5:07
  • I guess adding same port of same machine you are using.. – Gagan Sidhu Apr 21 '16 at 10:01
  • Please change the port number which should work – Anban Aug 21 '19 at 7:13

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.