mongos> sh.addShard("rs0/delhivery-tech:27017,delhivery-tech:27018,delhivery-tech:27019");
{
"ok" : 0,
"errmsg" : "can't use localhost as a shard since all shards need to communicate. either use all shards and configdbs in localhost or all in actual IPs host: delhivery-tech:27017 isLocalHost:0"
}
I am running 3 instances on same host with different port. It is a testing system. I created a replica set
named rs0
. Now I am adding shard
. It shows the instances are running on localhost
. Even I tried with the ip and loopback ip also..
It would be great if anybody help me out from the same
I think you have used "localhost" when you have registered your config server ( --configdb ). Can you be sure you start your mongos with hostname? Something like
mongos --configdb delhivery-tech:27019
I invite you to look at the first paragraph in this page: http://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/
PS: When you have issue with your cluster (replica set and/or shard) it is a good thing to show the status/configuration of it. ( rs.status() or sh.status() ). This will help the people to understand your topology and give better answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With