How to setup Mongodb in AWS C9


#1

Old c9 is easy but how to do in AWS?


#2

Having the same issue, anyone got a solution?


#3

I used C9 on AWS for a while and encountered the same problem. The EC2 instance type was t2.micro (1 GiB RAM + 1 vCPU) Red Hat linux, which was completely new to me even though I managed to install Mongodb (version 3.6) following the instruction available at https://docs.mongodb.com/manual/tutorial/install-mongodb-on-amazon/ . You may use this command “mongod --bind_ip=$IP --dbpath=/home/ec2-user/environment/data --nojournal” to run the mongodb daemon. If you are like me then you may want to create an Ubuntu EC2 instance and create a c9 ssh space on AWS.
Happy coding.


#4

Can I clone your instance


#5

You don’t have to clone my instance. Just follow the steps below to install MongoDB after creating your EC2 instance for C9.

  1. Run the command sudo nano /etc/yum.repos.d/mongodb-org-3.6.repo on the shell

  2. Copy-paste the following content to the file

    [mongodb-org-3.6]
    name=MongoDB Repository
    baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.6/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc

  3. Hit ctrl+o and then hit enter to save the file and hit ctrl+x to close the file.

  4. Run the command sudo yum install -y mongodb-org

  5. Run the command mkdir /home/ec2-user/environment/data to create a data directory for your MongoDB data folder.

  6. Run the command mongod --bind_ip=$IP --dbpath=/home/ec2-user/environment/data --nojournal to run the MongoDB daemon process.

That’s all.


#6

Thanks you so much picklu! This wasted so much of my time as there was so much bad info out there.