Wednesday, September 26, 2012

Mongodb "errmsg" : "can't use localhost as a shard since all shards need to communiacate

when running db.runCommand({addShard:"rs0/localhost:10001,localhost:10002,localhost:10003"})

get an error meessage:

errmsg: cant use local host as a shard since all shards need to communicate. either use all shards and configdbs in localhost or all in actual IPs

Mongodb uses the contents of etc/hosts which is:


[dc@localhost ~]$ cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost

Use localhost.localdomain instead of localhost.


No comments:

Post a Comment