Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Agoreddah/c4815261a5d08d7b226f80296702f4af to your computer and use it in GitHub Desktop.
Save Agoreddah/c4815261a5d08d7b226f80296702f4af to your computer and use it in GitHub Desktop.
Installing MongoDB specific 3.4. verion on Ubuntu 16.04
#!/bin/sh
# Αdd GPG public key
echo "adding gdp public key"
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
# Create MongoDB list file in /etc/apt/sources.list.d/
echo "creating mongo list file"
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-3.4.list
# Install MongoDB with specific 3.4 version
echo "updating apt-get"
sudo apt-get update
echo "installing mongodb 3.4 version"
sudo apt-get install -y mongodb-org=3.4.1 mongodb-org-server=3.4.1 mongodb-org-shell=3.4.1 mongodb-org-mongos=3.4.1 mongodb-org-tools=3.4.10
# Change bindIP to 0.0.0.0
# sudo sed -i 's/127\.0\.0\.1/0\.0\.0\.0/g' /etc/mongod.conf
# Start and enable MongoDB service
# echo "starting mongod service"
# sudo systemctl start mongod
# echo "enabling mongod service"
# sudo systemctl enable mongod.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment