[SERVER-1535] don't let you add SYNC as a shard (WAS: Failed to insert data into shard, which is a replica set) Created: 02/Aug/10 Updated: 12/Jul/16 Resolved: 03/Aug/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication, Sharding |
| Affects Version/s: | 1.5.7 |
| Fix Version/s: | 1.5.8 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Che-Ching Wu | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | Linux |
| Participants: |
| Description |
|
I built up a system like this: Then create one database and one collection, that shard was enabled. |
| Comments |
| Comment by Che-Ching Wu [ 04/Aug/10 ] |
|
MongoDB shell version: 1.5.7 mytest.repl chunks: } -->> { "_id" : ObjectId("4c578d083a4f3f1b2b000000") }on : shard0001 { "t" : 200 0, "i" : 2 }{ "_id" : ObjectId("4c578d083a4f3f1b2b000000") } -->> { "_id" : ObjectId("4c578d0f3a4f3f1b2b000268") }on : shard0001 { "t" : 38000, "i" : 7 }{ "_id" : ObjectId("4c578d0f3a4f3f1b2b000268") } -->> { "_id" : ObjectId("4c578d143a4f3f1b2b000443") }on : shard0001 { "t" : 38000, "i" : 9 }...... { "_id" : ObjectId("4c578f423a4f3f1b2b00b1d1") } -->> { "_id" : ObjectId("4c578f553a4f3f1b2b00b933") }on : shard0000 { "t" : 38000, "i" : 5 }{ "_id" : ObjectId("4c578f553a4f3f1b2b00b933") } -->> { "_id" : ObjectId("4c578f733a4f3f1b2b00c1b2") }on : shard0000 { "t" : 42000, "i" : 0 }{ "_id" : ObjectId("4c578f733a4f3f1b2b00c1b2") } -->> { "_id" : ObjectId("4c578f883a4f3f1b2b00c914") }on : shard0000 { "t" : 42000, "i" : 1 }{ "_id" : ObjectId("4c578f883a4f3f1b2b00c914") } -->> { "_id" : ObjectId("4c578f983a4f3f1b2b00d076") }on : shard0000 { "t" : 42000, "i" : 2 }{ "_id" : ObjectId("4c578f983a4f3f1b2b00d076") } -->> { "_id" : ObjectId("4c578fa93a4f3f1b2b00d7d8") }on : shard0000 { "t" : 42000, "i" : 3 }{ "_id" : ObjectId("4c578fa93a4f3f1b2b00d7d8") } -->> { "_id" : ObjectId("4c578fe33a4f3f1b2b00e058") }on : shard0000 { "t" : 43000, "i" : 0 }{ "_id" : ObjectId("4c578fe33a4f3f1b2b00e058") } -->> { "_id" : { $maxKey : 1 }} on : shard0000 { "t" : 43000, "i" : 1 } { "_id" : "test", "partitioned" : false, "primary" : "shard0001" }> bye |
| Comment by Eliot Horowitz (Inactive) [ 03/Aug/10 ] |
|
Can you send the output of db.printShardingStatus |
| Comment by Che-Ching Wu [ 03/Aug/10 ] |
|
Please check mongod2.log out. |
| Comment by Eliot Horowitz (Inactive) [ 03/Aug/10 ] |
|
Can you attach mongod logs as well? |
| Comment by Che-Ching Wu [ 03/Aug/10 ] |
|
Yes, I stopped all services and cleaned all data. Then restarted all of them. The version I use is still 1.5.7. |
| Comment by Eliot Horowitz (Inactive) [ 03/Aug/10 ] |
|
Did you start from scratch? |
| Comment by Che-Ching Wu [ 03/Aug/10 ] |
|
This time I got another error after following your instructions to start. Here they are: *mongos* 0x507de1 0x5e6b9e 0x5ef895 0x5efa87 0x61096f 0x6137f5 0x63ca8b 0x647a29 0x55ad12 0x66be20 0x337f6064a7 0x337ead3c2d
|
| Comment by auto [ 03/Aug/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: can't use SYNC cluster a shard |
| Comment by Eliot Horowitz (Inactive) [ 03/Aug/10 ] |
|
You need to add a repica set shard as name/vm-shard21:27018, vm-shard22:27018, vm-arbiter2:27018 will enforce this |
| Comment by Che-Ching Wu [ 03/Aug/10 ] |
|
I use 1.5.7 Here are commands I ran. /opt/mongodb/bin/mongod --fork --dbpath /var/lib/mongo/ --logpath /var/log/mongo/mongod.log --logappend --rest -shardsvr --replSet shard1/vm-shard11:27018,vm-shard12:27018 echo 'cfg = {_id: "shard1", members:[{_id: 0, host:"vm-shard11:27018"},{_id: 1, host:"vm-shard12:27018"}]}; rs.initiate(cfg);' | /opt/mongodb/bin/mongo localhost:27018 /opt/mongodb/bin/mongod --fork --dbpath /var/lib/mongo/ --logpath /var/log/mongo/mongod.log --logappend --rest -shardsvr --replSet shard2/vm-shard21:27018,vm-shard22:27018,vm-arbiter2:27018 echo 'cfg = {_id: "shard2", members:[{_id: 0, host:"vm-shard21:27018"},{_id: 1, host:"vm-shard22:27018"},{_id: 2, host:"vm-arbiter2:27018", "arbiterOnly": true}]}; rs.initiate(cfg);' | /opt/mongodb/bin/mongo localhost:27018 /opt/mongodb/bin/mongod --fork --dbpath /var/lib/mongo/ --logpath /var/log/mongo/mongod.log --logappend --rest -configsvr /opt/mongodb/bin/mongos --fork --configdb vm-config1:27019 --logpath /var/log/mongo/mongos.log --logappend echo 'use admin; db.runCommand( { addshard : "vm-shard11:27018,vm-shard12:27018"}); db.runCommand( { addShard : "vm-shard21:27018, vm-shard22:27018, vm-arbiter2:27018"});' And the sharding status: shards: wfbsh.repl chunks: } -->> { "_id" : ObjectId("4c568b063a4f3f1313000000") }on : shard0000 { "t" : 4000, "i" : 0 }{ "_id" : ObjectId("4c568b063a4f3f1313000000") } -->> { "_id" : ObjectId("4c568be13a4f3f134d00005e") }on : shard0000 { "t" : 4000, "i" : 1 }{ "_id" : ObjectId("4c568be13a4f3f134d00005e") } -->> { "_id" : ObjectId("4c5694e83a4f3f139f0001da") }on : shard0000 { "t" : 4000, "i" : 2 }{ "_id" : ObjectId("4c5694e83a4f3f139f0001da") } -->> { "_id" : { $maxKey : 1 }} on : shard0000 { "t" : 4000, "i" : 3 } |
| Comment by Eliot Horowitz (Inactive) [ 02/Aug/10 ] |
|
Can you provide all the startup lines and output of db.printShardingStatus |