patternMinor
MongoDB Replica Set: Can't Add Member/Connect
Viewed 0 times
canconnectreplicamongodbmembersetadd
Problem
I'm building a MongoDB replicaset w/ three Ubuntu 14 servers.
I'm connected to the primary server and authenticated w/
When I run
I've tried using the IP address, external hostname, and internal hostname.
I have
What am I doing wrong?
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 expectsI'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?
Solution
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.
Context
StackExchange Database Administrators Q#68359, answer score: 2
Revisions (0)
No revisions yet.