Search code examples
mongodbshardingreplicaset

None of the hosts for the replica set could be contacted


I am having a problem with my sharded cluster.

I setup a new cluster, with 1 router, 2 replica set shards(2 nodes each), and a single 3 cluster config cluster.

I believe I setup everything correctly, created collections, added indexes, but when I go to insert or query data into the collections, I get the error:

Error: error: {
    "ok" : 0,
    "errmsg" : "None of the hosts for replica set configReplSet could be contacted.",
    "code" : 71
}

configReplSet is my config replica set. It is accessible from the box, I was able to use a mongo shell to log into the primary of the RS.

Any help into what would cause this error would be greatly appreciated.

Here is my sh.status()

--- Sharding Status ---
sharding version: {
    "_id" : 1,
    "minCompatibleVersion" : 5,
    "currentVersion" : 6,
    "clusterId" : ObjectId("58a761728dfc0e1090b7c592")
}
shards:
    {  "_id" : "rs0",  "host" : "rs0/mdbshard-b1:27017,mdbshard-b1rep:27017" }
    {  "_id" : "rs1",  "host" : "rs1/mdbshard-b2rep:27018,mdbshard-b2:27017" }
active mongoses:
    "3.2.12" : 1
balancer:
    Currently enabled:  yes
    Currently running:  no
    Failed balancer rounds in last 5 attempts:  0
    Migration Results for the last 24 hours:
            No recent migrations

and my shard router config file

replication:
    localPingThresholdMs: 15

sharding:
    autoSplit: true
    configDB: "configReplSet/mdbcfg-b1:27019,mdbcfg-b2:27019,mdbcfg-b3:27019"
    chunkSize: 64

processManagement:
     fork: true

systemLog:
    destination: file
    path: "/var/log/mongodb/mongodb.log"
    logAppend: true

Please let me know if you need any other information, I would be happy to provide it.


Solution

  • Check if this helps Relevant Error