while adding secondary member in replica set, i get following error:
"Either all host names in a replica set configuration must be localhost references, or none must be; found 1 out of 2"
my first machine configuration is:
Mongodb – mongo db-Either all host names in a replica set configuration must be localhost references, or none must be; found 1 out of 2
mongodb
Related Question
- MONGODB primary became secondary after servers restart
- Mongodb – MMS is assigning same alias to two data nodes of different shards and replicasets
- MongoDB automatic failover between 2 data centers
- Mongodb – Read concern level of majority error while upgrading Sharded Cluster from 3.2 to 3.4
- Mongodb – Could not add Replica Set to MongoDB Shard
- MongoDB replica set over ssh tunnels
- Mongodb – Outage due to Replica Set Protocol Version upgrade
Best Answer
You can have all replica set nodes in the same physical computer (localhost), but in different ports! (node1:27017, node2:27027, ...)
You CANNNOT have different RS nodes:
So, you need to build your replica set using IP-addresses.