Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Pre-splitting and manual chunks balancing
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
mthenw  
View profile  
 More options Sep 3 2012, 9:20 am
From: mthenw <maciej.winni...@gmail.com>
Date: Mon, 3 Sep 2012 06:20:23 -0700 (PDT)
Local: Mon, Sep 3 2012 9:20 am
Subject: Pre-splitting and manual chunks balancing

Hi,

I need some clarification about sharding, pre-splitting and chunks
balancing. I have 2 shards with balancer turned off and presplit set

db.runCommand( { split : "example.users" , middle : { _id : 5000 } } )

I assume that every document with _id less than 5000 will go to shard 1 and
every document with _id greater than 5000 will go to shard 2.

My question is:
if I want to add another shard first I need to move chunks manually and
then change split options or changing split options will cause automatic
chunk migration?

PS I don't want use balancer because it slows down while importing large
data sets.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Hernandez  
View profile  
 More options Sep 3 2012, 10:41 am
From: Scott Hernandez <scotthernan...@gmail.com>
Date: Mon, 3 Sep 2012 10:40:55 -0400
Local: Mon, Sep 3 2012 10:40 am
Subject: Re: [mongodb-user] Pre-splitting and manual chunks balancing
If you aren't using the balancer then splitting does not result in
anything moving shards. Splitting chunks is a completely logical
operation -- you need to then move the chunks to distribute them.

You may want to disable the balancer while importing, and then enable
it later to evenly distribute the chunks after the import.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mthenw  
View profile  
 More options Sep 4 2012, 3:46 am
From: mthenw <maciej.winni...@gmail.com>
Date: Tue, 4 Sep 2012 00:46:29 -0700 (PDT)
Local: Tues, Sep 4 2012 3:46 am
Subject: Re: [mongodb-user] Pre-splitting and manual chunks balancing

Thanks for your answer and I have another two.

Is it a good practice to turn on balancer after large data import and turn
it off before another import?

Documentation says that balancer window must be sufficient to complete the
migration. What happens when balancer will not migrate all data?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam C  
View profile  
 More options Sep 4 2012, 3:59 am
From: Adam C <ad...@10gen.com>
Date: Tue, 4 Sep 2012 00:59:35 -0700 (PDT)
Local: Tues, Sep 4 2012 3:59 am
Subject: Re: [mongodb-user] Pre-splitting and manual chunks balancing

> Is it a good practice to turn on balancer after large data import and turn
> it off before another import?

That depends - if your cluster has the capacity to both balance and do the
import then that is preferred, since the writes are more likely to be more
evenly distributed and the data is balanced in increments rather than a
large batch (which can take a long time - each shard can take part in only
a single migration at a time).  If the import is causing extremely heavy
load, then turning off the balancer can help by freeing up the resources
used to balance.  It's a judgement call based on your cluster, your needs
etc.

 Documentation says that balancer window must be sufficient to complete the

> migration. What happens when balancer will not migrate all data?

The balancer will run until all in-flight migrations are complete, then
stop - your data will remain in that state until you turn the balancer on
again.  If you do another import in the meantime, then the data will become
more unbalanced and you will essentially repeat this pattern forever (i.e.
your data will never be balanced).  Hence the note in the docs - it won't
break anything per se, but your data will remain unbalanced from a shard
perspective.  You can see the chunk distribution with sh.status() from the
shell.

Adam


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »