hands-on lab

Install MongoDB with Persistent Volumes

Difficulty: Beginner
Duration: Up to 1 hour and 30 minutes
Students: 177
Rating: 4.5/5
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

Lab Overview

MongoDB is an extremely popular cross-platform document-oriented database.

This Lab is designed to show you how to install MongoDB with persistent data volumes on a Linux based EC2 instance within AWS.

Lab Objectives

Upon completion of this Lab, you will be able to:

  • Install and configure MongoDB on Amazon 2 Linux with persistent EBS based volumes
  • Use the mongo client command to connect to the MongoDB service and create and query data
  • Prepare and format an XFS based filesystem using the mkfs.xfs command
  • Mount filesystems

You should:

  • Be comfortable with using an SSH based terminal session

Lab Environment

This Lab will start with the following AWS resources provisioned automatically for you:

  • A single EC2 instance, named mongodb.server.instance, which will have a public IP address attached. This will be the instance that you will connect to using SSH, to setup and install MongoDB.

To achieve the Lab end state, you will be walked through the process of:

  • Using your local terminal or SSH client to remotely connect to mongodb.server.instance
  • Format and prepare persistent disk volumes for the /data, /log, and /journal directories used by MongoDB
  • Install and configure the MongoDB service
  • Use the mongo client command to connect to the MongoDB service and create and query data

Updates

December 29th, 2022 - Updated lab to use EC2 Instance Connect

Environment before

Environment after

Lab steps

Logging In to the Amazon Web Services Console
Connecting to an EC2 Instance Using Amazon EC2 Instance Connect
Format and Mount Persistent Data Volumes
Install MongoDB
Connect to MongoDB Service