Old c9 is easy but how to do in AWS?
How to setup Mongodb in AWS C9
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.
You don’t have to clone my instance. Just follow the steps below to install MongoDB after creating your EC2 instance for C9.
-
Run the command
sudo nano /etc/yum.repos.d/mongodb-org-3.6.repo
on the shell -
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
-
Hit ctrl+o and then hit enter to save the file and hit ctrl+x to close the file.
-
Run the command
sudo yum install -y mongodb-org
-
Run the command
mkdir /home/ec2-user/environment/data
to create a data directory for your MongoDB data folder. -
Run the command
mongod --bind_ip=$IP --dbpath=/home/ec2-user/environment/data --nojournal
to run the MongoDB daemon process.
That’s all.
Thanks you so much picklu! This wasted so much of my time as there was so much bad info out there.