[03:22:12] <comfytoday> trying to add user to admin, with root role. Error: coudln’t add user: not master… first time using 3.2.7, can’t find anything in docs…
[03:22:31] <comfytoday> i’m using db.createUser({user:"admin",pwd:"<password>",roles:["root"]});
[03:28:24] <_Cory_> Is there any examples on 3.* usage of the com.mongodb.ReflectionDBObject? I keep getting ClassCastExceptions, the BSON string appears valid however.
[03:37:31] <cheeser> why are you using that class directly?
[03:44:08] <_Cory_> Codec's are soo long, why use them when you can use reflection, I was tempted to use Gson or the JSON class, but I wanted it to deseralize with the collection
[03:44:24] <_Cory_> I can't find anything in the docs on how to use it though
[08:31:38] <obiwahn> i have installed it in /usr/local
[08:32:25] <obiwahn> i call cmake with "-DCMAKE_PREFIX_PATH=/usr/local" but the driver will not build
[08:44:46] <obiwahn> The bson repo does not contain LibBSONConfig.cmake or libbson-config.cmake and it does not seem to be generated
[08:49:47] <obiwahn> https://docs.mongodb.com/ecosystem/drivers/downloads/ -- why does the c++11 release link take me to a legacy download page?
[09:16:10] <livingBEEF> Is there a way to check if a reference is valid (the referenced document exists)?
[12:51:33] <SeiGGy> Has anyone gotten MongoDB to run in a docker container with the /data/db volume attached to an NFS share? I'm having issues where it gives a "Permission Denied" error trying to write the mongod.lock file, but all my other containers are able to write to similar shares just fine.
[12:51:57] <SeiGGy> and when I start the container attached to a normal folder on the file system, it works just fine
[12:52:05] <SeiGGy> it's only when I attach the volume to a NFS share that I get the error
[13:01:10] <SeiGGy> hrm...seems mongodb doesn't like running on NFS shares...anyone know if SMB or another sharing protocol would work?
[15:45:41] <SeiGGy> is it possible to run mongodb in docker with any shared storage solution? NFS/CIFS/SMB/ etc? I can't seem to get it to work
[15:48:04] <AndrewYoung> Docker can share a folder with the host system. You can use that functioanlity to place your data directory somewhere "outside" the docker instance.
[15:49:09] <AndrewYoung> I'm not sure that running Mongo with its data directory located on networked storage would be a very good idea, to be honest. It seems like that would introduce latency and contention issues.
[15:49:49] <AndrewYoung> But if your goal is just to store the mongo data in a folder that can be mounted by the container so that loss of the container doesn't mean loss of your data, then you can use the mapped folder featuer of docker to do that.
[16:33:25] <SeiGGy> so I've got a cluster of 3 nodes, and if something happens and one node goes down, I don't want to loose the data, and I don't want to have to manually replicate the database across hosts
[16:34:07] <SeiGGy> is there a better way to handle it if I need to do something like this? since i can't get NFS or CIFS working
[16:34:08] <AndrewYoung> If you're having problems getting NFS, etc. working in the client instances, try mounting the data directory from a mount point on the host and then mount that mount point on the host via NFS, etc.
[16:34:20] <SeiGGy> yeah, that's what I was already doing
[16:34:48] <AndrewYoung> What sort of errors are you seeing?
[16:35:04] <SeiGGy> exception in initAndListen: 98 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
[16:35:49] <SeiGGy> and I've verified that it's only mongodb that has this issue. I have other containers that are writing to other NFS / CIFS fileshares, and they don't have any issues
[16:36:31] <AndrewYoung> Can you touch a file in that folder as the user that docker is running as on the host system?
[18:18:45] <FuzzySockets> I'm running a mongo replica set on a small ec2 cluster (1 primary, 1 secondary, and 1 arbiter). The primary and secondary each have their dbPath configured to an EBS device formatted as XFS. What is the standard practice for taking backups while the replica set is up and running? Can I just snapshot the block storage?
[18:19:39] <SeiGGy> aha! I got it to work AndrewYoung!
[18:20:06] <SeiGGy> I had to install the netshare plugin for docker, and then mount the share into the container using it, instead of mounting the share to the filesystem first
[18:21:14] <AndrewYoung> SeiGGy: Cool. :) Make sure to read this stuff if you haven't already. https://docs.mongodb.com/manual/administration/production-notes/#remote-filesystems
[18:22:00] <AndrewYoung> (Mainly the mount options)
[18:22:42] <AndrewYoung> FuzzySockets: Check out https://docs.mongodb.com/ecosystem/tutorial/backup-and-restore-mongodb-on-amazon-ec2/
[18:29:12] <FuzzySockets> AndrewYoung: Thanks, that was quite in depth :P
[18:59:22] <FuzzySockets> AndrewYoung: Is it typically better practice to backup the secondaries storage device?
[19:01:21] <tonlika> can mongodb save closure functions in a document?
[19:13:07] <AndrewYoung> FuzzySockets: Sounds like it is common practice to take a secondary out of rotation and then backup the secondary.
[19:13:27] <AndrewYoung> You just have to be aware of whether or not the secondary is behind the primary and by how much.
[19:13:39] <AndrewYoung> That way you don't affect the primary during the backup.
[19:14:12] <AndrewYoung> tonlika: If you're curious, the BSON spec is located here: http://bsonspec.org/spec.html
[19:14:34] <AndrewYoung> It looks like code does in fact contain scope according to that document, so I might be wrong.
[19:14:36] <FuzzySockets> AndrewYoung: Why would it affect the primary?
[19:14:53] <FuzzySockets> (not saying it wouldn't... just trying to understand)
[19:15:04] <AndrewYoung> FuzzySockets: I mean that you can perform the backup without needing to touch the primary at all.
[19:16:07] <AndrewYoung> Not that it would affect the primary while you were running the backup, just that this removes all possibility of it. :)
[19:16:30] <FuzzySockets> AndrewYoung: I see... is it necessary to take the secondary out of rotation? I combed through the article you sent me earlier, but now I'm going through it step by step and writing stuff down.
[19:17:48] <AndrewYoung> I think it's safer to do so.
[19:18:02] <AndrewYoung> Check out https://docs.mongodb.com/manual/tutorial/backup-sharded-cluster-with-filesystem-snapshots/
[19:18:52] <AndrewYoung> It talks about locking the secondary so that it stops processing oplog updates during the backup, and then unlocking it again once the backup is complete. That way there's no chance that the database contents are changing underneath you while you're backing up.
[19:19:22] <AndrewYoung> I don't think it's strictly necessary, but it decreases possible problems, and I'm all for removing as many possible issues as one can. :)
[19:19:32] <FuzzySockets> That looks like it's only if your journal and data files aren't on the same LV
[19:19:38] <FuzzySockets> "If the journal and data files are on the same logical volume, you can use a single point-in-time snapshot to capture a consistent copy of the data files."
[19:20:14] <AndrewYoung> Yeah, if you can take a point-in-time snapshot of the LV and both are there it's probably fine without.
[19:20:29] <FuzzySockets> I'll be giving this a test run anywho :)
[19:20:47] <AndrewYoung> I'm just especially paranoid. ;)
[19:21:30] <AndrewYoung> tonlika: From the spec: "Code w/ scope - The int32 is the length in bytes of the entire code_w_s value. The string is JavaScript code. The document is a mapping from identifiers to values, representing the scope in which the string should be evaluated."
[19:22:05] <AndrewYoung> However, server side javascript has performance implications because there is a global lock involved.
[19:22:15] <AndrewYoung> So it should be used sparingly.
[20:17:30] <_Cory_> Anyone got some example webapps using mongo on Github or something, just want to see how I should go about things.
[20:18:22] <AndrewYoung> What programming language are you looking for?
[20:18:34] <_Cory_> Java, sorry should have added that.
[20:28:45] <StephenLynx> so he might be able to give you something
[20:32:12] <AndrewYoung> Are you using an ORM framework? JPA, Spring-Data, Hibernate? (It's been a couple years since I worked in Java full-time, so I might be out of the loop with my technologies.) :)
[20:32:52] <AndrewYoung> Also, I found this: https://github.com/rackerlabs/atom-hopper
[20:33:13] <AndrewYoung> But it's using MongoDB through an adapter.
[20:41:58] <_Cory_> Yeah I was speaking with him this morning, I'm in no rush just learning the mongo ways :P
[20:48:07] <AndrewYoung> SeiGGy: You still around?
[20:49:05] <AndrewYoung> If you feel so inclined, I bet the support folks would benefit from a bug report about the NFS problems you were having and your solution to them over at https://jira.mongodb.org/.
[20:49:34] <_Cory_> Ahh thanks AndrewYoung nothing's set in stone, it'll be Hibernate along with Wicket
[20:49:50] <sumobob> so there is a $push element in mongodb, is there also a $slice or $splice? how can i reverse a $push