PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 20th of October, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[04:19:59] <unpro> would findOne({'md5': '12345678901234567890123456789012'} where md5 is a text indexed field be reasonable, and always return a complete text match?
[04:20:12] <unpro> (i'm wondering if its getting hashed internally and truncated)
[04:20:38] <unpro> because ive got like 8million documents, and i'm expereincing some weird behavior
[04:20:40] <joannac> why is it text indexed if you want to do exact matches?
[04:20:48] <unpro> because im a newb
[04:21:13] <unpro> how do i make an exact match, do i need to cast it as some gigantic number?
[04:21:48] <joannac> no?
[04:21:55] <joannac> just have a normal index on it
[04:21:58] <joannac> it's a string
[04:22:53] <unpro> so if it was a normal index, it would be exact match then?
[04:23:27] <unpro> the weird behavior i'm experiencing is i'll try to find the same document using the same code, and it will either hit or miss
[04:23:54] <unpro> but i cant get it do to that when i go to the console its always there
[04:24:00] <unpro> and seems to be the right document
[04:25:00] <joannac> that sounds like a problem with your code
[04:25:32] <joannac> I just tested on 2.6.5
[04:25:55] <unpro> thats always a possibility i guess
[04:26:04] <joannac> with a text index, it ignores it and does a collection scan
[04:26:13] <unpro> but i've got this thread locked ;\ im sure of it... maybe
[04:26:15] <joannac> but it finds all of them
[04:27:37] <unpro> hm i don't even know that it is a text index, i did self.db.file.ensure_index('md5', unique=True, dropDups=True)
[04:27:49] <joannac> that's not a text index...
[04:31:39] <joannac> In any case, that search should work
[04:36:32] <unpro> could it be something with the create_index vs ensure_index?
[04:37:34] <unpro> becuase i swear, i have assert() in place that verifies that the find_one for the field/value returns None, and then hits when I do it a 2nd time >_>
[04:37:49] <unpro> unless its some *cursed* whitespace
[04:37:51] <unpro> or something
[04:38:07] <unpro> or case sensitivity
[04:38:17] <unpro> but i think everything is all lowercase =\
[04:39:09] <joannac> simplify it
[04:39:16] <joannac> reduce your code to a connect, and a find_one
[04:40:16] <joannac> and see if it still works
[05:12:33] <mehwork> when i try to create a sparse index, nothing seems to happen. Do you have to create the index manually first, then specify that it's sparse later?
[05:16:28] <joannac> mehwork: what are you expecting to happen?
[05:16:40] <joannac> mehwork: does it show up in db.coll.getIndexes() ?
[05:18:31] <mehwork> joannac: i want it to show up in getIndexes but it's not
[05:20:33] <joannac> oh. try creating it again?
[05:22:02] <mehwork> i tried, still not seeing it
[05:22:20] <joannac> pastebin what you're running, and the output of db.coll.getIndexes()
[05:22:41] <mehwork> "Some options that you can specify to ensureIndex() options control the properties of the index, which are not index creation options. For example, the unique option affects the behavior of the index after creation."
[05:23:16] <mehwork> doesn't that mean i can't create the index with {unique: true} at the same time i create the index?
[05:23:40] <joannac> no, you can do that
[05:24:28] <mehwork> ah you're right. It works if i do it from the mongo shell but not from pymongo
[05:24:39] <mehwork> i guess it's just a pymongo issue
[05:25:47] <joannac> mehwork: http://api.mongodb.org/python/current/api/pymongo/collection.html#pymongo.collection.Collection.ensure_index
[05:26:00] <joannac> both sparse and unique are documented
[05:27:18] <mehwork> right but i don't see it mentioning this issue where it doesn't work
[05:28:07] <joannac> mehwork: pastebin your code
[05:31:33] <mehwork> oh man i was doing it wrong
[08:15:49] <sachinaddy> how to group data in mongodb?
[08:17:24] <Soothsayer> I am creating a Collection which stores all URLs (for URL rewriting).. I was thinking of having the _id field in the Document schema as an md5 of the URL
[08:17:35] <Soothsayer> is this a sound implementation?
[08:35:20] <glontu> hi
[08:35:43] <glontu> is there q way to enforce order among subdocuments ? i would like them to stay sorted by 2 fileds
[08:56:23] <Soothsayer> glontu: no, there isn't
[08:56:33] <Soothsayer> glontu: unless you query it in your app, sort it and place it back.
[08:56:44] <Soothsayer> but then you can’t use commands to add to it
[08:56:59] <Soothsayer> glontu: why do you need sub-documents sorted?
[08:57:50] <glontu> Soothsayer, i need to recheck the collection of subdocuments when i add or remove one of them. When i add one, if the new document is "better" than all others i need to make the previous best as not best anymore
[08:58:23] <glontu> when i remove a subdoc, i need to decide again if the "best" had changed and redo the subdocs properties
[08:58:47] <glontu> so i want to sort them by the isBest property
[08:59:08] <Soothsayer> glontu: and you want to do addition and removal without a read?
[09:00:07] <glontu> Soothsayer, i am in symfony so i figure that if i manage the subdocs in the owning docs add... and remove... methods it will get flushed anyway right after that
[09:00:25] <Soothsayer> glontu: Doctrine ODM?
[09:00:31] <glontu> Soothsayer, yes
[09:01:32] <Soothsayer> glontu: you will not be able to achieve this if you do your adds / removes via the ODM
[09:01:34] <Soothsayer> here’s what I suggest you do
[09:01:57] <Soothsayer> to each of your sub-documents, add an ‘id’ field which is some kind of id/hash which needs to only be unique among the sub-documents of that document.
[09:02:33] <Soothsayer> next, when you query the Document.. you can loop through the sub-documents in symfony and check what’s the next best sub-document
[09:03:47] <Soothsayer> and then remove whatever you want to remove using the $pull command with the ‘id’ field of the sub-document
[09:03:55] <Soothsayer> for additions you don’t have to do anything special.
[09:04:09] <Soothsayer> lastly, i would suggest storing the ‘id’ to the isBest sub-document in the main Document somewhere
[09:04:16] <Soothsayer> as a separate field
[09:04:33] <glontu> Soothsayer, but i don't want to remove them. i just want to update the previos "best" as not best anymore and add the new one as best.
[09:04:47] <Soothsayer> glontu: then its simpler all the more.. manage it in a separate field
[09:04:55] <Soothsayer> not inside the sub-documents
[09:05:02] <glontu> ok so main doc holds ref to the embedded best doc
[09:05:05] <Soothsayer> create a bestSubdocumentId
[09:05:16] <Soothsayer> yes, to the new ‘id’ field you created, and NOT the position of it.
[09:05:51] <glontu> ok, thanks, i'll give it a try.
[09:05:51] <Soothsayer> glontu: hint, use Symfony2’s Symfony\Component\Security\Core\Util\SecureRandom
[09:06:29] <Soothsayer> glontu: this will come in handy http://pastie.org/9662516
[09:07:07] <glontu> thanks Soothsayer
[09:08:10] <glontu> one more thing. since i give them the id can the best document be mapped as an embedsone and reference the same subdocument from the collection ?
[09:09:20] <Soothsayer> glontu: there is no provision in MongoDB or Doctrine ODM to reference embedded sub-documents
[09:30:17] <af__> guys in oplog, the timestamp is saved as "ts" : Timestamp(1395663575, 1),.... I believe '1395663575' is in unix time.. but what is '1'... ? and also how do I access it in Pymongo?
[09:48:40] <_R_B_R> Hi
[09:53:39] <_R_B_R> Hi all, I started looking at mongodb yesterday and it seems really good. Only trouble is, I want to be able to retrieve a single record from a sorted table in a fraction of a second. This is a (possibly terrible) code I've written to do this: http://pastebin.com/Rh8JMbPi
[09:54:05] <_R_B_R> rrc = real row count
[09:54:52] <_R_B_R> I indexed the property and that did improve performance quite a bit
[09:55:06] <_R_B_R> Just wondering if there's anything else I can do to make it go quicker
[09:56:41] <_R_B_R> The reason I'm doing this is because I want the user to be able to hover their mouse over a horizontal bar representing the whole dataset and for a tooltip to display what the value is at that position.
[09:57:32] <_R_B_R> At the beginning of the dataset queries are fast, but once I get past a few hundred thousand I begin to get some lag
[10:08:11] <_R_B_R> brb
[12:57:34] <_R_B_R> is there a way of querying by index?
[12:59:17] <kali> _R_B_R: just create the index, the optimizer will do the rest
[12:59:34] <skot> Yes, query using an indexed field. You should not use skip to get to the nth item. Do you know anything about the document you are looking for, like its _id value?
[12:59:42] <skot> If so, query by that.
[13:00:38] <_R_B_R> basically I want to have the items sorted in order and then get item n
[13:00:57] <skot> You are trying to solve pagination by using skip/limit which will not perform well.
[13:01:00] <skot> http://stackoverflow.com/questions/9703319/mongodb-ranged-pagination
[13:01:04] <skot> http://docs.mongodb.org/manual/reference/method/cursor.skip/
[13:02:12] <_R_B_R> yea that skip function is too slow
[13:03:14] <_R_B_R> but I suppose the _id value doesn't just go 0, 1, 2 ... etc .. ?
[13:03:17] <skot> using skip requires "skipping" all the previous value which is going to cause way more work than you need, hence the suggestion to use range based pagination, by using a query instead of skip to get where you want to go
[13:04:10] <skot> Go research how to do pagination without using skip/limit. There are lots of solutions/suggestions and they are for more than just mongodb.
[13:04:25] <_R_B_R> okay
[13:05:43] <skot> here is another mongodb SO example: http://stackoverflow.com/questions/20960815/range-query-for-mongodb-pagination
[13:06:00] <skot> There are also docs somewhere on the mongodb site covering this.
[13:06:44] <_R_B_R> thnaks
[13:06:47] <_R_B_R> thanks*
[13:43:00] <mskalick> Hi,
[13:43:55] <mskalick> could I have a question? - are test in mongodb 2.6.x functional and maintained?... thanks
[13:48:46] <cheeser> as in, does the server have tests that are maintained and run as part of the build?
[13:58:27] <mskalick> I've built MongoDB from source files and run "python buildscripts/smoke.py --mongod `which mongod` --mongo `which mongo` --dont-start-mongod --port 27017 --mode suite all" from that directory
[13:58:42] <mskalick> and almost every test suite failed...
[13:58:59] <mskalick> what I am doing wrong?
[13:59:31] <cheeser> no idea. i just use the binary packages.
[14:01:56] <mskalick> and in binary packages, there are any tests?
[14:02:38] <cheeser> no
[14:02:56] <cheeser> i'm not developing the server so i have no need to run those tests
[14:07:17] <dump> mskalick: just use the binary packages. You don't need to run tests, unless you are MongoDB core developer
[14:09:28] <mskalick> dump: I am packaging MongoDB and I would like to have "%check" section in rpm...
[14:11:06] <cheeser> there are already RPMs for mongodb, i though.
[14:11:08] <cheeser> thought
[14:11:08] <cheeser> .1
[14:19:01] <dump> mskalick: Have you checked the RPMs packages at http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux
[14:20:05] <mskalick> thanks, but I am packaging it for Fedora, so I have to have a spec file
[14:20:47] <mskalick> and test aren't passing for me
[14:32:50] <dimon222-cloud> i may be missleading, but why " --dont-start-mongod" ?
[14:34:41] <cheeser> mskalick: you should post to the dev list then
[14:44:40] <mskalick> cheeser: OK, thank you
[14:46:03] <mskalick> dimon222-cloud: because I have already running one mongod instance (but I've tried it also without it...)
[14:58:55] <dggb> I have a real time service that logs 40 items from a remote sensor node every minute. Could anyone give me some suggestions on document design>
[15:05:04] <kali> dggb: http://blog.mongodb.org/post/65517193370/schema-design-for-time-series-data-in-mongodb
[15:05:35] <dggb> kali: Thank you! I actually found that right after asking. How would I scale that document from 1 value per minute to 50
[15:05:41] <dggb> or N I guess
[15:07:02] <kali> dggb: i would personaly use a specialized database actually.
[15:07:14] <dggb> could you elaborate?
[15:07:39] <kali> document database are not a good fit for time series, imho
[15:07:44] <kali> there are better options
[15:08:00] <dggb> right, could you give me some ideas of other options?
[15:08:09] <kali> so if most of your data and features is centered around time series...
[15:08:21] <kali> graphite is a popular alternative
[15:08:52] <kali> influxdb is getting some traction, as far as i can tell
[15:09:43] <kali> column oriented database like cassandra may also offer more efficient options
[15:09:56] <kali> even sql is better than document for time series, anyway
[15:10:58] <dggb> I have been reading that big real time data companies use mongo
[15:12:27] <algernon> mongo is terrible for TS data
[17:05:15] <globaly> hello dears,
[17:06:01] <globaly> hello dears, how is it possible to return the number of distinct values in the command db.collection1.runCommand( { distinct: 'collection1', key: 'title'});
[17:10:52] <cheeser> db.collection1.distinct('title').length
[17:13:10] <globaly> cheeser: thanks!!
[17:13:16] <cheeser> np
[17:27:37] <dimon222-cloud> is it possible to select just single parameter? not select whole document and then take parameter from it
[17:28:54] <dimon222-cloud> so find({"$and":[{"stype":stype}, {"snum":snum}]} and only receive something like sdetails back
[17:29:42] <daidoji> dimon222-cloud: what do you mean?
[17:30:20] <dimon222-cloud> find by default retrieves documents that match pattern
[17:30:36] <dimon222-cloud> i want just get values without retrieving complete documents (dem, they're huge)
[17:31:06] <cheeser> dimon222-cloud: http://docs.mongodb.org/manual/reference/method/db.collection.find/
[17:31:10] <cheeser> look at the projection bits
[17:31:28] <dimon222-cloud> right, thanks
[17:31:42] <dimon222-cloud> completely forgot about optional stuff
[17:58:08] <doug1> Hmmm.
[17:59:00] <doug1> Anyone awake?
[17:59:43] <doug1> Anyone here using the Edelight chef mongo cookbook?
[18:01:03] <ceejh> A little, what's up?
[18:01:58] <doug1> ceejh: Oh? Ever get "Database command 'listDatabases' failed: not authorized on admin to execute command { listDatabases: 1 }" ?
[18:02:19] <doug1> I don't know why I'm getting that. It's on a node before the router configures the admin user
[18:05:16] <doug1> sigh
[18:05:55] <ceejh> I PM'd you
[18:06:16] <doug1> ceejh: Oh weird. I didn't get a PM
[18:06:36] <ceejh> O_o
[18:07:05] <doug1> Looking at cookbook code, I see it's trying to connect as the admin user. If I do a 'mongo -u admin' without a password at the prompt, it fails.. says it requires a password, but none has been set up yet so I assume the cookbook would fail for the same reason
[18:07:14] <doug1> ceejh: just me. :)
[18:07:27] <ceejh> Darn... would rather do this in a PM
[18:07:38] <doug1> ceejh: sensitive info?
[18:07:52] <ceejh> No... just don't want to pollute this channel with cookbook stuff
[18:08:07] <doug1> oic. I'm kinda desperate. :)
[18:08:24] <ceejh> I just need an idea of your setup. Mongod, mongos, config sirs, or just a standalone node?
[18:08:37] <ceejh> *servers... auto correct is killing me today
[18:09:05] <doug1> ceejh: full on setup. I've brought up 3 config servers, and this error happens on one of the data nodes. There's three of them. Haven't created the router yet
[18:09:31] <doug1> ceejh: Will eventually be 3 config servers, 2 shards of 3 nodes each and some number of routers
[18:09:57] <ceejh> so the config servers come up fine, then you start bringing up the mongod servers and it fails
[18:10:00] <doug1> The router, which creates the password for the admin user hasn't been created yet, it gets done last
[18:10:05] <ceejh> right
[18:10:08] <doug1> ceejh: Yah.
[18:10:11] <ceejh> that is indeed the correct order
[18:10:18] <doug1> That's what I thought
[18:10:27] <ceejh> Are you using the master branch of the cookbook?
[18:10:54] <ceejh> And I assume you're using the user management recipe on purpose because you want to initialize the admin
[18:11:01] <doug1> ceejh: from a month or two ago yes, but I had to fork it locally and make changes because there's bugs in the replica set naming. grrr
[18:11:24] <doug1> user management... actually no.
[18:11:54] <ceejh> Hmm, so you're setting node[mongodb][config][auth] true on your own?
[18:11:57] <doug1> ceejh: for now... we have to put the router on a rightscale box (legacy) so there was scripts to create the admin user etc
[18:12:12] <doug1> ceejh: actually I didn't modify that attribute...
[18:12:36] <ceejh> O_o your mongo instance must be running with auth=true to say it requires authentication
[18:12:41] <ceejh> or... unless you have a key file I guess
[18:12:47] <ceejh> Which would make sense in a cluster
[18:12:53] <doug1> ceejh: it's not in the wrapper cookbook...
[18:13:22] <doug1> and it's nowhere in the mongo cookbook's attributes . just checked
[18:13:34] <ceejh> Are you setting a key file though?
[18:13:43] <ceejh> That automatically set auth=true
[18:13:46] <doug1> ceejh: yep, in the wrapper
[18:14:07] <doug1> ok... so...
[18:14:12] <ceejh> (Double checking that, lol)
[18:14:13] <doug1> but...
[18:14:15] <ceejh> I think I read that somewhere
[18:14:41] <doug1> i'm confused tho... if I set the key file and the cookbook auto sets auth, what happens initially when the nodes are being created, before the admin user password has been set?
[18:15:16] <ceejh> Just to answer that generally, you won't be able to do any command except db.createUser
[18:15:22] <ceejh> Because of the localhost exception
[18:15:38] <ceejh> http://docs.mongodb.org/manual/core/authentication/#localhost-exception
[18:15:40] <doug1> ceejh: no listdatabases? That's obviouslty what's being called by the cookbook (although a grep doesn't find it )
[18:16:03] <doug1> ceejh: i know... but the admin user hasn't been created yet, has it?
[18:16:32] <ceejh> You tell me, it's in your post-install scripts ;)
[18:16:45] <ceejh> But, I guess not, user management for the cookbook was added recently
[18:16:51] <doug1> ceejh: they haven't been executed yet
[18:17:08] <doug1> since they add the user to the router, and that's brought up last
[18:17:19] <ceejh> Or... recentish, as of July I guess
[18:17:29] <doug1> i think I pulled after that
[18:17:33] <doug1> so confused. :(
[18:18:27] <ceejh> So... I confused you more than I helped. Well my job is done here
[18:18:54] <doug1> The docs have "node['mongodb']['admin']" The admin user with userAdmin privileges that allows user management .... but nothing about how to assign privs to it
[18:19:12] <doug1> i don't think it's you. mongo auth is confusing in general
[18:19:20] <ceejh> It sounds like you don't have that recipe, right, and trying to change things over to it might be more trouble than it's worth
[18:19:37] <doug1> ceejh: i've been working on this for 4 months now. :(
[18:19:39] <ceejh> (Because if you pull straight from berkshelf, you get the last tagged version, you'd have to pull straight from git to get latest)
[18:20:19] <doug1> I just did a git pull a month or two ago. i had to fork because it straight up doesn't work with the way the replicaset names are done
[18:20:35] <ceejh> That surprises me... :/
[18:20:45] <ceejh> Do you use chef-solo or chef-server?
[18:20:50] <doug1> ceejh: it has a hard coded "rs_" in there
[18:20:53] <doug1> chef-server
[18:21:16] <ceejh> That... is true
[18:21:31] <ceejh> well
[18:21:39] <doug1> very careful to remove old nodes from chef before each deploy, otherwise the chef search gets all outta wack
[18:21:44] <ceejh> actually it doesn't look true anymore
[18:21:51] <doug1> :-O
[18:21:54] <doug1> since?
[18:21:59] <ceejh> https://github.com/edelight/chef-mongodb/blob/master/definitions/mongodb.rb#L104
[18:23:09] <ceejh> I could be wrong, checking where that comes from
[18:23:24] <doug1> I can't remember what I changed. :(
[18:23:41] <ceejh> that comes from node['mongodb']['config']['replSet']
[18:23:51] <ceejh> So you should be able to set the full name in attributes
[18:24:01] <doug1> ceejh: yes but there was def a "rs_" in the code
[18:24:15] <ceejh> There is if that isn't set, the elsif below
[18:24:21] <ceejh> Can't find any other instances atm...
[18:24:22] <doug1> hm
[18:25:00] <doug1> ceejh: last change to that file was 4 months ago. That's def earlier than my last pull where it still had it. wish I could remember what I changed
[18:25:20] <ceejh> Is it checked into git?
[18:25:25] <ceejh> or even git status CLI would tell you
[18:25:28] <doug1> mine or theirs?
[18:25:30] <ceejh> Yours
[18:25:50] <doug1> yes but I probablt changed then commited
[18:26:09] <ceejh> Not in github?
[18:26:18] <doug1> ceejh: local git
[18:26:30] <doug1> but as I said, i probably downloaded, changed then commited
[18:26:35] <doug1> so no record of original
[18:26:43] <ceejh> that's too bad
[18:27:01] <doug1> i still dunno how the admin is supposed to work. that makes no sense
[18:27:01] <ceejh> anyways, here's a vagrant example of 3 cfg svr, 3 mongod, 1 mongos using chef-solo
[18:27:02] <ceejh> https://github.com/ceejh/mongodb-cluster/tree/user-mangement
[18:27:05] <ceejh> Not sure if it helps
[18:27:13] <ceejh> Hey! It makes total sense
[18:27:13] <ceejh> lol
[18:27:25] <ceejh> https://github.com/edelight/chef-mongodb/blob/master/attributes/users.rb#L4
[18:27:26] <ceejh> the roles
[18:27:35] <ceejh> Just... poorly documented I guess
[18:27:52] <doug1> very
[18:28:07] <doug1> where does users.rb get applied? on a date node or on the router?
[18:28:55] <ceejh> It's kind of hard to give you a tutorial of the user management recipe... atm it doesn't work for replica / sharded instances
[18:29:01] <ceejh> https://github.com/edelight/chef-mongodb/pull/344
[18:29:05] <ceejh> hopefully soon it will
[18:29:12] <doug1> well that's what I got... :(
[18:29:20] <doug1> thanks tho
[18:29:48] <doug1> there's no mention of a password attribute for the user in the docs. grrrrr
[18:30:03] <ceejh> I don't know what docs you're reading...
[18:30:13] <ceejh> "Before using on a new database, ensure you're overwriting the node['mongodb']['admin']['username'] and node['mongodb']['admin']['password'] to something besides their default values."
[18:31:17] <doug1> ok i see it
[18:31:26] <doug1> maybe I should configure that and it might solve the admin issue
[18:32:06] <ceejh> Haha, well it won't on master, but like I said, my branch works for me in chef-solo
[18:32:16] <ceejh> https://github.com/ceejh/chef-mongodb/tree/users-in-replicasets
[18:32:19] <ceejh> I'm working on getting it merged
[18:32:47] <doug1> it doesn't in master? omg. really? but the docs say it does
[18:33:17] <ceejh> It's a long story. On master it works fine on 1 mongo server
[18:33:31] <doug1> this is very stressful
[18:33:32] <ceejh> I wasn't able to get a cluster of mongo working at the time, so getting it working with multiple nodes came later
[18:34:21] <doug1> people expect me to get this to work, so I go to the cookbook and there's nothing there about all the issues. I start playing with it, it works, confidence builds and then for some reason it stops working.
[18:34:57] <doug1> which then makes me look like an idiot because people assume i either never had it working, or... i dunno, i'm just an idiot or something
[18:36:01] <doug1> the frustrating part is that I did have it working at one point
[18:36:54] <doug1> gonna grab some lunch and cry.
[18:37:21] <ceejh> My advice, doug1
[18:37:29] <ceejh> check out https://mms.mongodb.com/
[18:37:31] <ceejh> Watch the video
[18:37:40] <ceejh> It does all of this for you... I haven't tried it out yet
[18:37:43] <cheeser> highly recommended. :)
[18:37:43] <ceejh> But it might solve some headaches
[18:41:31] <arussel> I've got a collections with : {a: Date(), b: Int} is there a way to find all the document where a + b days > now ?
[18:42:14] <hannya> Whats the difference between: { type: ObjectId, ref: 'Comment' } and commentSchema?
[18:42:46] <hannya> in say a postSchema = ... { comment: <here> }
[18:43:14] <hannya> I assume there isn't a difference?
[18:47:39] <hannya> oh right I shoul dask the mongoose channel,, my bad
[18:50:00] <SamuraiDio_> Hello
[18:50:37] <SamuraiDio_> Is there a mongoose channel?
[18:53:17] <doug1> ceejh: sure. there's issues with that though still.
[19:25:55] <huleo> hi
[19:26:30] <huleo> I'm wondering if querying by $text is possible using regex
[19:31:10] <Forest> Hello,i am getting issue Can't insert document: WSARecv tcp 127.0.0.1:28406: An existing connection was forcibly closed by th e remote host. What can be the problem?
[19:38:28] <while1eq1_> how can I tell how far along a slave is during the "inital sync"
[19:39:05] <Forest> nobody knows what might me the issue? why Mongo disconnects me?
[20:06:55] <Neal_> I have two collections: User and Subscription. I want each Subscription to "link" to a User somehow. I am very new to mongo and just want the best way of doing this.
[20:09:08] <Neal_> In the Subscription schema, can I have something like "user: { type: ObjectID }" and whenever I create a Subscription, I make that ObjectID a users' _id?
[20:12:16] <eucalyptus> anyone using the mongo-hadoop-connector?
[20:22:38] <cheeser> eucalyptus: you're more likely to get answers with actual questions...
[20:22:52] <eucalyptus> :)
[20:23:31] <eucalyptus> well, im interested in configuring the underlying java/scala driver. i dont see a way to do that via the Hadoop configuration
[20:24:01] <cheeser> you can append configuration parameters to the mongo uri you pass in
[20:24:08] <cheeser> look at MongoClientURI
[20:24:39] <eucalyptus> thanks
[21:24:22] <doug1> Anyone here using MMS? Playing with GUI. It makes no sense at all'
[22:02:35] <DrakeL> Hi everyone! I've been using MongoDB for a while and it's great. The only problem I seem to have is... I have no clue how authentication works.
[22:03:06] <DrakeL> I'm trying to have an admin (superuser) access for myself to all databases, and one user to access one database read/write.
[22:04:19] <Boomtime> http://docs.mongodb.org/manual/administration/security-user-role-management/
[22:05:59] <DrakeL> Boomtime: I tried that guide but the db.createUser for siteUserAdmin is not following some new schema for something?
[22:07:57] <Boomtime> what have you tried?
[22:08:42] <DrakeL> Use Robomongo when server is in no auth mode and create a user. I can't auth with the details I make it with.
[22:09:45] <Boomtime> nowhere in any of the guides is robomongo mentioned, please follow the guide, you'll have better luck
[22:10:54] <DrakeL> I have, but when I reached the part of the guide that didn't work (not updated to latest schema), then I tried alternatives.
[22:13:05] <DrakeL> I tried it again
[22:13:07] <DrakeL> and err
[22:13:08] <DrakeL> it works
[22:13:10] <doug1> DrakeL: Ditto. Docs aren't very good
[22:13:25] <DrakeL> I don't know how that happened
[22:13:33] <doug1> i get a lot of that too. :)
[22:14:33] <Boomtime> yeah, it sucks when you follow the docs and it works, leaves you having to blame the docs for being correct
[22:15:03] <DrakeL> Fair enough. Apologies.
[22:15:19] <Boomtime> :D
[22:15:37] <doug1> right now I'd like some docs on MMS.
[22:15:56] <Boomtime> that's probably a fair cop, I understand those are not very complete
[22:16:43] <doug1> I've been looking at how to create a cluster for an hour and I can't find it. when you can't create a cluster via a GUI, I'd call that a fail
[22:17:24] <Boomtime> trying with automation then i take it
[22:17:45] <doug1> Boomtime: ? I was trying with chef and that's been an unpleasant experience
[22:18:15] <Boomtime> what has Chef got to do with MMS?
[22:18:29] <Boomtime> it sounds like your problem is with chef
[22:18:36] <doug1> Boomtime: Nothing. I was trying to deploy the cluster with chef. MMS is an act of desperation.
[22:18:58] <DrakeL> This is really quite frusturating
[22:19:03] <doug1> ^
[22:20:06] <Boomtime> if you guys would actually describe the problem you might get some help, but right now you're just whining
[22:20:23] <doug1> Boomtime: How do I create a cluster in MMS GUI?
[22:20:29] <doug1> ^ That's my question
[22:20:43] <doug1> Boomtime: Or, where are the docs that tell me how to create a cluster in the MMS GUI?
[22:21:41] <DrakeL> Sorry. Err. I'm able to create a superuser account with unrestricted access, but I cannot log into the account with the mongo command or in a visual thing like Robomongo.
[22:21:58] <doug1> DrakeL: Did you set a password?
[22:22:25] <DrakeL> I think so? I defined it in the whole db.createUser thing
[22:22:48] <doug1> DrakeL: not a network connectivity issue?
[22:22:54] <DrakeL> local connection.
[22:22:58] <DrakeL> I have to turn off auth to get in
[22:23:26] <doug1> DrakeL: you gotta pass the db name on the cli too
[22:23:34] <doug1> which is pretty cryptic
[22:23:42] <DrakeL> I know. I'm passing the db admin
[22:23:50] <DrakeL> which is probably what I'm supposed to do?
[22:23:58] <doug1> i think so...
[22:25:16] <DrakeL> I was running a semi-production mongodb instance with noauth and connections allowed from anywhere. I figured that I should probably get some authentication.
[22:27:36] <DrakeL> I'm just bloody confused
[22:28:44] <doug1> Boomtime: Any idea on a solution to my quantified problem description that doesn't qualify as whining?
[22:29:03] <Boomtime> I've already said I don't know about the MMS docs, sorry
[22:29:34] <Boomtime> DrakeL: can you paste the user doc you have in system.users?
[22:29:45] <Boomtime> (start without auth)
[22:30:08] <DrakeL> Sure
[22:30:10] <DrakeL> One moment
[22:30:41] <Boomtime> you can use pastebin or gist
[22:31:11] <DrakeL> System.admin.users?
[22:31:24] <Boomtime> use admin; system.users.find()
[22:32:14] <DrakeL> Uhhh
[22:32:36] <DrakeL> It appears that system is not defined Boomtime
[22:33:25] <Boomtime> how you trying to get the document?
[22:33:41] <Boomtime> you should be using the mongo shell
[22:33:48] <DrakeL> In my console, typing mongo to enter mongo shell
[22:34:00] <DrakeL> Then "use admin;"
[22:34:12] <DrakeL> then "system.users.find()'"
[22:34:20] <DrakeL> oop
[22:34:21] <Boomtime> db.system.users.find()
[22:34:22] <DrakeL> "use admin; system.users.find()"
[22:34:24] <Boomtime> sorry
[22:34:37] <DrakeL> No worries
[22:34:39] <DrakeL> Here we go
[22:35:07] <DrakeL> https://gist.github.com/ihatecsv/5a85c01ce2f3f663620e
[22:36:54] <Boomtime> "db" : "test"
[22:37:01] <Boomtime> you are auth'ing aginst test then?
[22:37:08] <DrakeL> Oh my
[22:37:10] <DrakeL> You're right
[22:37:22] <DrakeL> So I should "use admin;" before I make the user?
[22:37:35] <Boomtime> to auth against admin, yes
[22:37:57] <Boomtime> also, this user is a user-admin which will let you create any type of user, but little else
[22:38:00] <DrakeL> Let me try this again
[22:38:08] <DrakeL> Can I delete that user?
[22:38:50] <DrakeL> And which role is the whole superuser deal
[22:39:06] <Boomtime> you probably mean root
[22:39:09] <DrakeL> I'd like 'root' for my MongoDB instance :P
[22:39:12] <DrakeL> Ah
[22:39:26] <Boomtime> http://docs.mongodb.org/manual/reference/built-in-roles/#root
[22:39:46] <DrakeL> So, role: "root"
[22:39:48] <DrakeL> Correct?
[22:40:42] <Boomtime> yes
[22:41:43] <DrakeL> To remove the previous one
[22:42:06] <DrakeL> I tried db.dropUser, and it returned false. I assume it failed?
[22:45:12] <Boomtime> while auth is off, helpers like db.dropUser might not work properly, you can just delete the document from system.users though
[22:45:44] <doug1> Can I create a user on a config server before starting data nodes?
[22:47:16] <DrakeL> Okay I'm making progress
[22:48:33] <DrakeL> I can connect and auth and such
[22:52:56] <DrakeL> Boomtime: How do I use find to find the users in a specific database?
[22:54:07] <Boomtime> when auth is enabled you should use the helpers: http://docs.mongodb.org/manual/reference/method/js-user-management/
[22:54:34] <DrakeL> Perfect
[22:54:55] <DrakeL> I know it's not really relevant
[22:54:55] <DrakeL> But
[22:55:05] <DrakeL> Robomongo is not really working with the root login
[22:55:14] <DrakeL> It's listing everything, but the users
[22:55:39] <DrakeL> Collections and functions, no users
[22:56:17] <Boomtime> that sounds like robomongo trying to do something tricky, sorry not sure what is going on
[22:57:27] <DrakeL> No worries
[22:57:31] <doug1> Can I create a user on a config server before starting data nodes?
[22:57:36] <DrakeL> Thanks for all the help Boomtime
[22:57:41] <DrakeL> One gold star for you!
[22:58:58] <Boomtime> doug1: you can start a mongos before starting any data nodes
[22:59:04] <Boomtime> can you add users that way?
[22:59:18] <Boomtime> (i haven't tried that for a while)
[22:59:40] <doug1> Boomtime: i thought you'd normally add the mongos last?
[22:59:59] <Boomtime> how would you add data nodes (shards) without a mongos?
[23:00:59] <doug1> Boomtime: you add the shards via the mongos once it's up
[23:01:31] <Boomtime> think about that a bit
[23:01:48] <doug1> Boomtime. That's been working ok so far
[23:02:03] <Boomtime> obviously, that's the correct way to do it
[23:02:20] <doug1> it is? i thought you where saying it wasn't?
[23:02:21] <Boomtime> but it means you had a mongos connected to the config servers first
[23:02:37] <doug1> is there a doc on this? :)
[23:02:42] <Boomtime> then via the working mongos, you added shards
[23:02:49] <doug1> right...
[23:03:20] <Boomtime> a shard isn't a shard until you do sh.addShard - before that it's just a regular standalone instance
[23:03:38] <doug1> this is so frustrating, the chef cookbook tries to authenticate as the admin user but fails. This was working previoudly.
[23:03:42] <doug1> ^ yes I know
[23:05:17] <doug1> this cookbook however is still trying to create the replicaset. that's where I'm failing
[23:06:30] <Boomtime> I have no idea what you are talking about, it sounds like a chef problem
[23:07:38] <doug1> Boomtime: Mostly. it's also partly due to to mongo docs.
[23:08:02] <Boomtime> *sigh*
[23:12:42] <doug1> eg: if the docs said the correct order to start instances in a cluster, and what instance to run the useradd command on, it would help in debugging the cookbook
[23:16:14] <Boomtime> doug1: this document tells you quite explicitly trhe order of servers: docs.mongodb.org/manual/tutorial/deploy-shard-cluster
[23:16:37] <Boomtime> this document tells you quite explicitly how to enable auth in a sharded cluster: http://docs.mongodb.org/manual/tutorial/enable-authentication-in-sharded-cluster/
[23:17:53] <DrakeL> Boomtime: I tried adding a user with this form: https://gist.github.com/ihatecsv/18908ec6fa0307fb9809 and it executes fine but when I'm in the Laxatus database and do db.system.users.find() it returns nothing
[23:21:36] <Boomtime> DrakeL: have you tried db.getUsers() ?
[23:21:56] <DrakeL> Okay that works
[23:22:02] <Boomtime> you should be using the helpers when auth is enabled, but (fyi) all users are stored in admin
[23:22:26] <DrakeL> But I'm trying to connect to the database in PHP to query it and it's saying I don't have permission to query
[23:22:54] <Boomtime> the auth works?
[23:23:11] <DrakeL> Yeah
[23:23:27] <DrakeL> I'm just getting "localhost:27017: not authorized for query on laxatus.users"
[23:24:08] <Boomtime> can you try that in the mongo shell?
[23:24:39] <DrakeL> One moment
[23:25:36] <DrakeL> Yeah it's perfect-o in shell
[23:25:54] <Boomtime> special.. what is the PHP code then? gist again
[23:26:38] <DrakeL> https://gist.github.com/ihatecsv/e45e0cf8c759bf27b09a
[23:27:00] <DrakeL> No syntax errors
[23:28:37] <doug1> Boomtime: so, it seems the order is in fact cfg, mongos then replicasets. That means I have to configure the mongos twice. Darn, ok
[23:28:57] <Boomtime> does "users" collection exist already in "laxatus"?
[23:29:29] <DrakeL> Yes. I'm basically retrofitting my code to use authentication at this point
[23:30:30] <Boomtime> not sure what is going on there, i would play around with roles and see what it takes to get php driver to be happy
[23:30:42] <Boomtime> my suspicion is that it is doing something you don't expect
[23:31:04] <Boomtime> for example, it might actually be asking for the list of collections on the database - not sure if that is covered by readWrite
[23:31:14] <DrakeL> Alrighty. Thanks!
[23:31:24] <DrakeL> Actually
[23:31:25] <DrakeL> You're right
[23:31:51] <DrakeL> I thinl
[23:31:52] <DrakeL> I think
[23:32:08] <DrakeL> Let me try my root account