1

I am using mongo 2.6.7 I deploy a sharding cluster follow the guide: http://docs.mongodb.org/manual/tutorial/deploy-shard-cluster/

My sharding cluster include: - two replica sets (one primary + one secondary for each replica set) - three config servers - two mongos

I make sure sh.getBalancerState() is true. I prepared a amount of data about 1G. When I recheck by sh.status()

--- Sharding Status --- 
  sharding version: {
        "_id" : 1,
        "version" : 4,
        "minCompatibleVersion" : 4,
        "currentVersion" : 5,
        "clusterId" : ObjectId("54c2644bf2759e71913a3b59")
}
  shards:
        {  "_id" : "test_repl_set",  "host" : "test_repl_set/mongo1.example.com:27017,mongo2.example.com:27017" }
        {  "_id" : "test_repl_set1",  "host" : "test_repl_set1/mongo3.example.com:27017,mongo4.example.com:27017" }
  databases:
        {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
        {  "_id" : "linux",  "partitioned" : true,  "primary" : "test_repl_set" }
                linux.components
                        shard key: { "_id" : 1 }
                        chunks:
                                test_repl_set   1
                        { "_id" : { "$minKey" : 1 } } -->> { "_id" : { "$maxKey" : 1 } } on : test_repl_set Timestamp(1, 0) 
                linux.distro
                        shard key: { "name" : 1 }
                        chunks:
                                test_repl_set   1
                        { "name" : { "$minKey" : 1 } } -->> { "name" : { "$maxKey" : 1 } } on : test_repl_set Timestamp(1, 0) 
        {  "_id" : "test",  "partitioned" : false,  "primary" : "test_repl_set1" }
        {  "_id" : "testdata",  "partitioned" : false,  "primary" : "test_repl_set1" }
        {  "_id" : "testshard",  "partitioned" : true,  "primary" : "test_repl_set1" }
                testshard.testdata
                        shard key: { "x" : 1 }
                        chunks:
                                test_repl_set1  1
                        { "x" : { "$minKey" : 1 } } -->> { "x" : { "$maxKey" : 1 } } on : test_repl_set1 Timestamp(1, 0) 

I only get data of testshard from test_repl_set and there is no data of testshard from test_repl_set1. I don't know why testshard is not being migrated and why mongos tell me there is only one chunk on test_repl_set1 ?

  • Can you share how you prepare your data? and a sample record? – Antonios Jan 31 '15 at 13:22
  • Thank you. I find out the cause. Some server has date time is not correct. This is my mistake because they are virtual machine. I reverted snapshot before deploying sharding cluster. I just need install ntpd to synchronize date time. The synchronization is necessary for balancing. – Luke Nguyen Feb 2 '15 at 8:25
  • Cool, +1 that you share the solution. – Antonios Feb 2 '15 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.