Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-1161

Mongo Sharding not working

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • None
    • None
    • None
    • None
    • Production
    • v3.2

    Description

      I have implemented the mongo sharding at collections level using this link:
      https://www.digitalocean.com/community/tutorials/how-to-create-a-sharded-cluster-in-mongodb-using-an-ubuntu-12-04-vps

      After this, if i run sh.status():

      sharding version:

      { "_id" : 1, "minCompatibleVersion" : 5, "currentVersion" : 6, "clusterId" : ObjectId("56b5a2fd9ed95df47dcd6cae") }

      shards:

      { "_id" : "shard0000", "host" : "111.145.102.123:27017" } { "_id" : "shard0001", "host" : "111.145.129.221:27017" } { "_id" : "shard0002", "host" : "111.145.129.22:27017" } { "_id" : "shard0003", "host" : "111.145.147.58:27017" }

      balancer:
      Currently enabled: yes
      Currently running: no
      Failed balancer rounds in last 5 attempts: 0
      Migration Results for the last 24 hours:
      16457 : Failed with error 'aborted', from shard0001 to shard0000

      sh.getBalancerState() returns true

      Every record is saving in primary shard server only. How can i distribute the data in the 4 shard servers?

      I ran sh.startBalancing(100,100), but I'm getting the following error:

      assert.soon failed, msg:Waited too long for lock balancer to change to state undefined
      Error: assert.soon failed, msg:Waited too long for lock balancer to change to state undefined
      at Error (<anonymous>)
      at doassert (src/mongo/shell/assert.js:11:14)
      at Function.assert.soon (src/mongo/shell/assert.js:189:13)
      at Function.sh.waitForDLock (src/mongo/shell/utils_sh.js:166:12)
      at Function.sh.waitForBalancer (src/mongo/shell/utils_sh.js:260:12)
      at Function.sh.startBalancer (src/mongo/shell/utils_sh.js:141:8)
      at (shell):1:4
      2016-05-04T00:01:34.745+0530 E QUERY Error: assert.soon failed, msg:Waited too long for lock balancer to change to state undefined
      at Error (<anonymous>)
      at doassert (src/mongo/shell/assert.js:11:14)
      at Function.assert.soon (src/mongo/shell/assert.js:189:13)
      at Function.sh.waitForDLock (src/mongo/shell/utils_sh.js:166:12)
      at Function.sh.waitForBalancer (src/mongo/shell/utils_sh.js:260:12)
      at Function.sh.startBalancer (src/mongo/shell/utils_sh.js:141:8)
      at (shell):1:4 at src/mongo/shell/assert.js:13

      Attachments

        Activity

          People

            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            vmabhi453@gmail.com Abhimanyu BV
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: