Let’s see a step-by-step method to install MongoDB using AWS Cloud9. At Bobcares, with our AWS Support Services, we can handle your AWS issues.
How to install MongoDB using AWS Cloud9?
AWS Cloud9 is an efficient development environment. It offers an effective code-editing experience, with support for various programming languages, runtime debuggers, and a built-in terminal. It’s a collection of tools for creating, producing, executing, testing, and debugging software, as well as publishing it to the cloud.
Amazon DocumentDB is a non-relational database service built from the bottom up to provide the speed, scalability, and availability required for scaling mission-critical MongoDB applications.
Installing Amazon DocumentDB (with MongoDB compatibility) using AWS Cloud9
The process of installing Amazon DocumentDB (with MongoDB compatibility) using AWS Cloud9 includes the following steps:
- AWS Cloud9 environment creation
- Security group creation
- Amazon DocumentDB cluster creation
- Mongo shell installation
- Connect the Amazon DocumentDB cluster
AWS Cloud9 environment creation
- Navigate to the AWS Cloud9 console via the AWS Management Console and select Create environment.
- Enter “DocumentDBCloud9” in the Name field of the Environment name and description section.
- Select the Next step.
- Again select the Next step in the Configure settings section.
- Select Create environment in the Review section.
Security group creation
- Select Security groups from the Network and Security menu in the Amazon EC2 Management Console.
- Select Create security group.
- Provide the following for each field in the Basic details box: for the Security group name, enter
demoDocDB
, for Description, enter a description, and for VPC, accept the usage of the default VPC. - Choose Add rule in the Inbound rules section.
- Select Custom TCP Rule for Type.
- For the Port range, provide 27017.
- The source is the security group for the newly built AWS Cloud9 environment. Enter cloud9 in the destination field to obtain a list of possible security groups. Select the security group named aws-cloud9-<environment name>.
- Accept all other defaults. Select Create a security group.
Amazon DocumentDB cluster creation
- Select Create from the Clusters menu in the Amazon DocumentDB management console.
- In the Configuration section of the Create Amazon DocumentDB cluster page, select 1 for the Number of instances. The remaining options in the Configuration section can be left alone.
- Enter a username and password in the Authentication area.
- Enable Show advanced settings.
- Choose
demoDocDB
in the Network settings section for VPC security groups. - Select Create cluster.
Mongo shell installation
- If the AWS Cloud9 environment from Step 1 is still open, return to it and skip to instruction 3. If we went away from the AWS Cloud9 environment, locate the environment labeled DocumentDBCloud9 in the AWS Cloud9 management dashboard, under Your environments. Select Open IDE.
- Create the repository file at the command prompt by using the following command:
echo -e "[mongodb-org-4.0] \nname=MongoDB Repository\nbaseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/4.0/x86_64/\ngpgcheck=1 \nenabled=1 \ngpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc" | sudo tee /etc/yum.repos.d/mongodb-org-4.0.repo
- Then use the following command to install the mongo shell:
sudo yum install -y mongodb-org-shell
Connect the Amazon DocumentDB cluster
- Locate the cluster in the Amazon DocumentDB management dashboard under Clusters. By clicking on the cluster identifier, we can select the cluster we built.
- Copy the connection string provided on the Connectivity and Security tab, under Connect to this cluster using the mongo shell. Avoid the portion so that mongo shell will prompt for a password when we connect.
- Return to the AWS Cloud9 instance and paste the connection string.
We successfully install MongoDB using AWS Cloud9 when we input the password and the prompt changed to rs0:PRIMARY>
.
[Searching for a solution to a different AWS query? We’re available 24/7.]
Conclusion
To conclude, we have provided a detailed description of installing MongoDB using AWS Cloud9 which includes four steps namely, AWS Cloud9 environment creation, Security group creation, Amazon DocumentDB cluster creation, Mongo shell installation, and Connecting the Amazon DocumentDB cluster.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments