From the course: MongoDB Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Set up a replica set from the command line

Set up a replica set from the command line - MongoDB Tutorial

From the course: MongoDB Essential Training

Set up a replica set from the command line

- [Instructor] In this video, we're going to create a three-member replica set using the command line. For our production environment, it is recommended to use configuration files, which we will do in the next video. However, it is also useful to know how to spin up a cluster without config files, so I recommend you try both. All right. If you followed along in the previous videos, then your terminal will look something like this. So the first thing I'm going to do is I'm going to terminate the mongod process we were running by just saying Control + C. Cool. And I will also exit out of the mongod shell. Control + D. Cool. Now, to begin, I'm going to create a folder for this replica set, replica set cmdline. All right. And then I'm going to change directory into that new folder. Here we go. Wonderful. Okay. Next, I'm going to create a key file for our database. I'm going to do that by typing in openssl rand,…

Contents