2

I'm building a MongoDB replicaset w/ three Ubuntu 14 servers.

I'm connected to the primary server and authenticated w/ userAdminAnyDatabase and clusterAdmin privileges.

When I run rs.add(xx.xx.xx.xx:27017), I get this error:

exception: set name does not match the set name host xx.xx.xx.xx:27017 expects

I've tried using the IP address, external hostname, and internal hostname.

I have xx.xx.xx.xx rs2 in my /etc/hosts file and use rs2 in the config file of the server I want to add (replSet=rs2). No matter what I try, it says the name doesn't match.

What am I doing wrong?

  • 1
    Fixed it! The issue was a result of having different values for replSet in /etc/mongod.conf. I thought the servers should be named uniquely -- this is incorrect. Each server in the replicaset must have the same value for replSet. – okoboko Jun 17 '14 at 0:47
1

The issue was a result of having different values for replSet in /etc/mongod.conf. I thought the servers should be named uniquely -- this is incorrect. Each server in the replicaset must have the same value for replSet.

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.