MongoDB with Async Python Transcripts
Chapter: Deployment
Lecture: Getting the Server Ready

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now to set up our MongoDB server, well, I had to create a server, right? So I actually went to DigitalOcean
0:07 and created a $20 Ubuntu server that we can use. Now, you might need something a lot less. This is honestly pretty high end,
0:16 but we're gonna do load testing later and I wanna give you a sense of what you can get out of like a reasonably powerful,
0:22 but not insanely powerful computer. Also, I took the IP address that they told me my server was created at and I said I went to my hosts file.
0:34 So on Windows, that's system32/hosts, I believe. And then on macOS and Linux, it's just /etc/hosts. And I put in this IP address, I gave it a name,
0:49 mongo-course-server. So let's connect to that. It says, ""Is this your first time connecting? You wanna do that? Yes, it connects.
0:59 you can notice that it comes out of the box fairly insecure. There's 104 security updates. So yikes, yikes, yikes.
1:07 The first thing to do is notice we're running as root. So because of that, we don't need to type sudo. So we can say apt update.
1:16 See if there's any more issues. Nope. And we can say apt upgrade. So first thing, as soon as it's on, you wanna just get it patched up
1:27 and make sure it's the latest. With all those changes, there's a really good chance that it's gonna need an update, a reboot.
1:37 So let's, you can disconnect and reconnect, and you can see system restart required, so nothing's running here. We'll just give it a quick reboot.
1:47 Maybe give it, normally it's really quick, but with all the changes it has to apply, maybe give it 20 seconds, and we'll try to connect to it again.
1:56 Not yet. Not yet. Here we go. And we're back. Zero updates. Excellent. I want to do one more thing.
2:05 I noticed that this terminal, that this prompt shell here is bash. I really don't like the way bash remembers the history
2:12 and lets you kind of go back and forth between some of your commands. So I'm going to apt install zsh on our way to install omizsh or omizshell.
2:23 Certainly something you don't have to do, but it is just nice. but it is just nicer in my opinion.
2:28 So the next thing we're gonna do is run the install command from omizshell. Now, all of these commands here, don't worry about them.
2:37 Don't try to copy them down or anything. I'm giving them to you in a file that you'll see in just a minute, but let's just get the server
2:44 safely running on the internet here. So now we have this new shell and why do I like it?
2:55 So you can type things just like part of a command and just arrow through the history and it's just nicer.
3:01 So our server is now running on my Zshell and we're about ready to go. The next thing we're going to do is actually set up the MongoDB details.


Talk Python's Mastodon Michael Kennedy's Mastodon