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 }
> 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 }
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.
<stephen.stene...@10gen.com> wrote:
>> 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 }
> 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:
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
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?
On Sunday, September 30, 2012 9:34:10 PM UTC-4, Stephen Steneker wrote:
> 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 }
> 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:
> 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 > <stephen....@10gen.com <javascript:>> wrote: > >> 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 }
> > 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:
> > -- > > 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<javascript:> > > To unsubscribe from this group, send email to > > mongodb-user...@googlegroups.com <javascript:> > > See also the IRC channel -- freenode.net#mongodb
> 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).