Created
September 28, 2017 13:20
-
-
Save bruceh48/8cb43906074e9874fc2dcb9660126861 to your computer and use it in GitHub Desktop.
Install MongoDB on Ubuntu16.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
sudo apt-get update && sudo apt-get -y upgrade | |
sudo apt-get install -y mongodb-org | |
cd /lib/systemd/system/ | |
nano mongod.service | |
[Unit] | |
Description=High-performance, schema-free document-oriented database | |
After=network.target | |
Documentation=https://docs.mongodb.org/manual | |
[Service] | |
User=mongodb | |
Group=mongodb | |
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf | |
[Install] | |
WantedBy=multi-user.target | |
systemctl daemon-reload | |
# Start mongodb and add it as service to be started at boot time: | |
sudo systemctl start mongod | |
sudo systemctl enable mongod | |
# Check that it has started: | |
netstat -plntu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment