PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 13th of August, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[14:41:51] <hsk3> When I run "mongo" on my Linux (with "mongod" running in the background of course) and create a database, add collections, documents, etc.
[14:42:07] <hsk3> Can any other user on that Linux system also access that database I created by just running "mongo"?
[14:42:13] <hsk3> Or is what I create tied to my Linux user?
[14:45:50] <teprrr> you can enable remote access somewhere I think, per default it isn't listening remote connections (I hope)
[14:46:17] <hsk3> teprrr: i mean different local users. not remote connections
[14:46:19] <teprrr> then you do just mongo 123.123.123.123
[14:46:36] <teprrr> oh. I thought there's no differentiation between users on that level
[14:47:21] <hsk3> so if i create an ssh account on my server for my coworker, he automatically gets access to my mongodb databases?
[14:47:27] <hsk3> strange..
[14:51:11] <teprrr> per default so, I think
[15:02:50] <StephenLynx> hsk3, that is controlled by file permissions.
[15:03:12] <StephenLynx> so for the sake of convenience, mongo implements database users.
[15:03:28] <StephenLynx> so you can specify which db users can do what.
[15:03:53] <hsk3> StephenLynx: to do this i gotta start mongod with --auth, right?
[15:04:24] <StephenLynx> I think so.
[15:04:28] <StephenLynx> however
[15:04:43] <StephenLynx> I recommend setting that on the settings and running mongo though its service.
[15:07:17] <hsk3> StephenLynx: which settings, and which service?
[15:09:05] <StephenLynx> how did you install mongo?
[15:09:42] <Zelest> mawngoo deebee!
[15:09:46] <hsk3> StephenLynx: Manually. I run mongod in the background (a separate mongodb user). Then mongo can be run by any user.
[15:09:53] <hsk3> I downloaded the tarball for Debian 8
[15:10:05] <hsk3> (since there aren't debian 8 packages yet)
[15:10:39] <StephenLynx> which init system debian 8 uses?
[15:10:48] <hsk3> systemd
[15:10:58] <hsk3> i was able to set that up too
[15:11:17] <hsk3> so mongod runs on system startup
[15:11:24] <StephenLynx> then run systemctl status mongodb
[15:11:31] <StephenLynx> or mongo, can`t remember.
[15:12:11] <hsk3> ok, what am I looking for?
[15:12:31] <StephenLynx> what does it tells you?
[15:12:38] <hsk3> active (running)
[15:12:46] <StephenLynx> then you started the service itself.
[15:13:08] <StephenLynx> see how many mongod processes are running.
[15:13:29] <hsk3> how do i do that?
[15:14:07] <teprrr> ps aux|grep mongod
[15:14:10] <StephenLynx> that
[15:14:27] <hsk3> there's only one running
[15:14:27] <StephenLynx> keep in mind the grep process itself will show.\
[15:14:30] <StephenLynx> hm
[15:14:41] <hsk3> yeah two, counting the grep one
[15:14:43] <hsk3> so one :)
[15:14:43] <StephenLynx> then probably mongod ignored it when you tried to start it again.
[15:15:06] <StephenLynx> you have been using the service all the time.
[15:15:17] <hsk3> ok i'll look into it
[15:15:30] <StephenLynx> now where the config file is
[15:15:32] <StephenLynx> I forgot.
[15:15:37] <StephenLynx> I don`t do much management.
[16:15:31] <loadh> hello
[16:15:53] <loadh> I've got this issue where I've got a production DB and a DB I update using a CMS
[16:16:15] <loadh> I take a dump of the CMS DB and upload it to the production DB
[16:16:40] <loadh> the issue is that the user can save certain items locally based on the _id
[16:17:04] <loadh> but presumably, that ID can change if I recreate the data in the CMS?
[16:17:30] <loadh> should I somehow create an _id from natural keys in the data (liek the name of the thing etc.)
[16:17:39] <loadh> (if that isn't too abstract a description of the issue)
[16:18:21] <loadh> (when I say locally I mean in the native App on their device)
[16:18:43] <loadh> so basically, the issue is that the ObjectID could change...
[16:19:08] <loadh> (because I think it's based on a machine ID and a time stamp or something?)
[16:28:53] <edrocks> loadh: you can set the `_id` field when you insert a document
[16:29:53] <loadh> @edrocks > Ok, but that still doesn't sort the issue of the user's device having persisted the 'Thing' by this id which will have changed
[16:30:01] <loadh> oh wait
[16:30:04] <loadh> well yes
[16:30:09] <edrocks> you just use their id
[16:30:39] <edrocks> or add a cms id field if you want and let mongodb generate a new one for the main db
[16:31:15] <loadh> @edrocks > update DB replacing all data with new, mongo generates it's object IDs, then take a dump of that and specify _id
[16:31:29] <loadh> meanwhile, the users device has an outdated ID for that Thing
[16:31:46] <loadh> because the user fetches from the production DB
[16:32:13] <edrocks> just insert the user documents into the main db with their _id field
[16:32:26] <edrocks> use the same id between the two databases
[16:32:32] <loadh> edrocks > I'm explaining this badly
[16:32:42] <loadh> DB 1 generates the IDs say
[16:32:54] <loadh> DB 2 gets updated from DB 1
[16:33:14] <loadh> user has a reference to an object it fetched from DB 2 before the latest update
[16:33:22] <loadh> and saved it to the device disk
[16:33:40] <edrocks> also look into "offline database synchronization". I believe sql has better support for this. But I haven't had to deal with it myself
[16:33:42] <loadh> upon retrieval from the device disk, it will be inconsistent
[16:33:48] <loadh> it's not really
[16:34:15] <edrocks> are you saying you have an issue because you already deployed things?
[16:34:24] <loadh> no, but will in future
[16:34:56] <loadh> the device fetches things from DB 2 which could get all it's contents replaced by the contents of DB 1
[16:34:56] <edrocks> is db2 on the device?
[16:35:10] <loadh> the device fetches from DB 2
[16:35:22] <loadh> and stores a few things the user has 'liked' on the device
[16:35:38] <loadh> when I say 'fetches' I mean there's an API and all that
[16:36:11] <loadh> imagine that the things in the database represented articles or something
[16:36:33] <loadh> i do all my editing in DB 1, the occasionally, replace the contents of DB 2 with the contents of DB 1
[16:36:58] <loadh> the user facing API / Web Service interacts with db 2
[16:36:59] <edrocks> if db 1 and db 2 are online why not just get rid of db2 and use db1 for everything?
[16:37:25] <loadh> because I need to be able to edit things and don;t really want to not have the freedom of being able to update and verify etc.
[16:37:37] <loadh> and...
[16:37:40] <edrocks> do you not control db1?
[16:37:51] <loadh> performance wise, it's best if DB 2 is read only
[16:37:54] <loadh> i do
[16:37:56] <loadh> i control both
[16:38:29] <edrocks> have you considered setting up a replica set? you would need a 3rd node(either data bearing or an arbiter)
[16:38:40] <edrocks> https://docs.mongodb.com/manual/replication/
[16:38:43] <loadh> a who and the what now?
[16:39:07] <edrocks> it basically links your databases together. read that link
[16:39:25] <loadh> ok thanks!
[16:39:26] <edrocks> sounds like you just didn't know about it but it should solve your issue if I understand your problem correctly
[16:39:51] <loadh> sounds like it might, but also sounds like I'd need to be careful about what I put into or remove from the DB
[16:40:23] <loadh> whereas in the two DB scenario I can edit and delete and horse around with the data in DB 1 all day and decide when the time's right to take a dump into DB 2
[16:40:26] <edrocks> you need to set if you want to read from a secondary or master and your write concern
[16:40:59] <loadh> Without ever risking that the user will see dodgy data that I'm horsing around with...
[16:41:02] <edrocks> you get the choice of making your writes async or sync(acknowledged by x nodes or a majority)
[16:41:08] <loadh> ok
[16:41:12] <loadh> i'll have a read
[16:41:14] <loadh> sounds complicated
[16:41:18] <edrocks> set your read concern to master if you are worried about that
[16:41:27] <edrocks> read through that though and you should be good
[16:41:37] <loadh> awesome, thanks edrocks :)
[16:41:50] <edrocks> np, good luck
[17:22:28] <Conner05> I want to stand up a .net app using mongodb. I need to enable use authentication. Can I use .net's default auth stuff with mongo?
[17:32:55] <StephenLynx> you will have to ask .net people.
[17:51:46] <lolcat> Hello
[17:52:26] <lolcat> What uses mongodb?
[17:54:36] <lolcat> Hello
[17:54:48] <lolcat> Does it support memcomputing?
[19:48:35] <viran> noob question, I want to save the User _Id in a different document, that is the type of _id ?
[19:48:39] <viran> what*
[21:47:42] <direwolf> hey i m trying to create a auto imcrement field
[21:47:43] <direwolf> https://docs.mongodb.com/v3.0/tutorial/create-an-auto-incrementing-field/#auto-increment-counters-collection
[21:47:52] <direwolf> i m following this tutoiral
[21:48:24] <direwolf> but the find and modify query does not return value