PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 7th of October, 2013

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:21:46] <imsky> is there a way to sort, say, a webpage by visits and then alphabetically? doing .sort({visits:1, name:1}) doesn't do the right thing
[00:38:44] <cheeser> wrong how?
[00:38:49] <cheeser> or not. :)
[00:48:45] <rafaelhbarros> ok, cheeser, which language you use mongo with?
[01:34:28] <Gaddel> is there a way to "freeze" a cursor, so that if the cursor isn't iterated over but if you have the cursor and then insert another document after, the cursor won't include the new document?
[02:01:29] <Gaddel> anyone around?
[02:11:16] <BurtyB> hmm
[02:11:30] <Gaddel> is there a way to "freeze" a cursor, so that if the cursor isn't iterated over but if you have the cursor and then insert another document after, the cursor won't include the new document?
[04:49:51] <k_sze[work]> The config server databases of my cluster are eating up more than 3 GB each. I don't like that.
[04:50:27] <k_sze[work]> Is there a way I can shrink them *post-deployment*?
[04:56:36] <OilFanInYYC> Hey I have a question about MongoDB 2.4.6. I have a collection setup with a bunch of hockey games listed with HOME & VISITOR. When I run $or query on those particular fields I am getting 0 documents returned. I can run the query on each separately and get a response but as $or nothing.
[04:57:58] <OilFanInYYC> Here is a sample of the data: { "visitor" : "MIN", "home" : "PHX", "season" : 20132014, "gametype" : 2 }
[04:57:58] <OilFanInYYC> { "visitor" : "ANA", "home" : "VAN", "season" : 20132014, "gametype" : 2 }
[04:57:58] <OilFanInYYC> { "visitor" : "WPG", "home" : "LAK", "season" : 20132014, "gametype" : 2 }
[04:57:58] <OilFanInYYC> { "visitor" : "CGY", "home" : "OTT", "season" : 20132014, "gametype" : 2 }
[04:57:58] <OilFanInYYC> { "visitor" : "TBL", "home" : "DET", "season" : 20132014, "gametype" : 2 }
[04:57:58] <OilFanInYYC> { "visitor" : "BOS", "home" : "PHI", "season" : 20132014, "gametype" : 2 }
[04:58:00] <OilFanInYYC> { "visitor" : "CHI", "home" : "PIT", "season" : 20132014, "gametype" : 2 }
[04:58:02] <OilFanInYYC> { "visitor" : "WSH", "home" : "NSH", "season" : 20132014, "gametype" : 2 }
[04:58:04] <OilFanInYYC> { "visitor" : "NYR", "home" : "EDM", "season" : 20132014, "gametype" : 2 }
[04:58:06] <OilFanInYYC> { "visitor" : "CAR", "home" : "OTT", "season" : 20132014, "gametype" : 2 }
[04:58:08] <OilFanInYYC> { "visitor" : "FLA", "home" : "NJD", "season" : 20132014, "gametype" : 2 }
[04:58:10] <OilFanInYYC> { "visitor" : "WPG", "home" : "ANA", "season" : 20132014, "gametype" : 2 }
[04:58:12] <OilFanInYYC> { "visitor" : "MIN", "home" : "LAK", "season" : 20132014, "gametype" : 2 }
[04:58:14] <OilFanInYYC> { "visitor" : "NJD", "home" : "BUF", "season" : 20132014, "gametype" : 2 }
[04:58:16] <OilFanInYYC> { "visitor" : "CGY", "home" : "TOR", "season" : 20132014, "gametype" : 2 }
[04:58:18] <OilFanInYYC> { "visitor" : "FLA", "home" : "NYI", "season" : 20132014, "gametype" : 2 }
[04:58:20] <OilFanInYYC> { "visitor" : "CAR", "home" : "PIT", "season" : 20132014, "gametype" : 2 }
[04:58:22] <OilFanInYYC> { "visitor" : "DAL", "home" : "WSH", "season" : 20132014, "gametype" : 2 }
[04:58:26] <OilFanInYYC> { "visitor" : "COL", "home" : "CBJ", "season" : 20132014, "gametype" : 2 }
[04:58:28] <OilFanInYYC> { "visitor" : "MTL", "home" : "TBL", "season" : 20132014, "gametype" : 2 }
[05:07:23] <joannac> OilFanInYYC: Please use pastebin in future
[05:07:32] <OilFanInYYC> Ok sorry
[05:07:37] <joannac> OilFanInYYC: Also, show your query?
[05:08:28] <OilFanInYYC> db.schedule.find({ $or: [ { home: "TBL", visitor: "TBL" } ] })
[05:11:41] <joannac> those 2 have to be separate documents in the array
[05:12:19] <joannac> [{ home: "TBL"}, {visitor: "TBL"}]
[05:12:26] <joannac> OilFanInYYC: ^^
[05:14:02] <OilFanInYYC> oh crap yes I knew that too just saw it in the examples. Thanks
[05:15:00] <OilFanInYYC> stupid me missed the separate documents
[07:22:22] <[AD]Turbo> hi there
[07:58:50] <mark____> hi
[07:58:54] <mark____> anybody is here
[07:59:16] <ron> nope
[07:59:52] <mark____> please
[08:00:06] <ron> you're welcome.
[08:01:20] <mark____> http://pastebin.com/q6D2s7Hc
[08:01:20] <mark____> Error: database names cannot contain the character '.'
[08:03:17] <mark____> ron:???
[08:03:30] <ron> what?
[08:04:05] <mark____> above i mentioned the error and also the code pasted
[08:04:20] <ron> ok
[08:05:27] <ron> mark____: the error is pretty clear, I think.
[08:05:50] <mark____> ron:yes but i dnt find
[08:06:22] <ron> well, the code doesn't say what's the db name you're using.
[08:06:44] <mark____> ron: db-login
[08:07:11] <ron> mark____: what's the value of the variable 'db'?
[08:07:26] <ron> oh, now I see.
[08:07:29] <ron> damn, I'm tired.
[08:07:53] <ron> mark____: no, the name you give your db is mongodb://**.**.**.**:27017/db-login.
[08:08:16] <mark____> ron: yes
[08:08:22] <ron> well, that's wrong.
[08:08:36] <mark____> ron: then how will i do that
[08:08:49] <ron> just pass db-login there
[08:09:19] <mark____> ron: i already do that but i want to login through url so
[08:09:25] <mark____> http://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html
[08:11:19] <joannac> mark____: then you need to rewrite your mongoclient function
[08:11:55] <joannac> mark____: right now that function doesn't do authentication
[08:12:19] <mark____> joannac: how will i
[08:12:20] <mark____> please
[08:13:13] <mark____> http://pastebin.com/pJWgTbHf
[08:13:28] <mark____> where i have to put authentication? nd how
[08:15:13] <mark____> ron:??
[08:15:18] <mark____> joannac:???
[08:17:27] <mark____> hey i think u miss my question please
[08:22:20] <joannac> mark____: this is a free help channel. We help as we can, but we're not here for dedicated support.
[08:22:47] <joannac> Read the "authenticate" section/example here http://mongodb.github.io/node-mongodb-native/api-generated/db.html
[08:23:13] <mark____> joannac: i know that.sorry
[08:25:24] <mark____> joannac: can you please more a little?
[08:25:32] <mark____> help*
[08:26:22] <joannac> I don't know NodeJS, so not really.
[08:27:07] <mark____> joannac: can you please help me to correct the code with the authentication???
[08:28:49] <mark____> http://pastebin.com/q6D2s7Hc
[08:30:56] <joannac> mark____: Run it and see if it works.
[08:31:19] <mark____> noops
[08:32:56] <mark____> joannac: 500 Error: database names cannot contain the character '.'
[08:35:21] <joannac> didn't we just address that?
[08:35:43] <joannac> your mongoclient function takes a "dbname" and a "ip"
[08:36:13] <joannac> "mongodb://**.**.**.**:27017/dblogin" is not a db name
[08:38:48] <mark____> joannac: ii want to login thorugh url. and db name is db-login rest is the url
[08:54:15] <mark____> joannac:???
[10:22:41] <mark____> http://pastebin.com/dcj2EqsA ...i want to login via url beccause i also check the other aspects of login ..please help me if you can.Really need help Noders
[11:27:46] <hyperboreean> is there any admin command to check if data is being sent to a particular socket ?
[11:45:20] <talbott> hello
[11:45:27] <talbott> i wonder if someone could help out a newbie
[11:45:33] <talbott> / numpty
[11:45:40] <talbott> please
[11:49:01] <talbott> I'm trying to setup replication
[11:49:08] <talbott> but during the process i made a mistake
[11:49:24] <talbott> i did an rs.initiate() on the secondary server, not the primary
[11:49:47] <talbott> so, was wondering how i back that out on the secondary?
[11:50:04] <talbott> because now i have two primary servers :(
[11:51:41] <Number6> talbott: Is the secondary brand new - with no data on it?
[11:51:48] <talbott> yes
[11:51:57] <talbott> brand new - lots of data in the primary
[11:52:03] <talbott> but nothing in the secondary
[11:52:28] <Number6> stop mongodb on the secondary, and delete everything in --dbPath. When you restart MongoDB on the secondary, you can do an rs.initiate() on the primary
[11:52:45] <Number6> How much data does your primary have?
[11:52:54] <talbott> about 2gb
[11:53:25] <talbott> ok thanks let me give that a whirl
[11:53:36] <talbott> (<3 mongo btw!)
[11:53:49] <Number6> talbott: I'd imagine your secondary will be able to do an initial sync fairly quickly so. :-)
[11:54:07] <talbott> cool let me give this a try and i'll stick around
[11:54:20] <talbott> thanks so much for your help
[11:54:21] <Number6> np
[11:54:28] <talbott> i felt like such an idiot running it on the wrong machine
[11:54:38] <Number6> Trust me, everyone does it :-)
[11:56:46] <talbott> so files like local.1, journal, mongod.lock - blat them all?
[11:57:29] <Number6> Yep
[11:57:51] <Number6> Just be sure that MongoDB is actually stopped.
[11:57:55] <talbott> ok
[11:58:10] <Number6> The engineers have programmed it to feel pain, which isn't very nice.
[11:58:32] <talbott> ha
[11:58:34] <talbott> ok stopping
[11:58:48] <talbott> actually just taking an image of my primary
[11:58:52] <talbott> you never know
[11:58:55] <talbott> i have clumsy fingers
[11:59:03] <Number6> Always better to be safe than sorry!
[11:59:38] <talbott> ah no worries, i have a scheduled server image from 1am
[11:59:41] <talbott> right stopping
[12:00:02] <Number6> I accidently shutdown a server before... That was a 4 hour drive away... and no IMPI. Had to drive to it, to hit the power button
[12:00:10] <talbott> ha!
[12:00:18] <Number6> *IPMI / iDrac
[12:00:19] <talbott> i can leave the mongodb directory though right?
[12:00:24] <talbott> dbpath is /var/lib/mongodb
[12:00:37] <Number6> Yes, please. Leave the MongoDB directory and it's permissions (probably mongodb:mongodb)
[12:00:44] <talbott> right
[12:01:03] <talbott> journal is a directory
[12:01:10] <talbott> take that whole thing out?
[12:01:14] <Number6> Yep.
[12:01:27] <talbott> awesome, all gone
[12:01:37] <talbott> now
[12:01:41] <talbott> because i was double numpty
[12:01:50] <talbott> i even put the replSet in the mongodb.conf
[12:01:56] <talbott> so, comment that out
[12:02:14] <talbott> (basically, i thought i was working on the primary when i was setting this up)
[12:02:52] <Number6> You can leave it in the config file - provided the name is the same on both of them, that's all you need to tell the secondary "hey, you're part of the applkes replicaset"
[12:03:00] <Number6> *apples
[12:03:04] <talbott> right
[12:03:14] <talbott> will leave
[12:03:36] <talbott> seondary started, going back to primary
[12:05:00] <talbott> already did rs_initiate there
[12:05:03] <talbott> so now i can just do: rs.add("<hostname><:port>")
[12:05:09] <talbott> with my host:port, right?
[12:06:17] <Number6> Yep
[12:06:41] <Number6> That'll kick off an initial sync as well - you can check using rs.status()
[12:07:05] <Number6> Are you going to have another secondary, or an arbiter?
[12:07:29] <talbott> hmm says the db is not ok
[12:07:36] <talbott> i guess it thinks it's not up
[12:07:44] <talbott> exception: need most members up to reconfigure, not ok
[12:08:08] <talbott> maybe i should see if i can connect from the commandline from primary to secondary
[12:08:36] <Number6> I was just about to say that - use a mongo shell and see if you can connect
[12:08:40] <talbott> yah
[12:09:27] <talbott> hmm maybe my firewall is blocking the port
[12:11:25] <talbott> { "ok" : 1 }
[12:11:30] <talbott> :)
[12:11:33] <Number6> \o/
[12:11:39] <Number6> iptables?
[12:11:48] <talbott> dns issue
[12:11:57] <Number6> Ahh!
[12:12:14] <talbott> so i guess the thing is syncing away
[12:12:14] <talbott> let me try an rs.status on both
[12:12:20] <Number6> Please
[12:12:50] <talbott> ok on the primary
[12:13:10] <talbott> "lastHeartbeatMessage" : "still initializing"
[12:13:26] <talbott> on the secondary:
[12:13:27] <talbott> "errmsg" : "can't currently get local.system.replset config from self or any seed (EMPTYUNREACHABLE)"
[12:14:03] <Number6> Give it a few minutes - the init procedure takes a while
[12:16:07] <talbott> gotcha
[12:19:50] <talbott> wow still initialising
[12:20:10] <talbott> to come back to your last question
[12:20:17] <talbott> i could go either way
[12:20:22] <talbott> what would you recommend?
[12:20:34] <talbott> if i go with an arbiter, i should set that up on the primary, right?
[12:20:40] <Number6> Jesus no
[12:20:43] <talbott> oooh ok
[12:20:54] <talbott> hmm maybe i need to go read up on that
[12:20:59] <Number6> If the primary machine goes down, where will the majority come from? :-D
[12:22:12] <talbott> ah i see the recommended deplyoment arch is 1 pri with 2 secondary
[12:22:16] <talbott> that will work fine
[12:22:16] <Number6> I'm a sysadmin by trade - I'd always take another data bearing node (i.e. another secondary) over an arbiter. If stuff hits the fan, you can still chug along
[12:22:38] <talbott> damn though, i should've cloned my secondary before starting the rep
[12:22:45] <talbott> you know what question is coming next...
[12:23:01] <Number6> "Have you ever put a cow through a mincing machine?"
[12:23:11] <talbott> haha
[12:23:59] <talbott> clone secondary 1...repeat steps above to backout rep on secondary 2......rs.add(secondary2)...?
[12:24:23] <Number6> Yep. Or rsync the files from secondary 1 to secondary 2, and start up secondary 2
[12:24:31] <Number6> That's called "preseeding"
[12:24:50] <talbott> rysnc the --dbpath?
[12:24:54] <Number6> Yeah
[12:25:09] <Number6> Helps speed things up a bit - although for 2GB, you might be better off just doing the inial sync
[12:25:20] <talbott> wouldnt even need to rync it if i take a cloud image or secondary1 when this is complete to build secondary2
[12:25:27] <Number6> It depends. If the inital sync takes, like 6 hours, do an rsync :-)
[12:25:46] <Number6> talbott: Like cloning an EBS volume? That works
[12:25:58] <talbott> EBS?
[12:26:13] <Number6> Amazon's block storage device
[12:26:22] <talbott> ah right
[12:26:30] <talbott> actual i've got these files local
[12:26:37] <talbott> to rackspace cloud servers
[12:26:38] <talbott> so not quite
[12:26:55] <Number6> Ah yeah - similar concept, though
[12:27:07] <talbott> yeh - the server will be a complete clone, with these files on it
[12:27:18] <talbott> so i need to change any mongo.conf settings?
[12:27:23] <Number6> Just be sure there's enough time for the new machine to rejoin the set - either from an rsync or file based copy, or an inital sync.
[12:27:43] <talbott> or can i go with the clone and just do an rs.add from the primary?
[12:27:43] <Number6> If you're in MMS, keep an eye on the "Replica" graph. The more, the better
[12:28:00] <Number6> You don't need to change the config file on the primary, just an rs.add()
[12:28:51] <talbott> i'm not but i should be, is it free?
[12:28:58] <talbott> told you i was a newb
[12:29:25] <talbott> .."lastHeartbeatMessage" : "still initializing"....worried....
[12:29:40] <Number6> It's free. You run a python "agent" that has your replicaset push data to MMS, that MMS graphs
[12:29:53] <talbott> awesome, going to get on there today
[12:30:28] <Number6> I need to run off for about an hour or two, but I'll be back
[12:33:06] <talbott> thanks very much
[12:33:12] <talbott> i'll be here :)
[12:39:41] <spicewiesel> I have a problem with my replicaSet. There are 3 members, sometimes both secondaries get very slow, not the system itself (ram free and low systemload) but the login to mongod lasts minutes. There are no issues in the logfile and mongod is still posting to the logfile, that seems to be ok. The problem is that nagios gets timouts while checking replication lags etc. While this happens the Primary is completely reliable. Does an
[12:40:56] <kali> spicewiesel: you irc client cut at "Does
[12:40:58] <kali> an"
[12:41:11] <kali> sorry for the wrapping, that's on my side :)
[12:41:13] <spicewiesel> oops :) Does anyone know what that could be?
[12:47:23] <mark____> how-to-connect-with-username-password-to-mongodb-using-native-node-js-driver???
[14:34:21] <talbott_> hey Number6
[14:34:27] <talbott_> your friendly numpty is back
[14:34:40] <Number6> hey talbott_
[14:34:45] <Number6> Did the sync start?
[14:34:54] <talbott_> no :(
[14:34:55] <talbott_> "lastHeartbeatMessage" : "still initializing"
[14:34:59] <talbott_> is it normal to wait this long?
[14:35:24] <Number6> Nope. What do the logs say? Put them up on pastebin, and /msg me the link
[15:48:46] <counterwall> I want to do bulk inserts, but in a thread-safe way. Currently, I'm using upserts to do my inserts, but I can only insert one document at a time. Is there a way where I can get the bulk inserts while still having the insert be thread safe?
[16:11:17] <elux> hello
[16:11:28] <elux> does anyone have a suggestion on now to model a linked list of documents in a collection?
[16:12:11] <elux> an incrementing index like 1,2,3,4,etc. isn't great if documents need to be reordered.. or you can do blocks like 10, 20, 30, etc. will work.. but.. its not great..
[16:12:36] <elux> im actually thinking of using a float for the index instead.. but i wonder if someone has even a better idea
[16:18:21] <kali> elux: float are ok... you may need to rebalance them at some point
[16:18:21] <counterwall> elux, why not just have a field that references previous and next?
[16:18:32] <counterwall> *string field
[16:18:51] <elux> counterwall: because ill need to sort by that column, and fetch groups of data in that order
[16:18:58] <kali> counterwall: because it makes it hard to grab them in an ordered list
[16:19:05] <kali> :)
[16:19:14] <counterwall> ok
[16:19:42] <elux> thanks guys.. ill try the float route for now
[16:25:31] <lazyPwork> Whats the role that should be associated with a service account to list db.serverStatus?
[16:25:41] <lazyPwork> i'm not finding mucha bout that in the authentication portion of the docs on my initial scan
[16:34:30] <counterwall> does mongodb have any kind of auditing?
[16:57:46] <mkommar> counterwall: I read that there are oplogs
[16:59:38] <mkommar> https://groups.google.com/forum/#!topic/mongodb-user/JAvCIR3WZRM
[17:10:16] <liquid-silence> fix for mongodb on mavericks yet?
[17:27:29] <ixti> hi all
[17:27:44] <ixti> does background index affects atomic update?
[17:27:46] <ixti> e.g.
[17:28:14] <ixti> ensureIndex({ tag_id: 1 }, { background: 1 });
[17:28:38] <ixti> update({ tag_id: "..." }, { $set: { a: 1, b: 2 } })
[17:28:57] <ixti> s/)/, { multi: 1 })
[18:28:24] <Gaddel> is there any way to "freeze" a cursor, so that once the cursor is obtained, other documents inserted won't affect it and won't be in the iterated results?
[18:38:33] <cheeser> that's called a transaction, and no. :)
[18:39:16] <Gaddel> cheeser: ...is that really a transaction?
[18:39:28] <cheeser> basically
[18:46:41] <Gaddel> cheeser: well, I just mean on the application side, not the db side
[18:46:43] <cheeser> how would the application manage that?
[18:46:48] <Gaddel> c = something.find(); db.insert(doc); print list(c) (in python)
[18:46:59] <Gaddel> so the new doc won't be printed, only what was seen when the cursor was first acquired. though I guess I can't have both "frozen" and "lazy"
[18:46:59] <cheeser> that'd asking an inordinate amount of state management on the part of the driver.
[18:47:02] <cheeser> (setting aside the obvious data integrity and durability concerns)
[18:47:02] <Gaddel> I suppose so
[18:47:11] <Gaddel> however I was under the impression that once you begin iterating a cursor, the cursor will actually be frozen, even if you've only stepped past the first result
[18:47:27] <cheeser> there might be some internal cursor state that tracks which document IDs it's viewing but i've not heard of such a thing.
[18:47:29] <cheeser> you could use your code above to test it, though.
[18:47:34] <Gaddel> testing it right now
[18:47:57] <Gaddel> cheeser: it does in fact seem to freeze it
[18:48:05] <Gaddel> cheeser: though interestingly, because of this, cursor.count() != number of iterations when doing this
[18:53:08] <airandfingers> when i run "sudo service mongodb start" (ubuntu), the service doesn't actually start, but it works fine when i run the command from /etc/init/mongodb.conf: "sudo mongod -f /etc/mongodb.conf".. what's the difference?
[19:34:44] <Number6> talbott: How'd it go?
[20:05:50] <airandfingers> when i run "sudo service mongodb start" (ubuntu), the service doesn't actually start, but it works fine when i run the command from /etc/init/mongodb.conf: "sudo mongod -f /etc/mongodb.conf".. what's the difference?
[20:10:53] <Number6> airandfingers: What version of Ubuntu?
[20:11:07] <Number6> And how was it installed? (10gen repos?)
[20:16:47] <airandfingers> Number6: 10.04, and we downloaded mongodb-10gen_2.4.6_amd64.deb from mongodb.org
[20:18:06] <Number6> Ok. You might be missing a few lines from /etc/init.d/mongodb -- that's where the config file defaults are set, IIRC
[20:19:05] <airandfingers> i dug through those scripts a bit, it looks like /etc/init.d/mongodb just points to /etc/init/mongodb, which has the command i'm trying to copy:
[20:19:26] <airandfingers> err, make that /etc/init/mongodb.conf
[20:19:39] <airandfingers> if [ "x$ENABLE_MONGODB" = "xyes" ]; then exec start-stop-daemon --start --quiee t --chuid mongodb --exec /usr/bin/mongod --config /etc/mongodb.conf; fi
[20:19:58] <airandfingers> the last part of that (/usr/bin/mongod --config /etc/mongodb.conf) is what i'm trying on the command line, and it's working just fine
[20:20:54] <Number6> Are the permissions all ok on the config file?
[20:21:36] <airandfingers> 644, owned by root
[20:21:50] <airandfingers> i'm running everything with sudo, so i figure it should be fine
[20:23:49] <Number6> Can you try chowning the config file to have mongodb as the user - Which I'd say is the same as your dbpath
[20:26:38] <airandfingers> done. nothing seems to have changed (service still doesn't actually start up; running manually works fine)
[20:28:01] <airandfingers> i should note, i'm attempting to dynamically edit my config file when i install a package
[20:28:20] <airandfingers> running this script:
[20:28:24] <airandfingers> # Enable MongoDB authentication sudo sh -c 'echo "auth = true" >> /etc/mongodb.conf' # Disable authentication exception for localhost sudo sh -c 'echo "setParameter = enableLocalhostAuthBypass=0" >> /etc/mongodb.conf'
[20:31:05] <Number6> Interesting
[20:31:05] <airandfingers> (so that i can add users via another script, THEN enable auth)
[20:31:30] <Number6> I'm afraid that it's my bed time - but I'm sure someone here can help also. It's more of a Linux issue than MongoDB :-)
[20:31:46] <airandfingers> heh sounds like it, i've been asking in #ubuntu with no luck so far
[20:31:57] <airandfingers> might try a serverfault question. thanks for your help though
[23:08:11] <rafaelhbarros> silly, possibly stupid question
[23:08:13] <rafaelhbarros> is _id indexed on mongodb?
[23:10:05] <crudson> always, uniquely