块大小在 mongo db 日志中显示为 1 KB,即使它设置为 300 MB

vir*_*ren 5 mongodb sharding

我正在运行一个 mongo 集群。
块大小设置为 300 MB,但今天早上它在日志中显示块大小为 1024 字节。我检查了当前操作,它也显示了 1024 字节的块。我已经检查过 monos 并且所有配置服务器的块大小都是 300 MB。

请帮助我解决问题,因为它突然使我的分片设置失败。

这是 currentOp 的日志

 {
                    "opid" : "shard0000:-1945000000",
                    "active" : true,
                    "secs_running" : 0,
                    "microsecs_running" : NumberLong(72072),
                    "op" : "query",
                    "ns" : "DB20150102.locationCount",
                    "query" : {
                            "splitVector" : "DB20150102.locationCount",
                            "keyPattern" : {
                                    "articleId" : 1,
                                    "host" : 1
                            },
                            "min" : {
                                    "articleId" : { "$minKey" : 1 },
                                    "host" : { "$minKey" : 1 }
                            },
                            "max" : {
                                    "articleId" : { "$maxKey" : 1 },
                                    "host" : { "$maxKey" : 1 }
                            },
                            "maxChunkSizeBytes" : 1024,
                            "maxSplitPoints" : 2,
                            "maxChunkObjects" : 250000
                    },
                    "client_s" : "192.168.22.106:55881",
                    "desc" : "conn237027",
                    "threadId" : "0x7c6cc55db700",
                    "connectionId" : 237027,
                    "locks" : {
                            "^ibeat20150102" : "R"
                    },
                    "waitingForLock" : true,
                    "numYields" : 14,
                    "lockStats" : {
                            "timeLockedMicros" : {
                                    "r" : NumberLong(32978),
                                    "w" : NumberLong(0)
                            },
                            "timeAcquiringMicros" : {
                                    "r" : NumberLong(48048),
                                    "w" : NumberLong(0)
                            }
                    }
            },
Run Code Online (Sandbox Code Playgroud)

从设置进入

{ "_id" : "chunksize", "value" : 250 }
Run Code Online (Sandbox Code Playgroud)

主分片错误

2015-01-02T13:04:48.386+0530 [conn237049] 警告:由于键 { articleId: "", host: "abc.com" }
2015-01-02T13:04:48.3086+053 ,块大于 1024 字节[conn237049] 警告:由于 key { articleId: "0", host: "xyz.com" },块大于 1024 字节

我在同一个集合的 mongos 日志中看到了这个

2015-01-02T14:53:58.983+0530 [conn58] 警告:splitChunk 失败 - cmd: { splitChunk: "DB20150102.locationCount", keyPattern: { articleId: 1, host: 1 }, min: { articleId: MinKey, host : MinKey }, max: { articleId: MaxKey, host: MaxKey }, from: "shard0000", splitKeys: [ { articleId: "", host: "abc.com" } ], shardId: "ibeat20150102.locationCount-articleId_MinKeyhost_MinKey" , configdb: "192.168.24.192:27017,192.168.24.54:27017,192.168.24.55:27017" } 结果: { 谁: { _id: "DB20150102.location,Count:16: 50701716: 57017017017 1475849446:conn913:869542099", ts: ObjectId('54a660afdc99ecfb22d83c27'), 进程: "ibeatdb61:27017:1420185037:1475849717:14758494097:1475849718 时,新的文章 ID:1849717 拆分:{1}MinKey }" }, ok: 0.0, errmsg: "集合的元数据锁被占用" }

我采取了以下步骤:

  1. 停止在服务器上读写
  2. 停止 mongos 服务器
  3. 重新启动配置服务器。
  4. 重启 mongos 服务器
  5. 重新开始读写。

仍然出现同样的问题

我的 Primary Shard 是一个副本集配置如下:

  1. 主服务器:512 GB Ram 5 TB 物理内存。
  2. 辅助服务器 16 GB RAM 5 TB 物理服务器。
  3. 仲裁者 8 GB 内存。

我的辅助分片在其副本集中具有相同的配置。

小智 0

你是如何改变块大小的?您遵循本指南了吗?

回顾一下,人们应该:

  1. 连接到 mongos
  2. 切换到配置数据库
  3. 发出更改块大小命令:
    db.settings.save( { _id:"chunksize", value: <sizeInMB> } )

AFAIK,

warning: chunk is larger than 1024 bytes because of key ...
Run Code Online (Sandbox Code Playgroud)

不会导致分片崩溃,只会导致集群不平衡。