Sunday 15 June 2014

mongodb - Cannot query a shard collection -


I have created a shard with two replica sets, each replica set has 3 mongod server and They work fine Also, mangos server seems to be working here:

  mangos> Sh.status () --- sharding status --- sharding version: {"_ id": 1, "version": 3, "minCompatibleVersion": 3, "CurrentVersion": 4, "cluster": ObjectId ("51c5be46dda9b0a5cd83ad64 "}} Fragments: {" _ id ":" S1 "," host ":" S1 / RemotePC_1: 27017, RemotePC_1: 27018, RemotePC_1: 27019 "} {" _ id ":" s2 "," Host {"_ Id": "administrator", "split": false, "primary": "config"} {"_ id": "s2 / RemotePC_2: 27017, RemotePC_2: 27018, RemotePC_2: 27019"} database: {"_ id" "Student", "divide" : 1}} - & gt; & Gt; {"_id": {"$ maxKey": 1}} at: s1 {"t": 1, "i": 0}   

But, when I enter any command On the student.grades collection, I get this error:

  Mongos> db.grades.count () Sat Jun 22 20: 07: 00. 9 68 JavaScript execution failed: {"code": 10,429, "OK": failed count 0, "errmsg": "Exception: RemotePC_2: 27017 {setShardVersion host failed in oldVersion: Timestamp 0 | 0, oldVersionEpoch: ObjectId ('000000000000000000000000'), errmsg: \ "Exception: All servers can not be accessed / down from when query: MyPC: 57017, MyP C: 57,018, my-PC: 57,019 \ ", code: 8002, OK: 0.0}"} src / opportunities / shell / query.js: L180   

All members of the cluttered cluster should be able to reach all other members.

You are running mangos on your local machine, it can access the configurable server that runs on your local machine, and it can access shards running on remote machines Is there.

However, if the shards on remote machines are unable to access the config server on your local machine, they will be able to work properly within the cluster (and this is an error message < P>

To resolve this solution, mangos will be specified as the hostname with the config server argument ( - configdb ) "Remote- Pc "routerable (aka searchable) if you have multiple mangos process You must do this for all those received are shown.

No comments:

Post a Comment