1
votes

I connect to remote sharded DB cluster. It connects OK, but if I insert document I get error:

  File "/home/df/SlickJump/WishNuServer/server.py", line 522, in POST
    unit = wndb.pages.find_one({'pagehash': thash, 'version': Version})
  File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 598, in find_one
    for result in self.find(spec_or_id, *args, **kwargs).limit(-1):
  File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 814, in next
    if len(self.__data) or self._refresh():
  File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 763, in _refresh
    self.__uuid_subtype))
  File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 720, in __send_message
    self.__uuid_subtype)
  File "/usr/local/lib/python2.7/dist-packages/pymongo/helpers.py", line 105, in _unpack_response
    error_object["$err"])

OperationFailure: database error: setShardVersion failed host: db1s0:27017 { errmsg: "exception: remote client 5.101.101.150:46117 tried to initialize this host (db1
7) as shard shard0000, but shard name was previously initialized...", code: 13298, ok: 0.0 } 

In MongoDB logs in looks:

2014-07-09T13:26:40.666+0000 [conn11] Assertion failed while processing query op for wishnudb.pages :: caused by :: 10429 setShardVersion failed host: db1s0:27017 { 
 "exception: remote client 5.101.101.150:46219 tried to initialize this host (db1s0:27017) as shard shard0000, but shard name was previously initialized...", code: 1
k: 0.0 }

Why do i get this error? There is a reason?

1
It is trying to set a shard name that has already been inited on that cluster. Can you give us an sh.status?Sammaye
sh.status gives: --- Sharding Status --- sharding version: { "_id" : 1, "version" : 4, "minCompatibleVersion" : 4, "currentVersion" : 5, "clusterId" : ObjectId("524baa2c194e66ba299214dc") } shards: { "_id" : "shard0000", "host" : "db1s0:27017" } { "_id" : "shard0001", "host" : "db1s1:27017" } databases: ...Dmitry

1 Answers

0
votes

It happened to me when I had two shards that are actually one mongod: { "_id" : "shard0000", "host" : "localhost:27027" } { "_id" : "shard0001", "host" : "127.0.0.1:27027" }

When I removed the second shard, the error gone.