sh 在Ubuntu 16.04上安装Mongo 3.6

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 在Ubuntu 16.04上安装Mongo 3.6相关的知识,希望对你有一定的参考价值。

sudo nano /etc/systemd/system/mongodb.service
sudo apt-get update && sudo apt-get install mongodb-org -y
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true

systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

net:
  port: 27017
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org

#if it creates this file, delete it
sudo rm /etc/systemd/system/mongodb.service
sudo nano /etc/systemd/system/mongodb.service

#Append the contents of mongodb.service file below

#if it creates this file, delete it
sudo rm /etc/mongod.conf
sudo nano /etc/mongod.conf

#Append the contents of mongod.conf file below

#Start your system
sudo systemctl start mongodb
#If service is masked, unmask it
sudo systemctl unmask mongodb
#check status
sudo systemctl status mongodb
#Enable automatic load
sudo systemctl enable mongodb
#Start MongoDB
sudo systemctl start mongodb

以上是关于sh 在Ubuntu 16.04上安装Mongo 3.6的主要内容,如果未能解决你的问题,请参考以下文章

sh 在Ubuntu 16.04中卸载Mongo 2.6

sh 在ubuntu 16.04上安装saltstack

sh 在ubuntu 16.04上安装saltstack

sh 在Ubuntu 16.04上安装Pulse Secure

sh 在Ubuntu 16.04上安装ChromeDriver和Selenium

sh 在Ubuntu 16.04上安装MariaDB服务器