2017-03-03 80 views
0

我创建了一个碎片,状态似乎不错MongoDB的碎片文件插入

--- Sharding Status --- 
    sharding version: { 
    "_id" : 1, 
    "minCompatibleVersion" : 5, 
    "currentVersion" : 6, 
    "clusterId" : ObjectId("58aefb3181741b40c635c327") 
} 
    shards: 
    { "_id" : "repl1", "host" : "repl1/prod-mongo-repl1:27017,prod-mongo-repl1:27018,prod-mongo-repl1:27019", "state" : 1 } 
    { "_id" : "repl2", "host" : "repl2/prod-mongo-repl2:27017,prod-mongo-repl2:27018,prod-mongo-repl2:27019", "state" : 1 } 
    active mongoses: 
    "3.4.2" : 1 
autosplit: 
    Currently enabled: yes 
    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 
    databases: 
    { "_id" : "mydatabase", "primary" : "repl1", "partitioned" : true } 
     mydatabase.extract_purchases 
      shard key: { "month" : 1, "year" : 1 } 
      unique: false 
      balancing: true 
      chunks: 
       repl1 1 
      { "month" : { "$minKey" : 1 }, "year" : { "$minKey" : 1 } } -->> { "month" : { "$maxKey" : 1 }, "year" : { "$maxKey" : 1 } } on : repl1 Timestamp(1, 0) 

但现在,尝试插入或事件只是运行一个find命令不能工作,我有这样的消息

尝试:

db.extract_purchases.insert({year:2017, month:1}) 

结果是

WriteResult({ 
    "nInserted" : 0, 
    "writeError" : { 
     "code" : 82, 
     "errmsg" : "no progress was made executing batch write op in mydatabase.extract_purchases after 5 rounds (0 ops completed in 6 rounds total)" 
    } 
}) 
几秒/分钟后

我不知道该怎么办...我在一个“mongos”外壳

非常感谢您的帮助!

回答

0

我们在生产中有碎片,我从未见过这个错误。

您可以检查每个副本集(配置,编号& repl2)的健康状况,以确保每个副本都有一个主副本? (你必须直接连接到每个副本集的成员来检查,你不能通过蒙哥马斯)

你也可以检查初选的日志(repl1特别是因为有当你尝试插入或读取数据时,现在只有1块)?

你还可以尝试在同一个数据库的未加工的集合中写入吗?和另一个数据库?

Henri-Maxime(来自里尔,有人派我来了...)

+0

嗨!感谢您的帮助:我可以写在unsharded集合。问题出现在为集合激活分片之后。我在每个配置上都有一个Primary,repl1 && repl2 ... – benjamin

+0

嗨,我今天重新配置了一个完整的碎片infra,问题是一样的......(Je peux te contacter?entre lillois?) – benjamin

+0

是的,米试图达到你,但它似乎并没有工作;) –