MongoDB with Async Python Transcripts
Chapter: Deployment
Lecture: Installing MongoDB

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now we're ready to install and run MongoDB on that server. You can see the guide is right here.
0:09 Make sure you go back and double check because, for example, if there's a server version 7 for the main version number, you'll want to update this.
0:17 So these change just a little bit depending on what version of Linux you're running as well as what version of MongoDB is out. So we'll go back home.
0:36 Then we're going to set up a key ring here, so that when we do apt update apt install, MongoDB's details can be found. Carrying on with that here.
0:49 Again, don't try to copy these, just get them straight out of the list.
0:55 So we're going to say go refresh your app details based on these new servers that you know about now. Perfect.
1:05 So now we should be able to say apt install, yes, don't ask, mongodb.org.
1:13 In mongodb.org, the package actually represents the server, the database tools, the shell. It's like a meta package for other things.
1:20 So let's go and do that. You can see all the stuff up here that it is a meta package for. Excellent.
1:31 It also added a MongoDB user, so it's not running as a root or anything like that. Thank you, MongoDB. So let's try to start it first.
1:41 Enable means it's going to auto start. Every time the server starts, you're just going to reboot. If you reboot, it'll automatically come back.
1:47 good so you don't have to maintain or completely babysit the server. Start will start it. Also
1:54 stop if you want to stop. Let's go with this one first. Looks like it started. If there was an error
2:00 you would see it but we can ask how it's doing here. And sure enough it is running. This is its
2:08 log file. That all looks good. Another tool that's nice to have is we can install something called
2:14 Glances. So do we have pip 3 here? No. Maybe we can install it with apt. apt install glances.
2:21 That's going to add a little bit to our server, but you know I'm going to do it because glances
2:28 is a fantastic tool. We'll want to use it later. Glances is like top if you're familiar with that,
2:34 or like a process manager, task manager type thing, activity monitor. Take your OS.
2:42 But this is really, really nice because it runs in the shell and it gives us tons of excellent information.
2:48 Well, it was a big update, but let's type ""glances"" and see what happens. Excellent. If we make it a little wider, you can see even more.
2:57 You get a cool little, sort of, not quite progress bar, but graph over here of how it's doing. And most importantly, you can see MongoDB is here.
3:05 And if you hit M, it'll sort by memory. If you hit C, it'll sort by CPU. but we'll sort by memory and you can see that MongoDB is hanging out here.
3:13 Not using too much, but as we do more work with it, it'll probably use a little more.
3:19 Anyway, we'll be able to monitor what's going on with MongoDB and other things, as well as how healthy is the server.
3:25 It's green because it's only using 20% of its two gigs that I gave it. All those kinds of things. So this I think is worth having. It's up to you.
3:35 You can see it did require basically installing all of Python and a bunch of other things on the server. So it's worth it for me.
3:42 If it's worth it for you, that's, that's cool as well.


Talk Python's Mastodon Michael Kennedy's Mastodon