Install MongoDB with Persistent Volumes

Lab Steps

Logging in to the Amazon Web Services Console
Connecting to the Virtual Machine using SSH
Format and Mount Persistent Data Volumes
Install MongoDB
Connect to MongoDB Service

Ready for the real environment experience?

Time Limit1h 30m


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


About the Author
Learning paths91

Jeremy is a Content Lead Architect and DevOps SME here at Cloud Academy where he specializes in developing DevOps technical training documentation.

He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 25+ years. In recent times, Jeremy has been focused on DevOps, Cloud (AWS, GCP, Azure), Security, Kubernetes, and Machine Learning.

Jeremy holds professional certifications for AWS, GCP, Terraform, Kubernetes (CKA, CKAD, CKS).