我连接到远程分片数据库群集。它连接OK,但是如果我插入文档我会收到错误:
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 }
在MongoDB登录中:
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 }
为什么我会收到此错误?有原因吗?
答案 0 :(得分:0)
当我有两个实际上是一个mongod的碎片时发生在我身上: {" _id" :" shard0000"," host" :" localhost:27027" } {" _id" :" shard0001"," host" :" 127.0.0.1:27027" }
当我删除第二个分片时,错误就消失了。