# MongoServerError：均衡器移动块失败：块 { ns: "test.users", min: { _id: 1 }, max: { _id: 100 } } 无法移动

- **ID:** `mongodb/balancer-failed-to-move-chunk`
- **领域:** mongodb
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 78%

## 根因

均衡器无法移动块，因为目标分片存储不足或块大小超过最大块大小。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| mongodb-5.0 | active | — | — |
| mongodb-6.0 | active | — | — |
| mongodb-7.0 | active | — | — |

## 解决方案

1. ```
   Check target shard disk usage with db.adminCommand({ listShards: 1 }) and add more shards or free up space on the target.
   ```
2. ```
   Reduce chunk size temporarily via mongos config: use sh.enableAutoSplit() and sh.setBalancerState(true) with smaller chunkSize (e.g., 64MB) to split large chunks before migration.
   ```
3. ```
   Manually move the chunk using sh.moveChunk() with a specific shard key range to force migration during low traffic.
   ```

## 无效尝试

- **** — Increasing chunkSize to a very large value can cause uneven data distribution and balancer inefficiency. (50% 失败率)
- **** — Disabling the balancer entirely stops automatic data redistribution, leading to uneven shard loads. (50% 失败率)
- **** — Manually splitting chunks without considering data distribution can create many small chunks that strain the balancer. (50% 失败率)
