Skip to content

Instantly share code, notes, and snippets.

Created March 25, 2012 17:38
What would you like to do?
Install MongoDB on Amazon EC2
echo "*****************************************"
echo " Add the 10gen repository - after you press"
echo " enter add the following lines and then"
echo " cntl-X to save:"
echo " [10gen]"
echo " name=10gen Repository"
echo " baseurl="
echo " gpgcheck=0"
echo "*****************************************"
read -p "Press [Enter] to continue..."
nano /etc/yum.repos.d/10gen.repo
# install MongoDB
sudo yum install mongo-10gen and mongo-10gen-server
# start the service
sudo service mongod start
# install service
sudo chkconfig mongod on
Copy link

How to Access MongoDB default http 28017 port with public DNS in browser?


Just a hint to omit prompting user to do copying and pressing any keys.

repo = "/etc/yum.repos.d/10gen.repo"

echo " [10gen]" | sudo tee $repo
echo " name=10gen Repository" | sudo tee -a $repo
echo " baseurl=" | sudo tee -a $repo
echo " gpgcheck=0" | sudo tee -a $repo


Copy link

Good one. A tarball approach provides more control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment