PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 14th of February, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:02:48] <ramnes> ok, it looks like I have some users with "subdoc":null, throwing the error
[00:03:18] <ramnes> db.user.update({"subdoc":null}, {$unset:{"subdoc":1}}) not doing anything
[00:03:38] <ramnes> how to clean this?
[00:03:58] <cheeser> check that it exists and is not null.
[00:04:23] <cheeser> or find all the nulls and remove them
[00:04:54] <ramnes> cheeser: that's what "db.user.update({"subdoc":null}, {$unset:{"subdoc":1}})" is supposed to do
[00:04:58] <ramnes> and not doing
[00:05:18] <cheeser> {multi:1}
[00:05:21] <ramnes> omg
[00:05:24] <cheeser> :D
[00:05:29] <cheeser> that gets *everybody* ;)
[00:05:31] <ramnes> dumbass tonight
[00:07:02] <ramnes> cheers cheeser
[00:07:06] <cheeser> any time
[00:07:25] <cheeser> now, time for bed time book with the kids. good luck out there. ;)
[01:24:46] <SpNg> I'm migrating a database from one AWS instance to another, and my replica sets seem to be messed up. I try to update the host on the replica set but when I run rs.reconfig(cfg) I get the error: can't currently get local.system.replset config from self or any seed (EMPTYUNREACHABLE). Any ideas?
[01:42:31] <raptor_> I am looking for some help with replica sets
[01:42:39] <raptor_> I have not been able to get past this error
[01:42:47] <raptor_> error server is not running with --replSet
[01:43:24] <raptor_> I have fed my replica sets into my config server using rs.initiate(
[01:43:30] <raptor_> and that is the error I keep on getting
[01:44:51] <cheeser> you need to start mongod with that option and give a replSet name
[01:45:07] <cheeser> http://docs.mongodb.org/manual/tutorial/deploy-replica-set/
[01:45:10] <raptor_> mongod --config /etc/mongod.conf
[01:45:17] <raptor_> my config file has that option
[01:45:22] <raptor_> I am confused why its not being picked up
[01:45:48] <cheeser> i'm not sure it gets read from mongod.conf
[01:45:49] <raptor_> that is how I am starting the mongod instance on my replica set
[01:46:12] <raptor_> You must specify the run time configuration on each system in a configuration file stored in /etc/mongodb.conf or a related location. Do not specify the set’s configuration in the mongo shell.
[01:46:14] <raptor_> from the docs
[01:46:17] <cheeser> oh, no it shows it working there.
[01:46:18] <raptor_> perhaps that is not true then
[01:46:36] <cheeser> can you pastebin your config
[01:47:10] <raptor_> do you want my config server
[01:47:13] <raptor_> or my replica set server
[01:47:21] <cheeser> your mongod.conf
[01:47:32] <raptor_> I am trying to deploy a cluster
[01:47:38] <raptor_> so there are a few of them
[01:48:24] <cheeser> well, the one giving you that error
[01:48:42] <raptor_> that is part of my issue... I am not sure which one is the problem
[01:48:45] <raptor_> give me a second and I will post
[01:51:39] <raptor_> http://pastebin.com/TQXVhPjy
[01:51:43] <raptor_> let me know if you can view it
[01:53:49] <raptor_> it seems it needs to be setup that way on the actual config server
[01:54:04] <raptor_> I am guessing based upon the error message
[01:54:07] <cheeser> i can't see it
[01:54:29] <raptor_> I switched it to public
[01:54:32] <raptor_> try it now
[01:57:10] <raptor_> let me try to add it to the configuration of my config server and restart those
[01:57:19] <raptor_> and then I am going to try add them to the interface
[01:57:24] <raptor_> and see whether or not they are there
[01:57:54] <cheeser> run: mongod -f mongod.conf -v
[01:58:03] <cheeser> see what comes out on the cli
[01:59:11] <raptor_> the instance starts
[01:59:28] <raptor_> I am going to try things out on my end the way I specified and will report back
[02:00:15] <cheeser> sure
[02:03:58] <raptor_> The configuration approach is definitely not right
[02:03:59] <raptor_> replication should not be enabled on a config server
[02:04:03] <raptor_> that is the error message I got
[02:04:11] <raptor_> mongod --configsvr --fork --config /etc/mongod.conf
[02:04:40] <raptor_> So I know that it does indeed intake the replSet variable on the configuration servers
[02:06:43] <raptor_> I am going to specify it through the command line and hope that works...
[02:07:08] <cheeser> you don't enable sharding onthe config servers.
[02:07:28] <raptor_> yup that I knew and I tried it just to see it works on my OS + mongo version
[02:07:30] <raptor_> so we know it does
[02:17:47] <raptor_> does anyone know into which server I add a replica set
[02:17:56] <raptor_> is it on the config machine or on its own machine
[02:18:05] <raptor_> how do I link a replicaset to a config server?
[02:19:08] <joannac> what?
[02:19:27] <raptor_> I am trying to setup a mongodb cluster
[02:19:33] <raptor_> I have setup three config servers
[02:19:38] <raptor_> and two query routers
[02:19:45] <raptor_> and now I want to setup a replicaset
[02:20:22] <raptor_> into which mongo shell do I type the command rs.iniiatie
[02:20:23] <joannac> okay
[02:20:33] <raptor_> how do I link a replicaset to the cluster
[02:20:35] <joannac> into one of the servers you want to be in a replica set
[02:20:49] <raptor_> so you run mongod on the replica set
[02:20:53] <raptor_> and then you type mongo
[02:20:55] <joannac> yes
[02:21:02] <raptor_> how do I then link that set to the config server
[02:21:18] <raptor_> or a query router
[02:21:23] <joannac> sh.addShard on a mongo shell to one of the mongoS processes
[02:21:39] <raptor_> so a replica set is shard?
[02:21:46] <joannac> yes
[02:21:59] <joannac> a shard is "something that holds some of your data"
[02:22:05] <joannac> that can be a replica set
[02:22:32] <raptor_> just to verify
[02:22:53] <raptor_> I connect to my config server mongo --host <domain name of mongos> --port
[02:23:16] <joannac> that's not a config server
[02:23:18] <joannac> that's a mongoS
[02:23:55] <raptor_> so I need to connect to the query router server?
[02:25:45] <joannac> cheeser!
[02:25:51] <joannac> just the person I was looking for
[02:26:02] <cheeser> uh oh
[02:26:11] <raptor_> thank you joannac
[02:27:02] <joannac> cheeser: PM'd
[02:36:51] <cheeser> joannac: i see nothing..
[02:37:26] <cheeser> joannac: errant whitelist plugin reenabled when I restart my client. :)
[02:38:07] <joannac> cheeser: :(
[02:38:12] <joannac> you always block me :(
[02:38:16] <cheeser> all better now if you want to try again.
[02:39:25] <tim85> Hello
[02:41:19] <joannac> hi
[02:41:40] <tim85> I was hoping someone could give me some advice, I have a table with ~10million rows of data in it, and ideally I would like to write it to disk in a csv/json format every 5 minutes... I have tried to do this in node.js using the native driver (db.collection('test').find().stream()) and it is taking wayy longer than 5 mins
[02:42:11] <tim85> I am guessing that it might be IO bound - but hoping there might be something I can do to improve the speed?
[02:43:15] <tim85> oh and I am simply doing console.log(JSON.stringify(item) in the script then piping to a file (node printdb.js > output)
[02:44:05] <joannac> why don't you mongoexport instead?
[02:44:36] <tim85> I will look into that now - just started using mongodb yesterday, so wasnt aware! Thanks
[02:48:08] <tim85> hmm from the docs 'To run with --dbpath, mongoexport needs to lock access to the data directory: as a result, no mongod can access the same path while the process runs.' Is there another approach to use if i dont want to kill mongod?
[02:49:42] <cheeser> don't run with that option?
[02:51:00] <tim85> ok seems a bit better, thought I had to :)
[02:56:50] <tim85> ok that works - still is slow though - is that expected for large data sets?
[03:40:32] <apipkin1> I'm trying to use mongoose to connect to a remote shared mongodb. I'm having an issue getting models to map to my collections. is this possible or is there a better option?
[03:54:47] <skybound> good morning; got a question concerning "manual" query expr evaluation: i have cursor with the result of a query; for each result i want to apply multiple query expressions and check for matches. To get to the question: is query eval implemented in the driver level (e.g. Java); or more precisely: is it likely that i can reuse existing driver code?
[04:10:54] <jkitchen> I have a delayed replica in my replica set. works great. I'd like to get it to stop playing back oplogs for a bit though, is it possible to pause it while leaving it available for reads?
[04:11:31] <jkitchen> replSetMaintenance sorta seems like what I want, but you can't read from the slave during that time
[04:13:27] <apipkin1> I only need to read a mongo db, not write to it. What is the best method for this? I've been trying mongoose, but it doesn't seem to only reads
[04:20:50] <joannac> apipkin1: read-only user?
[04:21:22] <apipkin1> joannac: yeah. it's a remote mongodb resource
[04:22:17] <apipkin1> with mongolian, i am able to get the data, but i'm not sure if that's the best way to go about it
[04:43:54] <jkitchen> is there a way to say that slaveOk is true when using the cloneCollection admin command/
[04:44:06] <jkitchen> I'm trying to copy a collection from a delayed replica into the primary
[04:51:30] <mst1228> what is the easiest way to delete everything in an array field?
[04:51:34] <mst1228> empty the array
[05:04:36] <mst1228> duh, just set the field to [ ]
[05:29:04] <Waheedi> ok I'm having a weird problem here
[05:30:53] <Waheedi> i have a rails app, rib session, and mongo session
[05:31:04] <Waheedi> now i have database x;
[05:31:19] <Waheedi> x has collection y
[05:31:44] <Waheedi> y.count shows on rails that it has 760 row
[05:32:04] <Waheedi> and mongo session and irb session that only one row exists
[05:32:32] <Waheedi> ok I'm i in the wrong channel?
[05:33:23] <Waheedi> hello
[05:58:58] <joannac> People aren't very patient.
[05:59:07] <joannac> My guess would be he's not in the same database
[07:41:58] <apipkin1> Is there a common reason why `findById` wouldn't find a document even when the id is copied directly from a result?
[07:42:12] <apipkin1> (using mongoose)
[07:53:11] <joannac> data types? string vs objectid?
[07:54:33] <apipkin1> I've tried String and ObjectId. I didn't create a new ObjectId, just did ObjectId(id)
[08:08:34] <BlakeRG> i have an app that issues a remove and then an insert into a collection, is it possible for the insert to happen before the remove finishes even though in code the remove comes first?
[09:49:38] <RandomIRCGuy> Good day, can someone give me some info about "functions" for mongodb? In Mysql we could set up a function which gets started after some insert was done. I want to calculate some statistics and need some kind of function. Of couse I could to this in PHP with an new insert, but there should be a more performant way to do this, shouldnt it?
[09:49:56] <RandomIRCGuy> do this*
[09:53:35] <kali> RandomIRCGuy: what you describe is called a trigger in the SQL world, and there is not equivalent in mongodb
[09:54:06] <RandomIRCGuy> Not even close to? So I have to make two inserts every time then?
[09:54:36] <kali> RandomIRCGuy: the closest thing to it is a python hack that lurk on the operation log and triggers stuff from outside
[09:55:29] <RandomIRCGuy> Well I'm saving data from php into a file, and a python script inserts all new files into the database, so I know when a query get's inserted. Ive thought mongo provides a better solution for doing such stats
[09:55:56] <RandomIRCGuy> I guess I will do it that way then, thank you :)
[09:58:08] <kali> RandomIRCGuy: well, as a general note, mongodb tends to be simpler than SQL dbs, because it make things easier when you need to replicate and/or shard. scaling the application layers is usually easier than the database, so everything that can be achieved in the application world is meant to stay there
[09:59:20] <RandomIRCGuy> That makes sense now after I read about the potential queries I can do. It's really a hard task to switch from mysql to mongo.. it's like starting to learn driving after using a bicycle the whole life :p
[10:01:20] <kali> RandomIRCGuy: been there :)
[10:18:39] <Nodex> I found the learning curve for Mongodb very fast personaly
[10:28:57] <RandomIRCGuy> Nodex: Yes it is, but the start is pretty hard if you have never touched a nosql database and always relied on mysql :p
[10:29:08] <RandomIRCGuy> I must say in these few days Ive learned a lot, which is good
[10:35:56] <Derick> RandomIRCGuy: what did you find the biggest difference(s)?
[10:36:57] <RandomIRCGuy> Derick: Hmm.. I think the queries. First they look pretty easy. But when it comes to aggregations and grouping it was kind of hard to understand it in a short time
[10:37:14] <RandomIRCGuy> You still think too much in SQL. and try to do stuff mongodb doesnt understand#
[10:38:31] <Derick> Anything related to the data model too?
[10:39:43] <KamZou> Hi, is mongodump recommanded to backup a config_svr ?
[10:40:35] <RandomIRCGuy> Well, it was a bit weird to change the whole logic between sql and nosql. In my applications Ive used the 3rd data model. Always created link tables, always tried to structure the code as much as I can .. and Ive tried to do the same with the mongo db structure, but then I got hard problems when it came into grouping and trying to link all that stuff I need :p
[10:40:49] <RandomIRCGuy> It was hard to understand that I just need one big collection for my project
[10:41:38] <RandomIRCGuy> I always kept the mysql thinking in my mind and made the task for myself a lot harder
[10:41:52] <Derick> (in case you're wondering, I am currently writing a presentation on this)
[10:42:16] <RandomIRCGuy> Well. Then ask away :)
[10:43:29] <langemann> Hello all, could anyone please take a look at this? http://stackoverflow.com/questions/21244664/multiple-distinct-keys-from-several-documents-in-mongodb/21244734?noredirect=1#21244734
[10:46:14] <KamZou> When i restore a config_server with a dump (mongodump) from another, during the restore i get : INVALID OBJECT - going try and pring out
[11:26:12] <harshada> Hey Someone please help me in groupby query.. Collection is "Ads" having field "offer".. Now I want to group by ads by offer .. and structure like {'$offer1':[ads1, ads2,..],'$offer2':[ads3,ads4,..] }
[11:34:58] <Nodex> harshada : pastebin your query
[12:46:41] <Gleb`> guys, I'm storing the current chat conversation between two people in mongo, whenever one tries to open a new chat window I want to find and continue the old conversation
[12:47:15] <Gleb`> So I've got this now: Chat.findOne({users: {$all: users} }).exec(function(err, chat) { //some code.. });
[12:48:03] <Gleb`> But it also finds group chats where these two users are participating, how can I make this query make the users array exactly (different order maybe but only these users)
[12:55:03] <Nodex> Gleb` : what does your users field look like?
[13:06:54] <Gleb`> Nodex: users is just an array of user ids, in the model its is defined as users: [{type: mongoose.Schema.Types.ObjectId, ref: 'User'}]
[13:32:27] <Nodex> means nothing to me but if it's an array like this [1,2] then you can match exactly that
[13:32:44] <Nodex> Chat.findOne({users: [users] }).exec(function(err, chat) { //some code.. });
[13:34:34] <Gleb`> Nodex: I see, well I used to find users through another mongo query so it is an array of user objects as define by the user model, i'll try that exact match approach but the order in which users are defined would matter
[13:35:58] <Nodex> pretty sure the order doesn't matter for the purposes of the index
[13:36:23] <Nodex> I've done the exact same thing you're doing (minus the mongoose crap) and it's always worked fine
[13:38:29] <Gleb`> hehehe, thanks =) testing now
[13:40:31] <Nodex> at worst you can just apply a sort to the array when you save it and a sort to it when you query it
[13:40:47] <Nodex> (a sort in your language not in Mongodb)
[13:41:47] <jonaswouters> How long does renaming a large collection take? Is that instant ?
[13:41:57] <Gleb`> yeah, seems to work so far, need to fix something else to test properly, thanks :)
[13:51:08] <RandomIRCGuy> I have a model like this: {_id, Host, Title, URL} how can I aggregate all the documents when I want to find every document that has a specific Host and filter the documents by Title? So .. if I have two documents who have the same Host and Title, I want to get one. Is that possible?
[14:00:29] <riot> ohai.
[14:01:00] <riot> are there any plans for something like this: http://en.wikipedia.org/wiki/Spatiotemporal_database
[14:04:38] <KamZou> After recovering from a crash on 2 of my 3 config servers i got the following message in the mongoS logs : "errmsg: "official version less than mine?" any idea how to solve it ?
[14:07:10] <Nodex> riot : Mongodb has geojson and polygon support already
[14:09:32] <riot> Nodex: i know. I'm awaiting some new incoming hotness (iirc 2.6?) to see how s57 can be integrated.. but the temporal aspect would relieve me of coding substantial parts of that, or at least give me a good place and mechanisms to store and work with time data
[15:50:48] <Nodex> Derick : is there a php helper method for a geoNear query returning distances?
[15:51:01] <Nodex> or does it have to be done with runCommand
[15:52:06] <Derick> right now, only through aggregation
[15:52:16] <Nodex> dang
[15:52:26] <Derick> from 2.6, you can AFAIK also do it with a normal query
[15:53:10] <Nodex> ok ta
[15:53:14] <Derick> Nodex: it's not a PHP driver thing though...
[15:54:53] <Nodex> I understand, thoguth there might be a helper for the runCommand('geoNear'.....
[15:54:57] <Nodex> thoguht*
[15:55:16] <Derick> yeah, no - we don't really add helpers for simple things
[15:57:09] <Nodex> so'k, I'll just write one quickly in my wrapper, no biggie
[16:02:48] <ekristen> hey guys, is there any way to make sure mongos or a client doesn’t read from a replica if the replication lag is greater then a defined value?
[16:05:49] <Joeskyyy> You should be able to use the oplog as your helper for something like that, just a quick sanity check before you do the read
[16:05:49] <Joeskyyy> http://docs.mongodb.org/manual/tutorial/troubleshoot-replica-sets/
[16:06:04] <Joeskyyy> 2nd point on that page
[16:06:23] <ekristen> hrm
[16:31:07] <apipkin1> In express with mongoosejs, I have a query that works and returns an item. When I copy the _id value as a string, and pass that back into the query with `findById(itemId)` it returns an empty set. Am I doing something wrong?
[17:04:41] <fmuzf> ls
[18:16:14] <link151> hey all, i have a repeating wierd case
[18:16:26] <link151> i have a cluster of 3 hosts with a replica set shared between them
[18:16:43] <link151> regularly one host (not the master) stops being able to communicate with the other 2 hosts
[18:16:49] <link151> this one host thinks its alive and the cluster is fine
[18:16:53] <link151> the other hosts cant reach it
[18:17:02] <link151> everything querying the cluster times out
[18:17:12] <link151> only way to fix it is ot log onto the host that thinks its ok, and kick mongo
[18:17:20] <link151> then it seems to communicate fine
[18:17:42] <link151> any ideas on wtfx?