[01:30:08] <azneita> what are other options for having a secondary node catch up with the master when master is being written to fairly often?
[01:31:15] <azneita> have done initial sync but it took too much time and was already far behind when it finished
[01:32:28] <context> ok so... mongo, using 99% of disk, removed 'the' collection to rebuild it in question. how free disk space so other people stop crying about it
[01:37:44] <joannac> context: spare disk, mount it somewhere, --repairPath?
[01:38:31] <joannac> azneita: i dunno, how fast can you copy files?
[01:38:59] <joannac> azneita: is there a downtime window or a less-busy time window?
[01:39:42] <context> will mongo 'auto reuse' the space that was freed?
[01:39:47] <context> or its just sitting there, wasting space ?
[01:40:00] <joannac> context: repair or resync is how you get space. you could try turning it into a replica set and syncing to a new node, then swapping over maybe
[01:40:12] <joannac> that seems like more effort than just mounting another disk though
[01:41:19] <joannac> which means a document that went from 1kb to 1.1kb gets moved, but a new document inserted which is 1.05kb can't fit in the space either
[01:41:40] <context> disk used is 186G, there is only 3.3G of data. you'd think at least two of these 2G files could be removed....
[01:53:29] <joannac> if you're going to run it like that, then yes...
[01:53:46] <joannac> Run mongod directly from your system’s shell. *Make sure that mongod isn’t already running*, and that you invoke mongod as a user that has access to MongoDB’s data files. Run as:
[02:40:19] <hydrajump> just looking at rs.status() is it normal that the number of operations after the optime is so high "optime" : Timestamp(1413427150, 136),
[02:40:46] <hydrajump> it just means that those 136 operations have not been written to disk?
[02:43:16] <joannac> it just means the last activity was in that second, and there were 136 operations done in that second
[02:44:10] <joannac> I have no idea whether it's normal for you to have that many operations
[02:45:20] <hydrajump> ok so when I compare the optime between two members I just need to be concerned with the first part?
[02:47:05] <joannac> well, no, you should be concerned with both parts
[02:48:19] <hydrajump> what I'm trying to do after chatting with Boomtime yesterday is write a backup script and the part I'm struggling with right now is finding out which of my two SECONDARY members has the lowest optime lag with the PRIMARY and than I'll use that SECONDARY as the member to db.fsyncLock() and snapshot.
[02:55:20] <hydrajump> joannac: If you could please take a look at my script https://gist.github.com/anonymous/2579afd65e3c37bcd555 and maybe give me some pointers
[03:01:10] <joannac> Sorry, I don't really have the time to review scripts
[03:06:21] <hydrajump> ok maybe you can just give me some pointers on my backup method.
[03:06:48] <hydrajump> I just came across this `rs.printSlaveReplicationInfo()` command. It will output the lag for each secondary member.
[03:07:33] <hydrajump> Maybe it's sufficient to use the output from this command to determine which SECONDARY member to lock,flush and snapshot?
[03:14:22] <joannac> and assuming you know which the primary is
[03:41:37] <hydrajump> after looking at how `rs.printSlaveReplicationInfo()` is implemented if I understand the code the lag is calculated by taking the current time - the optime of each secondary member. I don't see that it takes the number of operations in the last second being accounted for in the calculation.
[04:23:16] <clu3> hi guys, is it possible to export a collections with a query? like export a collection where {type : 1} for example?
[06:21:43] <e_m_fields> Newbie: MongoDB + PHP question: How do I query for a second-level element? (I'm not sure terminology, should call it a nested document or field ?)
[06:26:06] <Boomtime> 1. query for the document that you want to find
[06:26:07] <e_m_fields> That sounds like a likely thing: :D
[06:26:14] <Boomtime> 2. access the array of that document you are interested in
[06:26:58] <e_m_fields> Okay. So, 1) I'm expecting to walk through the list of all the top-level documents.
[06:27:41] <e_m_fields> ie, find a way to query for every "element_1"-level document.
[06:28:24] <ArTeS> is there any java code example for Java Driver Concurrency ?
[06:28:48] <e_m_fields> was doing this with "$cursor = $db->collection->find()"... Is this the wrong way to start here?
[06:32:13] <Boomtime> e_m_fields: find() is good to use
[06:33:33] <e_m_fields> Okay. So this will give me an array with each top-level document. From there, how do I go about accessing the array of the sub-level documents?
[06:34:43] <e_m_fields> foreach ($cursor as $c) { $c->find() .... something here, to give me the 'subelements' array}
[06:35:25] <e_m_fields> This is the sorry level where my grasp of MongoDB goes 'pffftt'.
[06:42:44] <Boomtime> that isn't mongodb you have trouble with now, you're in PHP land there
[06:43:08] <Boomtime> wait, you have the find() inside the loop, what?
[06:43:24] <Boomtime> find() returns a cursor, you then enumerate that cursor to get each document matched
[06:43:46] <Boomtime> btw, if you know only one document will match, you can use findOne() to just get that and skip the cursor bit
[06:48:31] <e_m_fields> Boomtime: okay, I just changed code to use findone: Successfully returned the 1st document. Err, maybe I'm in PHP land fuzzies here, not MongoDB issues: But to access the "subfield" array of the document, I should start ... where?
[07:03:15] <samdevel> Hi.. I m unable to connect to mongodb server in my linux server from my windows machine using robomongo.
[07:04:32] <e_m_fields> Boomtime: Okay, PHP vomits: We're attempting to get property of a non-object. I think I'm almost there: $element['subelements'] seems to work.
[07:09:12] <e_m_fields> Boomtime: Seem to have PHP vomiting correctly now. :) It was $element['subelement']['subsubfield'] syntax we're looking for. Thanks for the responses, G.
[07:14:21] <Boomtime> samdevel: can you connect to your mongodb via the mongo shell?
[09:11:23] <PirosB3> my mongoDB is doing 99% CPU usage, with read-only operation
[09:11:34] <PirosB3> what way would you suggest me to diagnose these propblems?
[09:17:16] <KieranG> Hi guys - I have been tasked to find a way to store an arbitrary XML document properly in MongoDB, currently I am converting it from XML -> JSON -> BSON, which all seems to work fine, no information is lost whatsoever, however when I try and insert it into the database and try to retrieve it, it seems to lose any elements, including the root node, that are containers for other elements - Does
[09:17:16] <KieranG> anyone have any ideas how I can get around this?
[09:34:56] <glontu> i'd like to try and migrate one of my projects to mongodb but i have 1 question
[09:36:10] <glontu> i have an object A that has a set of objects B and another reference to a particular B from that same set. Does that sit right with mongodb ?
[09:36:24] <glontu> is it a special case or is it normal usage ?
[09:37:28] <glontu> and do i need to hold the second reference to the particular object from the set ( i was doing it for performance concerns ) or is it enough to just put a special mark on one of the objects from the set and use that when i fetch ?
[09:43:22] <arisalexis> i want to model a chat messaging system can anyone help with a few questions?
[09:44:41] <arisalexis> "chat" document gets appended "messages" in an array. could be a lot of them. should i normalize this or not? i read document growth is bad
[09:50:48] <arisalexis> nvm i will model it with norm
[09:50:58] <GIjsNelissen> hi all! i have a map reduce with input: 50k docs, emits 50k, reduces to 510 and then outputs just 1
[09:51:19] <GIjsNelissen> i want it to output 510 results. Can anyone have a quick look at the map reduce functions ?
[09:51:22] <arisalexis> another questions is can i have a key like "aris:alexis" and anotherone "aris:makis" and then query all keys for "aris:*"?
[09:52:21] <GIjsNelissen> the functions are on the mongodb google group https://groups.google.com/forum/#!topic/mongodb-user/nkfLYuIpA9Q
[11:25:56] <kPb_in> Hello All.. I have a mongodb 2.4.9 running production(1 primary, 2 secondaries).. All as running well until sometime ago mongo suddenly become very very slow.. some basic queries took 30 minutes to run.. What could be the issue?
[12:35:37] <ssarah> hei guys, the build that is installed through this http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ doesn't come with --sslMode available ?
[15:11:25] <goel88> Hi. I am trying to enable sharding on mongodb databases for some benchmarking purposes using YCSB. I am trying to run mongod on three different nodes and this part I am success fully able to do. Now in the second part I am trying to mongo to one of those three nodes which has already mongod running. Running mongos erratically throws me the following error sometimes -> “Failed to connect to 1 reason: errno:111 Connection refused”
[15:12:25] <goel88> while sometimes it is able to connect successfully. What can be the possible reason for it ? It would be great if anyone could help in this regard
[16:19:31] <hydrajump> Looking at this output from my replica set https://gist.github.com/anonymous/034e9bfab6ccb005674b it looks as if the secondaries are only 1 sec behind the primary, but the "syncedTo" says 255 secs. Is that supposed to be milliseconds?
[16:49:37] <culthero> What happens when you have max_size on a shard set (lets say 20gb), the shards are full, and you are still inserting.. do the new queries fail?
[16:54:14] <culthero> tscanausa: I am ingesting data at a maximum rate of 4.8gb an hour (including indexes), but it is usually ~500mb to 1gb an hour. 4.8gb an hour can go on for hours, but isn't common.. From what I understand I will need to account for these scenarios in code, not in mongo configuration to manually delete old chunks of my shards are getting too full
[16:55:15] <culthero> I am expiring old data using a TTL index, but either I have a commonly 25-30% disk utilization and less historical data, or I run out of disk space and need to run around resizing vps's and whatnot
[16:56:12] <tscanausa> if you were not using a sharded collection like it sould like you shouldnt be that you can use a capped collection
[16:56:53] <culthero> Unfortunately I have conflicting interests in the database, one is to ingest and index the data, and second is to search it quickly (using a fulltext index on the largest collection)
[16:57:00] <tscanausa> max size if for chunks, and a server can have many chunks, if you fill up a chunk the chunk wont move then then you are SOL
[16:58:03] <culthero> with databases that get outside of working set, if my index gets bigger then memory querys on fulltext thrash the disk. Even on speedy SSD's searches that contain better then 20% of the whole index bring the application to its knees
[16:58:08] <tscanausa> unsharded is always the best way to go if you can.
[16:59:00] <culthero> IE my database needs to read through like a 50gb index.. and since there are no range predicates, I have no good way of chunking this.. unless I start storing additional things like hour - day - month - second - minute etc
[16:59:35] <tscanausa> so if you dont want that then you need to manage in code.
[17:00:25] <culthero> Yeah. I only have myself to blame, read a couple of blogs on High scalability and think "sure, I can do that!" .. (4 months later still dealing with hardware limitations, ballooning cost and no actual solution) :)
[17:00:42] <culthero> well I have somewhat of a solution, it's just a lot less sexy then I had hoped
[17:01:33] <tscanausa> culthero: I luck out by hand managing my "shards".
[17:01:50] <tscanausa> similar to how one would mysql shard
[17:02:10] <culthero> oh just get an email alert if you're running into i/o cpu disk space issues?
[17:02:28] <hydrajump> is it ok to use mongo shell version 2.6.4 with older versions of mongod, e.g. 2.4.11 or should the mongo shell and mongod always be the same version?
[17:02:48] <tscanausa> hydrajump: try to keep them the same
[17:19:35] <tristanp> im a little unsure of how to install mongodb on mac. i put the binaries in ~/dev/mongodb/bin, and then i created ~/dev/mongodb/data/db/
[17:20:01] <tristanp> but apparently that's not correct, as mongod claims /data/db/ is nonexistent
[19:36:38] <dreinull> maybe I'm looking in the wrong places. On a VPS with only localhost access necessary, is there anything I need to do in order to secure my db?
[19:37:30] <dreinull> do I need users or am I just fine with full access from my local app that accesses the db?
[21:43:39] <Trindaz> mongodb driver for node.js. I can't see anything in the docs about how to chain find commands (e.g. will find().limit(5).toArray() work?)