Get the App
SLTechnology News&Howtos  ›  Database  › 

Introduction of MongoDB Sharding Balancer and examples of setting method

Shulou Source: shulou.com Published: 2022-06-01 07:50:04 11月13日 Update

Balancer introduction:

When there are multiple shards available and there are enough chunks, mongodb's balancer (balancer) migrates data to other shards.

Specify the balance between 0: 00 a.m. and 4: 00 a.m.:

On the mongos node, use config

> db.settings.update ({_ id: "balancer"}, {$set: {activeWindow: {start: "00:00", stop: "4:00"}, true)

Delete the specified time period:

On the mongos node, use config

> db.settings.update ({_ id: "balancer"}, {$unset: {activeWindow: true})

Disable Balancer:

> sh.stopBalancer ()

Enable Balancer:

> sh.startBalancer ()

Tags: Node equalization inter multiple data quantity time time period point to balancer method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi Shulou Tech Info Huawei Apple