PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 6th of July, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[06:00:10] <ravana> hi guys
[06:00:26] <ravana> is there a way to read journal file in mongo?
[06:16:32] <dstorrs> I would like to specify the username that the mongod process runs as. Where do I do that? (Ubuntu 10.04 box)
[06:32:20] <algernon> dstorrs: /etc/mongodb.conf
[06:32:31] <algernon> most likely
[06:33:01] <dstorrs> algernon: thanks for un-warnocking me. :> /etc/mongodb.conf was the first place I checked, but I don't see anything relevant.
[06:33:14] <dstorrs> I'm worried that it's a precompiled setting in the .deb files.
[06:33:37] <algernon> if not mongodb.conf, then the init script
[06:33:48] <algernon> on my script, the init script has: DAEMONUSER=${DAEMONUSER:-mongodb}
[06:34:33] <dstorrs> by 'init script' you mean /etc/init.d/mongodb ?
[06:34:39] <algernon> yes.
[06:34:48] <algernon> though, well, ubuntu... that thing might have upstart
[06:34:53] <dstorrs> it does.
[06:35:02] <dstorrs> but the /etc/... script is a symlink to the upstart
[06:35:08] <algernon> I'm tempted to say you're screwed then. :P
[06:35:18] <dstorrs> I just can never remember the upstart link, so I use the /etc/ path.
[06:35:19] <dstorrs> heh.
[06:36:24] <dstorrs> so...seriously. no way to do this?
[06:37:48] <algernon> if you can ask upstart to start a daemon with a different uid/gid, then it can be done
[06:38:20] <dstorrs> aha!
[06:38:22] <algernon> mongodb itself - as far as I see - doesn't change uid/gid, whatever is starting it should do that
[06:38:23] <dstorrs> you're brilliant.
[06:38:35] <algernon> I use Debian. Of course I am! :>
[06:38:39] <dstorrs> That was exactly the kick in the butt I needed. I've got plenty of links coming up for that query.
[06:43:08] <dstorrs> heh
[06:44:08] <dstorrs> I'm an ubuntu fan...most of the joy of Debian, and minus most of the pain.
[07:35:24] <[AD]Turbo> hola
[08:27:30] <sinisa> anyone knows if distinct can return multiple keys/values
[08:36:00] <crudson> pretty sure it only accepts a single key, use an aggregate query to do what you want
[08:42:51] <jwilliams> i have mr function like http://pastebin.com/BBU48h5S
[08:43:08] <jwilliams> but it throws can't use sharded collection from db.eval
[08:43:31] <sinisa> crudson, i will do it with mr
[08:43:47] <jwilliams> i don't explicitly specify db.eval(), what might cause this to execute such func? and how to avoid it so that mr can be ran?
[08:56:17] <ndee> I have a documents with fields foo and bar and I want to copy the contents of field foo to field bar, all from the shell. Is that possible with one command? I took a look at the $set update modifier but I'm not sure if I can pass a field or only values.
[08:58:38] <ndee> http://stackoverflow.com/questions/2606657/how-can-i-update-field-with-another-fields-value
[08:59:45] <NodeX> I dont think you can
[12:05:50] <Zelest> What are the numbers listed when doing a mongorestore? I did a dump and it seems to be counting docs.. but restore has some other numbers.. or a LOT higher numbers?
[12:06:06] <Zelest> E.g: 12543146/1995433094 0%
[12:07:04] <Zelest> fields?
[12:08:06] <NodeX> bytes
[12:08:17] <NodeX> X of X bytes complete
[12:08:37] <Zelest> oh..
[12:08:41] <Zelest> that simple :D
[12:08:47] <NodeX> yup
[12:09:04] <Zelest> Makes sense then :)
[12:09:19] <Zelest> Got scared mongorestore was b0rked on mac :P
[12:09:23] <NodeX> lol
[12:09:39] <NodeX> well it is on a MAC so I wouldnt be surprised
[12:10:43] <Zelest> Haha
[13:18:33] <niemeyer> Hmm.. are $gt and friends not supported in queries for fields with BinData?
[13:26:01] <niemeyer> Works in an isolated test case.. hmm
[13:33:11] <niemeyer> Oh, gosh
[13:33:22] <niemeyer> int lsz = l.objsize(); // our bin data size in bytes, not including the subtype byte
[13:33:22] <niemeyer> int rsz = r.objsize();
[13:33:22] <niemeyer> if ( lsz - rsz != 0 ) return lsz - rsz;
[13:33:24] <niemeyer> WTF
[13:57:31] <remonvv> Does anyone know if there are any public MMS statistics in terms of mongod/mongos crashes and so forth? Trying to get to a somewhat realistic MTBF of a mongo node
[14:07:38] <guawhitehawk> hello all! ive problems to aggregate the mongodb munin graphs with the example on the mongodb page. it generates NO cluster graphs but generates well the normal mongodb graphs.
[14:19:45] <guawhitehawk> can it be that i cannot aggregate graphs (no graphs) when i only have one active mongodb master, therefore i must stack them??
[15:55:23] <mw44118> We set up a replica set and our app code connects to the primary node; but after an outage, the slave became the primary. The app code then crashed because it wasn't talking to the master any more
[15:55:58] <mw44118> can i configure my app code so that it switches automatically to the new primary after an election?
[15:56:51] <mw44118> is this what mongos is for?
[16:04:43] <dgottlieb> mw44118, which language/driver are you using?
[16:06:04] <dgottlieb> mw44118: it's the drivers responsibility to fail over. Though the connection must be declared as a replica set connectio
[16:06:15] <mw44118> dgottlieb: python mongoengine
[16:06:32] <mw44118> dgottlieb: maybe i don't set up my driver correctly
[16:06:38] <mw44118> I will check that
[16:09:14] <dgottlieb> mw44118: not sure about mongoengine, but the pymongo docs on replica set connections: http://api.mongodb.org/python/current/examples/replica_set.html#id1
[16:10:33] <mw44118> dgottlieb: so, if the primary dies, and one of the secondaries becomes the new primary, with pymongo, the app code will still operate correctly?
[16:14:00] <mw44118> it seems like I would need to trap some exceptions, and sleep or retry for a while, until the system heals
[17:28:36] <ik> hi
[17:28:41] <ik> is mongodb web scale?
[17:42:25] <freezey> are you webscale?
[17:42:48] <ranman> freezey: yup.
[17:42:55] <freezey> interesting
[17:42:57] <freezey> haha
[17:43:01] <ranman> ;)
[17:43:06] <freezey> all depends how you use it my friend
[17:43:08] <freezey> all depends
[17:43:18] <freezey> just autoshard and your good :)
[17:43:29] <ranman> Do you work at sailthru?
[17:43:33] <freezey> yes
[17:43:41] <ranman> I think we have a beer pong contest with you soon.
[17:43:46] <freezey> haha niceee
[17:43:51] <freezey> yeah next friday
[17:43:55] <freezey> your over at 10gen?
[17:44:05] <ranman> yes. Ready to lose?
[17:44:09] <freezey> ppffttt
[17:44:13] <freezey> prepare for suffer
[17:44:14] <freezey> haha
[17:44:26] <freezey> what do you do for 10gen?
[17:44:44] <ranman> Hangout in IRC and answer questions about whether or not we're webscale of course.
[17:44:52] <freezey> nice gig
[17:44:52] <freezey> haha
[17:45:18] <freezey> i just finished migrating our mongo off of ec2
[17:45:21] <freezey> pretty hefty
[17:45:31] <freezey> threw it on some pretty sick ibm systems
[17:46:34] <freezey> have you guys been testing out those intel 520's?
[17:46:44] <freezey> elliot was saying you guys have some around
[17:47:25] <ranman> freezey: do you guys have a hackNY intern?
[17:47:34] <freezey> i think so
[17:47:50] <freezey> whats his name?
[17:47:51] <freezey> jacob?
[17:47:59] <freezey> or the other guy yeah we have one
[17:48:10] <freezey> i am to busy coding half the time
[17:49:40] <groundnuty> hey, is it possible to use mongodb without runnign a server? - similar to sqllite? if not you gyus know any nosql dbs like that?
[17:50:17] <freezey> ranman: have fun with that
[17:50:18] <freezey> lol
[17:52:40] <cas> Hi, is it wise to use mongodb for inserting lots of objects (60 p/s) with a datetime as key and selecting ranges(start/stopdatetime) from it?
[18:09:36] <freezey> ranman: i was digging around on your guys site and dont see much about ideal mount options for SSD i would assume defaults isnt the best route
[18:13:14] <ranman> freezey: right. we're actually working on speccing that out right now.
[18:13:37] <freezey> ahhh
[18:13:47] <freezey> which ssd type are you guys tinkering with?
[18:16:05] <ranman> kernel options: raid 0/1, replset, noatime, … err not sure about the brand of ssd
[18:22:31] <freezey> ahh
[18:22:34] <freezey> ok cool
[18:22:36] <freezey> well
[18:22:42] <freezey> when your done with the writeup i want to see that
[18:22:57] <freezey> we aren;t running a ton of kernel options and i am curious about your mount options
[18:23:09] <freezey> but as i assumed its a raid10 which is expected
[18:23:15] <ranman> freezey: for sure, I can get you some info now but it's pretty busy here today so it might be a while
[18:23:27] <freezey> ahhh ok
[18:23:31] <freezey> yeah send me any info you can
[18:23:34] <freezey> acaiafa@sailthru.com
[18:23:52] <ranman> raid10 on SSDs can have some weird performance issues too though only for specific controllers if I remember correctly though.
[18:24:09] <freezey> yeah
[18:24:15] <freezey> our IBM controller handles it quite well
[18:29:49] <ranman> freezey: https://wiki.10gen.com/display/DOCS/SSD
[18:30:30] <freezey> nice
[18:30:32] <freezey> thanks
[18:30:46] <freezey> yeah i would like to add that noop is a good choice
[18:30:49] <freezey> i am running everything with noop
[18:30:56] <freezey> cfq is for the birds
[18:32:47] <freezey> yeah doesnt exaplin much about mount options but
[18:56:20] <revnoah> Hello. I'm a bit unclear on manual references, and the online manual is a bit sparse. I expect that they should be defined in the model but I'm not sure how. Can someone point me to a good example of best practices for manual references?
[18:57:11] <ranman> revnoah: it's just a separate query.
[18:59:51] <revnoah> ranman: that much I understand, and running the query separately works fine. What I have set up in my mongoose model is a virtual variable that I want to return a location name based off of the id. When I try to put a findOne() function in my custom virtual variable function, it doesn't execute in the right order to return the variable.
[19:01:05] <aheckmann> revnoah: virtuals are synchronous.
[19:01:25] <aheckmann> revnoah: findOne will not respond until after the virtual finishes running
[19:02:06] <aheckmann> revnoah: use a method if you need to do async and design it to accept a callback
[19:02:22] <aheckmann> revnoah: pass your result to the callback when it responds
[19:02:54] <revnoah> okay, that makes sense though is a bit irritating.
[19:03:46] <revnoah> you wouldn't happen to know of a good resource that might have example code, would you?
[19:04:22] <aheckmann> revnoah: a virtual is just a getter under the covers. http://mongoosejs.com/docs/virtuals.html
[19:07:30] <revnoah> thanks, though the virtuals I have referencing the same object, such as in these examples, are working fine. But your suggestion of a helper callback function points me in the right direction.
[19:08:46] <diZLeXiK> hey, quick mongoose question regarding "populate" functionality. if i do something like Whatever.findOne(...).populate('something'), two queries will fire off to the database, correct? what happens if i do Whatever.find(...).populate('something') where, say, 5 Whatevers are found? is the database queried 6 times?
[19:09:46] <diZLeXiK> or is mongoose smart enough to take all of the values of 'something' after the 'find' and make one query for the child Whatevers?
[19:10:04] <aheckmann> diZLeXiK: 6 queries
[19:10:30] <diZLeXiK> ok. is there any plan for optimizing that in the way i suggested?
[19:10:46] <aheckmann> diZLeXiK: as soon as you write it ;)
[19:10:52] <diZLeXiK> haha, gotcha :)
[19:10:55] <aheckmann> haha but yeah
[19:11:03] <aheckmann> there is still a lot of room for improvement
[19:11:16] <diZLeXiK> maybe i'll take a peek at it over the weekend
[19:11:30] <aheckmann> diZLeXiK: that'd be great
[20:26:06] <Sim0n> Hiya. One of our secondarys went down and when bringing it up again we get "13440 bad offset" errors.
[20:26:33] <Sim0n> It says in the documentation "If journaling is on this shouldn't happen."
[20:26:40] <Sim0n> Journaling is on. :o
[20:29:11] <Sim0n> The version is 2.0.6
[20:32:12] <ranman> Sim0n… how badly did this thing go down?
[20:32:48] <ranman> Sim0n and how much space is free? Journaling isn't perfect… and you could have gotten fairly unlucky but there could be something else going on.
[20:34:21] <Sim0n> ranman: So the server just locked up and refused to be sshable. Restart of machines is the only thing that helped. Database with indexes is 471gb, 242gb free.
[20:35:01] <ranman> in the logs, are there any asserts right before the node goes down?
[20:36:35] <Sim0n> One second
[20:37:07] <ranman> can you try running: db.collection.validate(true), then try mongodump --repair I guess
[20:37:25] <Sim0n> Nope. Only lots of closed connections.
[20:38:07] <ranman> http://www.mongodb.org/display/DOCS/Durability+and+Repair
[20:39:23] <ranman> Sim0n: as far as getting this to work, you can try to make a snapshot of another secondary and just resync from that (although 470gbs is gonna take a while so try to repair first)
[20:40:00] <Sim0n> Its my understanding that a repair will walk over all the data in the databases and take slots and lots of time?
[20:40:06] <Sim0n> Thanks for you help btw! Appreciate it.
[20:40:33] <Sim0n> Yeah, the other secondary is recovering at the moment :/
[20:41:09] <Sim0n> Ive shut down all the processes that writes and reads from mongo to relief the primary,
[20:43:16] <Sim0n> We had a similar issue last week, I dont remember the details exactly but the same machine got a similar issue and we ended up just dropping all the data and syncing from scratch. At that points we had one primary and one other secondary. But since there is only one primary and the other node is recovering it leaves me a bit stressed out about doing anything drastic.
[20:44:19] <ranman> what version are you running?
[20:45:14] <Sim0n> On the primary 2.0.4, on the angry secondary 2.0.6 and 2.0.6 on the other secondary thats recovering.
[20:49:57] <ranman> are you on EC2?
[20:50:49] <Sim0n> We have one of the on EC2(The one that is recovering), the other two are in the office. The failed one is on a RAID-0 with two SSDs.
[20:52:04] <ranman> aha!
[20:52:56] <Sim0n> The primary is on one SSD, while the failing one is on two. So this makes me think that there is something wrong with the raid(since the same machine died last week aswell)
[20:54:09] <ranman> So there are several SSDs that have some odd issues with RAID0
[20:54:29] <ranman> I was trying to find a link for you but I can't find the one I'm thinking of
[20:55:25] <Sim0n> Im pretty sure that one of the disks in that raid is a Crucial, the other one im 100% sure is a Crucial C300
[21:07:48] <Sim0n> Im looking in the mongodb log on the angry machine and noticed that it says [rsSync] replSet syncing to: {the-machine-that-is-recovering}. Will this affect the recovering in any way?
[21:08:10] <ranman> Don't think so.
[21:09:33] <Sim0n> Ok.
[21:09:48] <Sim0n> So on the angry machine it says this over and over again:
[21:09:50] <Sim0n> replSet syncTail: 13440 bad offset:0 accessing file: /mnt/mongodb/images.0 - consider repairing database, syncing: {a document}
[21:10:25] <Sim0n> Would it be a bad idea to stop mongo on that machine remove the images-files from disk and then restart? Would that sync back the missing database then?
[21:10:44] <Sim0n> Sorry for all my noobish questions. Im not a database admin :)
[21:22:58] <dstorrs> is there a way to exclude a particular collection from replication?
[21:24:00] <dstorrs> I've got a handful of high-traffic collections that are used as job queues. they get a lot of inserts and updates, but then end up empty again almost immediately. the jobs are time-sensitive, so there's not much point in retrying after a recovery. seems like a pointless burden on the oplog
[21:43:15] <Sim0n> I ended up just dropping all the data and doing a resync, lets hope for the best. Cheers for your help ranman!
[21:43:18] <Sim0n> And have a nice weekend.
[21:43:23] <ranman> wow, sorry about that
[21:43:26] <ranman> good luck.
[21:43:29] <ranman> thanks, you too.
[21:48:53] <mehemoho> hi
[21:49:25] <mids> hola
[21:49:31] <mehemoho> is it possible to search something like: { "field1.field2.*.field4" : "whatever" } =
[21:49:34] <mehemoho> ?
[21:49:45] <mids> yes
[21:50:01] <mehemoho> how ? I dont find doc about it
[21:50:03] <mehemoho> :/
[21:50:15] <mids> oh wait, overlooked the wildcard :(
[21:50:52] <mehemoho> ahhh ok, it is the main problem of the query
[21:51:39] <ForSpareParts> Hey, guys. I'm new to NoSQL stuff, and I was hoping someone could explain very briefly how you'd map out, say, a blog with posts and associated users in mongo or something like it. Is there a good way to do that, or is that something you just *shouldn't* do with a NoSQL database?
[21:52:10] <mehemoho> the last one IMHO
[21:52:25] <mehemoho> u should change the point of view
[21:52:36] <mehemoho> create documents and collections instead of table and relationship
[21:52:52] <mehemoho> noSQL is not going to do it as good as yesSQL
[21:53:20] <mehemoho> basicaly should be something like:
[21:53:40] <mehemoho> { 'user_id' : <ID> , 'post_data' : <DATA>, .. }
[21:53:50] <ForSpareParts> mehemoho, Thanks. I had a suspicion that I was looking at it the wrong way. Could you give me an example of a problem that "fits" NoSQL better? Trying to figure where it belongs in my toolkit, so to speak.
[21:53:54] <mehemoho> it's only my opinion
[21:54:03] <mehemoho> im not an expert
[21:54:26] <ForSpareParts> More of one than I am!
[21:54:34] <gnarf> blogs are a pretty good example of a "document"
[21:54:48] <gnarf> authors might be a reference into another collection of authors
[21:54:51] <gnarf> tags likely are
[21:54:57] <gnarf> or maybe just strings
[21:55:18] <mehemoho> i agree
[21:55:24] <gnarf> TBH - the strength of NoSQL stuff is that you really don't have to think too hard about the schema, cuz there isn't one... just make logical choices about data and you wont go wrong
[21:55:46] <mids> mehemoho: http://stackoverflow.com/questions/8840342/mongodb-dot-notation-wildcard
[21:55:54] <mehemoho> mids: thank you very much! :)
[21:56:25] <ForSpareParts> gnarf: So, I think this is part of what's confusing me -- if I could easily make references to other data by key, and if that is, in fact, accepted practice, how is this non-relational? Is it just because the database doesn't explicitly acknowledge those relationships?
[21:57:17] <mehemoho> u can share documents with different "fields" in a same collection
[21:57:25] <mehemoho> u can put documents into documents
[21:57:32] <macrover> where can I find a simple example scripts in java that shows importing json objects from a remote site into a collection. The remote site provides complete json document.
[21:57:48] <mehemoho> ...
[21:58:10] <ForSpareParts> mehemoho: Ah, okay. That... actually makes a lot of sense.
[22:01:38] <mids> macrover: take a look at com.mongodb.util.JSON.parse
[22:01:58] <ForSpareParts> mehemoho, gnarf: Would it be reasonable for me to think of the "schemaless" way fields are handled in a NoSQL database as something like duck typing in, say, Python? In that document structure is defined not by some external schema but by whatever properties the documents actually share?
[22:02:20] <gnarf> ForSpareParts: pretty much, documents are ducks
[22:02:28] <gnarf> in a collection
[22:02:54] <ForSpareParts> gnarf: Shiny. I'm feeling a little better about this, then.
[22:10:20] <mids> ForSpareParts: there are some good presentations on schema design that might interest you; for example http://www.10gen.com/presentations/mongosf-2012/schema-design-by-example
[22:10:40] <ForSpareParts> mids: THanks!
[22:10:43] <ForSpareParts> *Thanks!
[22:15:43] <npa> question: I'm writing a Ruby script to call mongodump on a sharded collection. if I lock the cluster according to the manual, and I write to the collection with another script while executing the dump, the dump just hangs. the backup script works fine when I do not use the locks. is there a good way to still create consistent backups with a script without using fsync+lock (besides using journaling and snapshots)? also, has anyone else encountered this sort o
[22:15:43] <npa> f problem with fsync+lock before in MongoDB 2.0.4?
[22:30:01] <mritz> does mongo use about the same ram as the size of the bsons ?
[23:06:38] <vsmatck> mritz: http://www.mongodb.org/display/DOCS/Caching This outlines it.
[23:16:19] <mritz> thanks
[23:28:07] <mritz> im thinking of trying btrfs with compression to help out with my very large ~5MB documents
[23:28:16] <mritz> any of you guys experiement with this?
[23:29:03] <mritz> my documents are analogous to windows registry. I'm using mongo because I can't really separate them out to reduce them in size