PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Friday the 18th of October, 2019

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[08:14:01] <zelest> Can I have a replicaset of 6 servers and set votes to 0 on one of them? Kind of like a reverse-arbieter? :)
[08:40:12] <Stummi> Hey, it seems I can't get a mongodb running via docker. I am running "docker run -p 27017:27107 mongo:4", but trying to access localhost:27017 with any mongo client fails, and telnet localhost 27017 immediately closes the connection
[08:40:29] <Stummi> is there anyting more I need to do to get it working?
[08:42:58] <Stummi> hm, seems to work when I run it with "--network host". So probably some problem with docker setup. Sorry for the noise
[12:05:14] <zelest> How can I read the result from a aggregate pipeline using the PHP driver? I get a cursor but I cannot foreach() it nor $foo = new IteratorIterator($cursor), but if I var_dump() it, I see the result under the command, but can't seem to access it. <o>
[12:16:34] <zelest> Anyone?
[12:50:06] <GothAlice> zelest: Sorry to be snarky, by problem #1: using PHP. (Alas, I can not assist with such problems, or I would be slightly more helpful than this. I do not PHP, and have not since PHP 3, and it's been liberating to use "arguably real" programming languages since switching away.)
[12:50:58] <GothAlice> (Problem #2: complicating local dev setup with Docker. I really don't grok why people put themselves through the pain.)
[12:53:08] <zelest> Heya GothAlice!
[12:53:21] <GothAlice> Yo. Morning! ;)
[12:53:23] <zelest> I've had a chat with Derick and it seems there's a bug in the PHP library
[12:53:42] <zelest> I'm using mongodb 3.2 as well, I'll try to bump that version to see if the problem goes away
[12:53:50] <zelest> otherwise I'll poke the jira about it
[12:55:03] <zelest> Also, I run FreeBSD on bare metal without sort of docker horror ;)
[14:47:36] <smrtz> Heyo! Is there a way to run the official Mongodb Docker container without any volumes? I'd like to initialize a totally fresh DB each time the container starts up.
[14:48:31] <smrtz> It looks like it just creates a volume for /data/db and /data/configdb, so maybe I could just store my db somewhere else?
[14:50:21] <GothAlice> smrtz: --dbPath — note that it's rather unusual to not allocate permanent storage to your service image that's all about data persistence. *I* used to run PostgreSQL clusters without permanent storage, but that was backed by WAL-e per-minute oplog archival (RPO of one minute, RTO of ~8) which… is a rather advanced use-case.
[14:50:50] <GothAlice> I would not recommend others attempt that unless they have a need only met by DB-entirely-in-RAMdisk. ;P
[14:50:59] <smrtz> I know it's not the norm, but I'm trying to build a containerized instance of a web app for some sales guys to use as a demo, so the DB needs to reset each time.
[14:51:36] <GothAlice> smrtz: I don't roll over MongoDB nodes for that; I have my demo application unpack a "known good" fixture on startup. :/
[14:52:02] <GothAlice> On start: nuke anything that's there, recreate collection metadata (indexes, views, etc.), populate from fixture. Good to go.
[14:52:11] <smrtz> That's what I'm doing now, but it's taking a little too long to startup.
[14:52:37] <smrtz> Although maybe I could fix that another way.
[14:52:47] <smrtz> I'll give that a shot before I start mucking about with this.
[14:52:53] <smrtz> Thanks for the feedback.
[14:53:02] <GothAlice> Your fixture can, itself, be a database.
[14:53:59] <GothAlice> https://docs.mongodb.com/manual/reference/method/db.cloneCollection/ ← copy "pristine" collections from a fixture database/dataset to your demo DB.
[14:54:23] <smrtz> Does that remove extra documents, or do I still have to blow it away at startup?
[14:54:43] <GothAlice> Nothing is ever written to the fixture DB that you don't want to be included on any new demo startup.
[14:55:20] <GothAlice> Demo works away in their demo DB, want to reset it to pristine? Restart the app, it nukes, rebuilds metadata, copies desired collections.
[14:55:40] <smrtz> Hmm, alright, I'll look into that now. Thanks!
[14:56:16] <smrtz> I was using mongorestore instead of cloning. Maybe this'll be faster.
[14:57:07] <GothAlice> That will not be faster.
[14:57:23] <smrtz> mongorestore, or cloning?
[14:58:51] <smrtz> Because I'm not a DBA and didn't think about it. I just googled how to restore a mongodb to a snapshot, and did the first thing.
[14:59:12] <synthmeat> that's as fair answer as they come
[14:59:12] <smrtz> haha
[14:59:41] <smrtz> I'll play with cloneCollection now, thanks again!
[15:00:01] <smrtz> synthmeat Yeah, I just do some IT and DevOps stuff, and figured I could help the sales guys out here.
[15:00:09] <smrtz> I've learned a lot so far though!
[18:39:32] <ac_slater> hey guys, what's a normal way to create collections/dbs on a new mongo instance?
[18:40:03] <ac_slater> postgres has a backup/dump option to just dump schema and I'm not sure if mongo has something similar. My google-fu is weak today.