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
MapReduce on SECONDARY in a ReplicaSet
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
  6 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
 
Mark Hansen  
View profile  
 More options Sep 29 2012, 7:50 pm
From: Mark Hansen <m...@digitalbrandmine.com>
Date: Sat, 29 Sep 2012 16:50:18 -0700 (PDT)
Local: Sat, Sep 29 2012 7:50 pm
Subject: MapReduce on SECONDARY in a ReplicaSet

Running 2.2.0 3 box replicaset with one primary.

PRIMARY is write-intensive and loads data all day long from various sources.

The 2 SECONDARY server are supposed to support the read-only end of the
application.  However, the "reads" involve lots of map-reduces that produce
large results we store in temporary collections for sorting, etc.

All was working OK in dev when we had one machine.  Now, trying to go to
production we just learned that we can't write the map-reduce results to a
temporary collection on the SECONDARY.
 (per http://www.mongodb.org/display/DOCS/MapReduce#MapReduce-Outputoptions).
 When we try (C# driver), we get Command 'mapreduce' failed: not master
(response: { "errmsg" : "not master", "ok" : 0.0 }

Can anyone suggest a solution?


 
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.
Stephen Steneker  
View profile  
 More options Sep 30 2012, 9:34 pm
From: Stephen Steneker <stephen.stene...@10gen.com>
Date: Sun, 30 Sep 2012 18:34:10 -0700 (PDT)
Local: Sun, Sep 30 2012 9:34 pm
Subject: Re: MapReduce on SECONDARY in a ReplicaSet

Hi Mark,

If you want to run Map/Reduce on a secondary you will need to use SlaveOK
and the "inline" output option, which does not require write access.  Note
that inline results are limited to the maximum document size (currently
16Mb).  To save those results to a collection you would still have to
commit via the primary, from your C# code.

If you are using the C# 1.6 driver or newer, you can use the additional
Read Preferences supported by MongoDB 2.2:
 http://docs.mongodb.org/manual/applications/replication/#read-prefere...

Depending on the sort of processing you are doing, you may be able to use a
query filter to create a more efficient incremental Map/Reduce:
 http://www.mongodb.org/display/DOCS/MapReduce#MapReduce-IncrementalMa...

Another option for read-only queries in MongoDB 2.2 is the new Aggregation
Framework:
 http://docs.mongodb.org/manual/applications/aggregation/

Cheers,
Stephen


 
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 30 2012, 10:23 pm
From: Scott Hernandez <scotthernan...@gmail.com>
Date: Sun, 30 Sep 2012 22:23:10 -0400
Local: Sun, Sep 30 2012 10:23 pm
Subject: Re: [mongodb-user] Re: MapReduce on SECONDARY in a ReplicaSet
Mark, I think you will want to watch this feature request:
https://jira.mongodb.org/browse/SERVER-4264

There are a few others that may help you in the future as well. Take a
look in Jira, or add a new one.

On Sun, Sep 30, 2012 at 9:34 PM, Stephen Steneker


 
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.
Mark Hansen  
View profile  
 More options Oct 1 2012, 9:46 am
From: Mark Hansen <m...@digitalbrandmine.com>
Date: Mon, 1 Oct 2012 06:46:04 -0700 (PDT)
Local: Mon, Oct 1 2012 9:46 am
Subject: Re: MapReduce on SECONDARY in a ReplicaSet

Stephen, thanks for the tips.  We are running 2.2.0 and also using the 1.6
C# drivers.  I'm trying to avoid hacking the map-reduce code to manage
performance and/or the 16MB limitation; but may have no choice.
 Aggregation FW looks good, but seems like it also has a 16MB in-line
limitation - is this true?


 
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.
Mark Hansen  
View profile  
 More options Oct 1 2012, 9:50 am
From: Mark Hansen <m...@digitalbrandmine.com>
Date: Mon, 1 Oct 2012 06:50:49 -0700 (PDT)
Local: Mon, Oct 1 2012 9:50 am
Subject: Re: [mongodb-user] Re: MapReduce on SECONDARY in a ReplicaSet

Yes, I just gave that a +1.  Thanks for pointing it out.


 
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.
Stephen Steneker  
View profile  
 More options Oct 1 2012, 8:31 pm
From: Stephen Steneker <stephen.stene...@10gen.com>
Date: Mon, 1 Oct 2012 17:31:20 -0700 (PDT)
Local: Mon, Oct 1 2012 8:31 pm
Subject: Re: MapReduce on SECONDARY in a ReplicaSet

> Stephen, thanks for the tips.  We are running 2.2.0 and also using the 1.6
> C# drivers.  I'm trying to avoid hacking the map-reduce code to manage
> performance and/or the 16MB limitation; but may have no choice.
>  Aggregation FW looks good, but seems like it also has a 16MB in-line
> limitation - is this true?

Hi Mark,

Yes .. inline results for both Map/Reduce and Aggregation Framework are
limited to the current max document size (16MB as at MongoDB 2.2).

Cheers,
Stephen


 
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 « Newer topic     Older topic »