We can also check where mongod listens by running the command below : $ sudo netstat -naptu | grep LISTEN | grep mongo The output from the command above shows that mongod is running. To check the MongoDB service you can run command below : $ sudo service mongod status $ echo "mongodb-org-tools hold" | sudo dpkg -set-selections $ echo "mongodb-org-mongos hold" | sudo dpkg -set-selections $ echo "mongodb-org-shell hold" | sudo dpkg -set-selections $ echo "mongodb-org-server hold" | sudo dpkg -set-selections After installation you can run the command below to pin your MongoDB version : $ echo "mongodb-org hold" | sudo dpkg -set-selections You might want to lock or 'pin' the MongoDB version installed on your server.
Install mongo shell only on ubuntu install#
To install the latest stable release of MongoDB you can use command below. You can see list of available versions from the MongoDB 3.2 repository by running the command below: $ sudo apt-cache show mongodb-org | grep Version $ echo "deb trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt//mongodb-org-3.2.list First of all, let's add MongoDB 3.2 repository. We will use the repository for version 3.2 in this tutorial.
This section will describe how-to install MongoDB from a specific version repository. If you already followed the section above you don't need to follow this section. Installing MongoDB From a Specific Version Repository To install version 3.2 of MongoDB you can run the command below : $ sudo apt-get install -y mongodb-org=3.2.0 mongodb-org-server=3.2.0 mongodb-org-shell=3.2.0 mongodb-org-mongos=3.2.0 mongodb-org-tools=3.2.0 If you only specify mongodb-org version it will install the latest version of each MongoDB package. If you want to install a specific version of MongoDB you need to a specify version for all packages and not only mongodb-org version. To install the latest stable release of MongoDB you can use the command below. You can see the list of available Versions of MongoDB on the stable repository by running the command below: $ sudo apt-cache show mongodb-org | grep Version Reload the local package database so apt can use the MongoDB repository. First of all, let's add the MongoDB stable repository : $ echo "deb trusty/mongodb-org/stable multiverse" | sudo tee /etc/apt//mongodb-org-stable.list This section will describe how-to install MongoDB from the stable repository. Installing MongoDB From the Stable Repository Let's install MongoDB.įirst of all let's add a MongoDB Public key used by package management $ sudo apt-key adv -keyserver hkp://:80 -recv EA312927
In this tutorial we'll learn installing MongoDB using both methods, using the stable repository channel and using a specific version. Using the first method you can get the latest stable version of MongoDB but using the second method you can make sure your version of MongoDB will never get upgraded to a new version, which is important for Porduction system. The first one is using the stable release repository, the second is to use a specific version repository. There are two ways to install MongoDB from the repository. This package contains the following MongoDB tools: mongoimport, bsondump, mongodump, mongoexport, mongofiles, mongooplog, mongoperf, mongorestore, mongostat, and mongotop. This package will install MongoDB server (mongod daemon), configurations and init scripts. This is a metapackage that will install all packages below. In this tutorial we'll learn how-to install MongoDB on Ubuntu 14.04.īefore we start the MongoDB installation, you need to know that MongoDB repository contains the following packages : Currently the packages available for Ubuntu 12.04 (Precise Pangolin) and Ubuntu 14.04 (Trusty Tahr). MongoDB only provides packages for the 64-bit Long Term Support (LTS) version of Ubuntu. The replica sets can provide eventually consistent reads with low-latency high troughput.Īs an additional introduction about MongoDB you can watch "What is MongoDB" Video below : Installing MongoDB
Automatic Scaling by providing automatic sharding which distributes data accross a cluster of machines.High Availability with replication facility that provides automatic failover and data redundancy.High performance data persistence, in particular support for embedded data models that reduces I/O activity on database.Several key features of MongoDB include : Get a Cloud Server MongoDB (from Humongous) is an open source document based database that provides high performance, high availability and automatic scaling. Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.