Install MongoDB under Ubuntu

Source: Internet
Author: User
Tags install mongodb

First: Introduce the public key in the local system

sudo apt-key adv--keyserver hkp://keyserver.ubuntu.com:80--recv EA312927

Two: Then add a MONGO address from the local source.

ubuntu12.04

Echo "Deb Http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.2 multiverse" | sudo tee/etc/apt/ Sources.list.d/mongodb-org-3.2.list

Ubuntu 14.04

Echo "Deb Http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee/etc/apt/ Sources.list.d/mongodb-org-3.2.list

Ubuntu 16.04

Echo "Deb Http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee/etc/apt/ Sources.list.d/mongodb-org-3.2.list

Three: Update the source file

sudo apt-get update

Four: Installing MongoDB

If you want to install the default version directly, simply

sudo apt-get install-y mongodb-org

If you want to install a build, you need to

sudo apt-get install-y mongodb-org=3.2.8 mongodb-org-server=3.2.8 Mongodb-org-shell=3.2.8 Mongodb-org-mongos=3.2.8 mongodb-org-tools=3.2.8

After the = sign, follow the version number you specified.

Five: After the installation is complete, you can modify the path of the data storage and the path of the log file in the corresponding configuration file section of MONGO

Vi/etc/mongodb.conf

DBPATH Specifies the directory where your default data is stored

You can first create a folder, and then make this folder for you to store the data in the directory

Six: we can pass

sudo service Mongod start to start MONGO services

Seven: see if it starts

Netstat-antup

Eight: Start the client

Mongo

Install MongoDB under Ubuntu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.