MongoDB:
MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling. MongoDB obviates the need for an Object Relational Mapping (ORM) to facilitate development.
Record:
he mongodb-org-server package provides an initialization script that starts mongod with the /etc/mongod.conf configuration file
etc/mongod.conf configuration file supplied by the packages have bind_ip set to 127.0.0.1 by default. Modify this setting as needed for your environment.
To install a specific release, you must specify each component package individually along with the version number, as in the following example:
MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling. MongoDB obviates the need for an Object Relational Mapping (ORM) to facilitate development.
Record:
A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB documents are similar to JSON objects. The values of fields may include other documents, arrays, and arrays of documents.
Collection:
MongoDB stores documents in collections. Collections are analogous to tables in relational databases. Unlike a table, however, a collection does not require its documents to have the same schema.
In MongoDB, documents stored in a collection must have a unique _id field that acts as a primary key
Collection:
MongoDB stores documents in collections. Collections are analogous to tables in relational databases. Unlike a table, however, a collection does not require its documents to have the same schema.
In MongoDB, documents stored in a collection must have a unique _id field that acts as a primary key
Packages:
MongoDB provides officially supported packages in their own repository. This repository contains the following packages:
Installation:Package Name | Description |
---|---|
mongodb-org | A metapackage that will automatically install the four component packages listed below. |
mongodb-org-server | Contains the mongod daemon and associated configuration and init scripts. |
mongodb-org-mongos | Contains the mongos daemon. |
mongodb-org-shell | Contains the mongo shell. |
mongodb-org-tools | Contains the following MongoDB tools: mongoimport bsondump , mongodump , mongoexport , mongofiles , mongoperf , mongorestore , mongostat , and mongotop . |
he mongodb-org-server package provides an initialization script that starts mongod with the /etc/mongod.conf configuration file
etc/mongod.conf configuration file supplied by the packages have bind_ip set to 127.0.0.1 by default. Modify this setting as needed for your environment.
Step 1: Import the Public key
root@US16:~# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
Step 2: Create a list file for MongoDB.
Create the /etc/apt/sources.list.d/mongodb-org-3.6.list list file using the command root@US16:~# 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
Step 3: Update Package Database
root@US16:~# apt update
Step 4: Install MongoDB Package
To install MongoDB latest version run the following command.
root@US16:~# apt-get install -y mongodb-org
To install a specific release, you must specify each component package individually along with the version number, as in the following example:
root@US16:~# apt-get install -y mongodb-org=3.6.0 mongodb-org-server=3.6.0 mongodb-org-shell=3.6.0 mongodb-org-mongos=3.6.0 mongodb-org-tools=3.6.0
Installation of Mongodb version 3.6.0 has done.
Step 5: Start Mongodb service.
To start Mongodb service hit the following command
root@US16:~# systemctl start mongod.service
Check Service status
root@US16:~# systemctl status mongod.service
Mongodb server is up and running.
Step 6: Enable mongodb service auto start at system boot.
root@US16:~# systemctl enable mongod.service
Step 7: Check Mongodb version
root@US16:~# mongo -version
Mongodb server installation has completed, in next blog We will learn some basic command to administrate mongodb server.
To enable logon authentication, Please visit URL below:
Thanks for sharing this blog
ReplyDeleteFull Stack online Training
Full Stack Training
Full Stack Developer Online Training
many thanks for this. works for me! (Nov 2019, ubuntu server 18.04)
ReplyDeleteVery Very Thanks for this, your blog is very helpful information about operating system
ReplyDeletelink USA Dedicated Server
link USA Dedicated Server