WWW.DBVERSITY.COM
WWW.DBVERSITY.COM
Menu
  • Home
  • About us
  • Discussions
  • Login / Register
Welcome to the world of Database Technologies
Browse: Home » removeShard

How to drain a MongoDB Shard

January 6, 2016 · by dbversity · in MongoDB

use dbversity db.dbfry.ensureIndex( { user_id : 1 }, { unique : true }) sh.enableSharding(“dbversity”) sh.shardCollection(“dbversity.dbfry”, {“user_id”:1}) sh.startBalancer() sh.getBalancerState() sh.isBalancerRunning() use dbversity for(var i = 1; i <= 100000 ; i++){db.dbfry.insert({“user_id” : i , “name” : “bulk-inserts”, ” Iteration: ” :…

How to remove a shard from the MongoDB sharded cluster

December 19, 2015 · by dbversity · in MongoDB

Removes a shard from a sharded cluster. When you run removeShard, MongoDB first moves the shard’s chunks to other shards in the cluster. Then MongoDB removes the shard. [root@dbversity bin]# ./mongo –port 10000 MongoDB shell version: 2.4.11 connecting to: 127.0.0.1:10000/test…

Categories

Categories

Copyright © 2025 WWW.DBVERSITY.COM

Powered by WordPress and Origin