Skip to content

Instantly share code, notes, and snippets.

@kirankotari
Created February 20, 2019 19:38
Show Gist options
  • Save kirankotari/111394233db5f00dfadba3f2c2b18bc0 to your computer and use it in GitHub Desktop.
Save kirankotari/111394233db5f00dfadba3f2c2b18bc0 to your computer and use it in GitHub Desktop.
M220P: MongoDB for Python Developers DB setup
#!/bin/bash
echo 'Starting Provision: DB'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
echo "mongodb-org hold" | sudo dpkg --set-selections
echo "mongodb-org-server hold" | sudo dpkg --set-selections
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
sudo service mongod start --bind_ip 192.168.27.71
echo 'Provision DB complete'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment