I have done Replication in one single machine with three different port(Say 27018[master],27019,27020). Also I have done Sharding in one single machine with two different port(Say 27021,27022).
Now I have to implement replication for the sharded machine port. I need to implement replication for 27021 and 27022. How can I do this? Please help me to resolve this issue.
Steps followed :
Part 1: Set up 3 port for replication
- mongod --replSet rs0
- mongod --port 27018 --dbpath F:\Data1 --replSet rs0
- mongod --port 27020 --dbpath F:\Data2 --replSet rs0
- mongo localhost:27017
- rs.initiate()
- rs.add("ComputerName:27018")
- rs.add("ComputerName:27020")
Part 2: Now set up for sharding
- mongod --configsvr --replSet configReplSet
- mongod --port 27021 --dbpath F:\Data4 --replSet configReplSet
- mongod --port 27025 --dbpath F:\Data5 --replSet configReplSet
- mongo 127.0.0.1:27019
- rs.initiate({_id:"configReplSet",configsvr:true,members:[{_id: 0,host: "127.0.0.1:27021"},{_id:1,host: "127.0.0.1:27025"}]})
When I run this code I am getting an error:
{
"ok" : 0,
"errmsg" : "No host described in new configuration 1 for replica set configReplSet maps to this node",
"code" : 93
}
So remaining steps I am not able to execute. Any idea how can I overcome this issue?