[00:18:01] <chanks> Does any one know if the MongoDB JS library will spawn children which will close socket descriptors in their context? Ie; maybe spawn a child with FD_CLOEXEC and then aftewards re-capture the frame?
[00:19:36] <chanks> Because given a persitent HTTP connection (where only the headers have yet been read and not the body), it seems to be either closing an unrelated connection...or corrupting it with no direct knowledge of its existence.
[00:25:33] <owen1> one of my hosts (primary) has old conf file. how to make it uses the new one?
[00:30:53] <owen1> i ended up adding the conf to the primary. not sure if that's the correct way.
[01:10:03] <owen1> when initializing a replica set with configuration file. will members[0] be the primary?
[02:04:37] <kreedy> Can someone tell me what typical memory usage on a mongo box looks like? top only shows the mongo process as using 20% of RAM. The box has ~15GB RAM. the free command show 95% of it being used as cache. does that cache include memory mapped files?
[02:04:46] <kreedy> we are having some periods of high iowait on the box
[03:41:08] <bean> I have a main server that i want to turn into a replica set. Does it just work if I iniate the RS and add the secondaries?
[03:41:17] <bean> and the data will be replicated?
[06:20:50] <salentinux> hi guys, I just read that db.eval() cannot be used in a sharded enviroment.
[06:21:12] <salentinux> I use it heavily in my not yet sharded enviroment.
[06:21:46] <salentinux> Is there any workaround to that problem?
[06:26:44] <sweatn> hello is anyone using mongoosejs with a replica set?
[08:45:33] <solars> quick question: I've got a collection with 12 mio entries, however, I'm only interested in the entries of the last 6 months (total ist 3 years) - if I add a flag "recent": true for the last 6 months, and use it in an index - is this performance wise the same as if I move the old ones to another collection so they are not processed?
[08:46:01] <solars> or does this still affect the performance somehow if they are lying around in this collection although not affected by the query
[08:48:19] <NodeX> but .... the old docs will still take up room in any other indexes you may have on them
[08:48:51] <chickamade> hey guys, I am experiencing a query that seems to freeze the whole mongodb server (2.2.0) incl. mongotop, mongostat; the query includes geospatial operator. The only thing that is possible for me is to call db.curentOp and db.killOp() otherwise mongodb is completely frozen.
[08:49:01] <solars> NodeX, yeah right, the index space remains of course
[08:57:30] <NodeX> can you pastebin your indexes on that collection?
[08:57:53] <chickamade> NodeX: obviously the query was unoptimized but I'm very surprised that it render the server down to a piece of rock (so to speak), while cpu & load of the system is minimal
[09:01:19] <chickamade> NodeX: I know that the query is not optimized now, but is there any reason why the query could hold a global lock leadings to mongotop and mongostat hanging?
[09:05:42] <NodeX> I'm surprised it attempted a sort() tbh
[09:05:54] <NodeX> how many docs are in the collection?
[09:08:04] <chickamade> 27mil in total, the p1 $in clause result set is about 400,000
[09:12:18] <chickamade> it looks like we could use composite (geo, p1) index, correct?
[09:12:36] <chickamade> however i'm concerned about server hanging while the geo query runs
[09:39:26] <fleetfox> Hey guys. Can i add where to aggregated field?
[09:41:50] <chickamade> NodeX: for better or worse, the query with a lone geo clause of 300m radius (1/10 of before) also hangs the server: coll.count({xy: {$within: {$centerSphere: [[-122.3907852172852,37.78129802378191],0.00004703595114532541]}}})
[09:43:05] <fleetfox> I have db.invoices.aggregate({$group:{_id: "$hansa_id", invoices: { $push: "$_id" }}})
[09:43:49] <fleetfox> how do i filter to have results only where invoices.length > 1 ?
[09:45:43] <fleetfox> I can add counter and use match? Or is there a better way
[12:12:06] <frqnck> Hiya all, any1 here knows how to forcefully run Mongod garbage collection?
[12:13:14] <frqnck> I am Trying to enforce an 'expireAfterSecond'
[12:51:11] <MatheusOl> frqnck: AFAIK, expireAfterSecond is checked each minute
[12:52:33] <frqnck> MatheusOl: yes, that's right.. do you know if we can push it sooner tho?
[12:53:16] <MatheusOl> frqnck: humm... Not sure. But from the docs I'd say "no"
[12:53:42] <MatheusOl> Do you really have a situation where you need it to happen more frequently?
[12:54:12] <MatheusOl> Perhaps always checking the date when you select the documents could be a solution
[13:06:06] <frqnck> MatheusOl: For instance, unit testing wise it woudl be good to enforce this expiration.
[13:06:59] <frqnck> As it stands, .. the expiration of data using the standard mechnism is not insurred to even heppen every 60s.. I have cases were it took 20mins... it is very random somehow!
[13:10:22] <MatheusOl> humm... It also depends on the workload
[13:10:29] <frqnck> It seems that automatic expiration using MongoDB is not reliable so having an extra date check is required.
[13:18:03] <frqnck> Tehre are many reports of this online..
[13:24:30] <xbuzz> when doing mapReduce(map, reduce, {out : {inline : 1}, query {date : "2013-01-17"}}) the reduce function does not appear to work. but when i remove the "query" restriction everything is fine. is there something i'm missing about how query works. my understanding was that query will restrict the results instead of using an entire collection.
[13:25:16] <xbuzz> the query executes fine but does not restrict the data to the date specified.
[13:29:32] <MatheusOl> have you copied that? the syntax is wrong
[13:51:19] <frqnck> That was a typo in the test.. it woudl eventually expire but in an hour time + next run of internal gc
[13:52:53] <CrawfordComeaux> if I'm accessing mongodb via mongoose, can my mongoose schemas only define the data I care about and not necessarily all fields in my documents?
[13:53:51] <xbuzz> MatheusOI: Regarding the issue with map reduce not working when passing "query". http://pastebin.com/7kPgF0aF
[14:07:17] <MatheusOl> CrawfordComeaux: I don't think I understood what you what. But is not the case to filter the selected fields when issuing a find?
[14:09:12] <MatheusOl> xbuzz: Your map function should return all fields
[14:10:37] <MatheusOl> xbuzz: There is not enough documents in your example to check the correctness
[14:19:06] <MatheusOl> Notice that reduce may receive values from map but also from other reduce
[14:19:49] <MatheusOl> Also I couldn't find what you stated, the results with and without query are NOT equal
[14:34:45] <CrawfordComeaux> MatheusOl: I have a collection of tweets that contains way more fields than I need. I'm wondering if the existence of fields that aren't defined in the mongoose schema for the collection will make mongoose angry
[15:51:07] <jmien> Hello everyone. I have a question about deletions. When you delete in MongoDB, does Mongo keep the document at all? I have been using couchdb, and it seems to store the document indefinitely. I was wondering if mongo is the same
[17:32:14] <jiffe98> I am trying to add a member to a replica set and I followed http://docs.mongodb.org/manual/tutorial/expand-replica-set/ but the primary shows the new member is still initializing and the new member shows "errmsg" : "can't currently get local.system.replset config from self or any seed (EMPTYUNREACHABLE)"
[17:32:33] <jiffe98> the log on the new member shows http://nsab.us/public/mongodb
[17:39:55] <MatheusOl> Have you set the replSet config properly?
[17:40:19] <jiffe98> MatheusOl: the config was copied from another replica
[17:50:08] <MatheusOl> jiffe98: May be any issue about bind_ip or so?
[17:50:45] <jiffe98> MatheusOl: they are all bound on 0.0.0.0
[17:51:34] <jiffe98> I just noticed there is a version difference, the other two are running 2.2.0, this is 2.2.2
[17:51:39] <jiffe98> I don't know if that would be an issue
[18:37:13] <nemothekid> Its been my experience that in a sharded setup if I create a collection on non primary shard C, the mongos will read the collection from shard C despite the fact thats its not primary. Is this documented anywhere?
[18:43:47] <kchodorow_> nemothekid: you should always create collections through mongos
[18:43:56] <kchodorow_> otherwise mongos won't know how to find them
[18:44:50] <zip_> nodejs mongodb native driver works fine outside a child process, inside a child process (forked) the db object serverConfig has the correct server information however connected is false.... tldr node-mongodb-native won't connect from inside a child process, any ideas?
[18:44:56] <nemothekid> So what I'm seeing is an undocumented side effect? Reason I'm asking is that we have some smaller collection, - not large enough to be sharded, that we want to live on other machines other than the primary
[18:46:55] <nemothekid> we found in some cases like turning profiling on on Shard C, or creating a collection on Shard C, then querying from a mongos would return the data on Shard C. But if this isn't documented it could be just a side effect and gone in the next version
[19:02:16] <addisonj> hey, we are running into a weird case where mongodumping from a secondary and then restoring in a different environment is creating duplicate documents. Once the indexes start being built we get a dupe key error and it crashes
[19:06:26] <n3wguy87> hello. Not sure if what I want is possible.. I'm looking to build a database structure based on an xml schema from mitre.org - is there anyway to import from xsd?
[19:06:49] <n3wguy87> I've scoured the internet to no avail... :(
[19:08:39] <JoeyJoeJo> Is there a command in mongo that will tell me how long a query took?
[19:12:52] <JoeyJoeJo> I'm doing some performance tests in a test environment where I have 4 servers. I was going to make 2 replica sets with 2 members each. Can I use one additional server to act as an arbiter for both replica sets or do I need two separate arbiters?
[19:14:13] <kali> for performance test, i wuld not even bother with arbiters
[19:14:42] <JoeyJoeJo> Oh, I thought I had to use an arbiter
[19:16:03] <zip_> cannot connect to db in a nodejs child process, works fine in parent, any ideas? - sample code: https://github.com/mongodb/node-mongodb-native/issues/852
[19:16:05] <kali> arbiter is necessary if you want the failover to work, but i don't think you care too much about availibility there
[19:16:27] <JoeyJoeJo> You're right, I don't care about failover yet
[19:47:12] <JoeyJoeJo> What's the difference between a replica set and a shard? Is it that one replica set can contain many shards?
[19:51:09] <kali> replica set are servers with the same data
[19:51:41] <owen1> if have 5 hosts. i want the primary to be #1 and if it dies #2 and if it dies #3. #4 and #5 should never get elected. can i set priority 3, 2, 1, 0, 0 respectively?
[19:52:24] <kali> sharding allows to deal with bigger data set by slicing them to several shards, so each shard has a different piece of the ata
[19:52:33] <kali> usually a shard is a replica set
[19:54:11] <JoeyJoeJo> Ok, so I have one database that I want to shard to my 4 servers. Does that mean I'll have one shard and one replica set or 4 shards and one replica set?
[19:55:22] <kali> JoeyJoeJo: two shards, each shard a replica set of 2
[19:57:45] <JoeyJoeJo> I guess I still don't understand. I thought the point of having multiple replica sets is just for failover, which I don't need in my test environment
[19:59:15] <kali> then four shards of standalone server
[20:00:26] <owen1> is there a common way for backing up mongo? if i have RS of 5 hosts, can i think about it as a backup as well as redundency?
[20:13:17] <jiffe98> owen1: a backup is necessary if something gets deleted or corrupted
[20:18:29] <owen1> jiffe98: got it. reading about it and sounds simple. a guess a daily cron that run mongodump on one of my secondaries can do that.
[20:18:58] <UForgotten> owen1: yes. always have a mongdump :)
[20:26:35] <owen1> if have 5 hosts. i want the primary to be #1 and if it dies #2 and if it dies #3. #4 and #5 should never get elected. can i set priority 3, 2, 1, 0, 0 respectively?
[21:02:25] <JoeyJoeJo> I've started my config servers as well as my mongod servers, but when I try to run mongos, I get this message - error command line: too many positional options
[21:03:05] <kchodorow_> JoeyJoeJo: what does your command look like?
[21:03:13] <UForgotten> mongos can't grok the karma sutra eh?
[21:28:54] <kreedy> damn. i was hoping it was UDP. it would explain my issues better :)
[21:30:59] <JoeyJoeJo> Three of my servers are config + regular mongod shards. Each has two mongod processes, one on port 27017 and 20719. Which of those is for the config server and which is the regular db server?
[21:31:13] <kreedy> i end up with dropped heartbeats on AWS (3 servers, each in separate AZ)
[21:31:55] <kreedy> our mongo driver (mongoid 3) freaks out when this happens, even when set to read from primary and even when the dropped hearbeat is between the two secondaries
[21:32:49] <kreedy> https://gist.github.com/78aad723265d361dc1f3 is the log (mongo01 and mongo03 are the secondaries; mongo02 is the primary). kchodorow_: if you are anyone have some insight into where i should go from here, it'd be much appreciated
[21:36:10] <kreedy> we are using auth as well if that's an issue
[21:45:46] <ehershey> JoeyJoeJo: the best way to tell is the command line of the running processes
[21:46:35] <ehershey> but 27017 is the default for mongos/normal mongod and 27019 is the default for config servers
[21:46:47] <ehershey> According to this - http://docs.mongodb.org/manual/administration/security/#security-port-numbers
[21:49:41] <JoeyJoeJo> One more question - I was adding shards and messed up, so I want to start over from scratch. I ran sh.runCommand ({removeShard: "shard1"}), but it's been stuck in "draining" for a while now, even though there is no data. Is there a fast way to just wipe out all sharding settings start over?
[21:52:45] <ehershey> do you have any data at all?
[22:40:01] <sirious> i have a script that does a lot of queries against the db, but part way through it crashes with this: [Errno 99] "Cannot assign requested address"
[22:40:42] <sirious> anyone know where i might poke around to find out why it stops allowing new connections to the db?
[23:19:12] <sirious> it's a python script that goes over the entries in one collection, and based on the users that have subscribed, updates their accounts with notifications
[23:20:53] <sirious> doing a db.serverStatus() the number of connections never grows past 5
[23:21:14] <sirious> and i ran the script with a user whose ulimit -Sn was over 9000
[23:56:03] <ehershey> I will attribute you if you want!
[23:56:12] <ehershey> but figured short and sweet and anonymous was fine
[23:56:31] <sirious> haha, much appreciated, but it can stay as is :)
[23:57:19] <hadees> So I need to figure out what page a comment is one when I paginate comments for a post. What I'm having trouble doing is figuring how how many documents are ahead of it when ordering by created_at desc
[23:58:38] <sirious> hadees: can you just get a .count() of what would be returned if you didn't limit?