Mongodb平衡非常慢

Mongodb平衡非常慢,mongodb,sharding,Mongodb,Sharding,我们的群集中的平衡速度非常慢。在我们的日志中,似乎迁移进展几乎没有取得进展: 2016-01-25T22:21:15.907-0600 I SHARDING [conn142] moveChunk data transfer progress: { active: true, ns: "music.fav_artist_score", from: "rs1/MONGODB01-SRV:27017,MONGODB05-SRV:27017", min: { _id.u: -9159729253516

我们的群集中的平衡速度非常慢。在我们的日志中,似乎迁移进展几乎没有取得进展:

2016-01-25T22:21:15.907-0600 I SHARDING [conn142] moveChunk data transfer progress: { active: true, ns: "music.fav_artist_score", from: "rs1/MONGODB01-SRV:27017,MONGODB05-SRV:27017", min: { _id.u: -9159729253516193447 }, max: { _id.u: -9157438072680830290 }, shardKeyPattern: { _id.u: "hashed" }, state: "clone", counts: { cloned: 128, clonedBytes: 12419, catchup: 0, steady: 0 }, ok: 1.0 } my mem used: 0
2016-01-25T22:21:16.932-0600 I SHARDING [conn142] moveChunk data transfer progress: { active: true, ns: "music.fav_artist_score", from: "rs1/MONGODB01-SRV:27017,MONGODB05-SRV:27017", min: { _id.u: -9159729253516193447 }, max: { _id.u: -9157438072680830290 }, shardKeyPattern: { _id.u: "hashed" }, state: "clone", counts: { cloned: 128, clonedBytes: 12419, catchup: 0, steady: 0 }, ok: 1.0 } my mem used: 0
2016-01-25T22:21:17.957-0600 I SHARDING [conn142] moveChunk data transfer progress: { active: true, ns: "music.fav_artist_score", from: "rs1/MONGODB01-SRV:27017,MONGODB05-SRV:27017", min: { _id.u: -9159729253516193447 }, max: { _id.u: -9157438072680830290 }, shardKeyPattern: { _id.u: "hashed" }, state: "clone", counts: { cloned: 128, clonedBytes: 12419, catchup: 0, steady: 0 }, ok: 1.0 } my mem used: 0
还有,当我们分享一个新的收藏时。它最初仅从同一主副本集中的8个块开始。它不会将块迁移到其他碎片


我们的配置是在一个副本集中配置4个副本集(主副本集、辅助副本集、仲裁副本集)和3个副本集。在MongoDB分片中,sh.getBalancerState()和sh.isBalancerRunning()都返回true

,性能取决于为分片数据库选择的键。由于块始终存储在单个节点上,因此您选择的切分键很可能是单调递增的。为了避免这个问题,散列密钥以允许在所有碎片之间适当平衡块。使用以下命令进行散列切分

sh.shardCollection(“,{:“哈希”})