Skip to content

Instantly share code, notes, and snippets.

@CarlasHub
Created May 12, 2018 19:34
Show Gist options
  • Save CarlasHub/15ae50bb29ab68ed0d13f818f9227057 to your computer and use it in GitHub Desktop.
Save CarlasHub/15ae50bb29ab68ed0d13f818f9227057 to your computer and use it in GitHub Desktop.
Installing MongoDB -Cloud9
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org
mongo --version
//cd into the root directory ~
mkdir data
echo "mongod --dbpath=data --nojournal" > mongod
chmod a+x mongod
//cd into the root directory ~
./mongod
// Cloud 9 could timeout and cause mongo to crashf this happens, try the following steps to repair it.
cd ~
./mongod --repair
//find the /data directory (it should be inside of ~) and cd into it.
//Once inside, run rm mongod.lock then cd back into ~ and run ./mongod again (see below).
cd ~/data
rm mongod.lock
cd
./mongod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment