can't sharding on MongoDB

20 views
Skip to first unread message

bth...@gmail.com

unread,
Jul 15, 2012, 5:20:51 AM7/15/12
to mongod...@googlegroups.com
I have a cluster with 2 prelica set
replica set r1: db1, db2 same in 3 servers
replica set r2: db3, db4 same in 2 servers
i sharding on db1 with 2 chunk, 1 chunk on r1 and the other on r2, all writes and read is good by using mongos
and then i connect to mongos and i want to change chunks on db1, i deleted all chunks on db1 in config,chunks
and then i can't run command db.runCommand({enablesharding:"db1"}) => error "already enabled"
and i can't run another command db.runCommand({shardCollection:"db1.test1",key:{a:1}}) => error "already sharded"

And when i finish sharding, how can i change range of chunks in my cluster, spit or merge???
Can you give me some advice!!
Thanks
Phuc

Max Schireson

unread,
Jul 15, 2012, 11:16:59 AM7/15/12
to mongod...@googlegroups.com

Take a look here http://www.mongodb.org/display/DOCS/Splitting+Shard+Chunks for info on setting up your own split points. Other doc explains the balancer and when it migrates chunks for example.

-- Max

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

Max Schireson

unread,
Jul 15, 2012, 11:25:38 AM7/15/12
to mongod...@googlegroups.com

I should add that the intention is that these operations be managed automatically under most circumstances other than initial bulk loads. Please see http://www.mongodb.org/display/DOCS/Sharding+Administration to learn about that.

-- Max

Reply all
Reply to author
Forward
0 new messages