【问题标题】:Using mongo updateZoneKeyRange to reduce a zone range使用 mongo updateZoneKeyRange 缩小区域范围
【发布时间】:2020-12-21 15:43:12
【问题描述】:

我正在尝试更新名为 hot 的现有区域范围

{ "id" : 1507520572 }, { "id" : { "$maxKey" : 1 }

使用

sh.updateZoneKeyRange('db.collection', { id: 1507520572 }, { id: 9999999999 }, 'hot'),

但我得到了错误

Zone range: { id: 1507520572.0 } -->> { id: 9999999999.0 } on hot is overlapping with existing: { id: 1507520572 } -->> { id: MaxKey } on hot.

我的计划是创建一个从9999999999MaxKey 的新区域。我怎样才能做到这一点?

【问题讨论】:

    标签: mongodb sharding


    【解决方案1】:

    我必须先删除之前的范围

    db.runCommand({ updateZoneKeyRange: 'db.collection', min: {id: 1507520572}, max: {id: MaxKey}, zone: null }),

    然后它让我创建新的范围。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-12-03
      • 1970-01-01
      • 1970-01-01
      • 2015-06-09
      • 2019-07-07
      • 1970-01-01
      • 2021-09-24
      相关资源
      最近更新 更多