MongoDB installation

Installation Of MongoDB Database Server 

Installation of MongoDB Database is an open source cross-platform documented-oriented database program. It stores the data in JSON like documents with dynamic schema. Other database stores the data in table and rows.

Check Out : How To Check Users In Mysql Database Server In Linux

Features of MongoDB Database:

  • Provides high performance
  • Load balancing
  • Duplication of data
  • Replication
  • Indexing
  • Supports map reduce and aggregation tools

Default port number is 27017 and Main configuration file is at /etc/mangod.conf

Mongodb provides supported Packages in their own repository,

  1. Mongodb-org-server = keeps mongod daemon and associated configuration files & init scripts
  2. Mongodb-org-mongos = contains mongos daemon
  3. Mongodb-org-shell = Contains mongo shell
  4. Mongodb-org-tools = Contains mongodb tools like exports, dump, start, restore and more.

Let’s install

You will have to add mongodb repository in your system.

You can manually download the Packages from here Download

vim /etc/yum.repos.d/mongo-repo

yum install mongodb-org –y

Now start the service,

systemctl start mongod

Now Set The Selinux, I would recommend to disable selinux but if you do not want to keep it enable then run below command

semanage port -a -t mongod_port_t -p tcp 27017

Check mongoDB version

mongod –version

Check if it’s listening on port

netstat –antup | grep 27017

Now try to access Mongodb Server,

mongo

If you face any authorisation issue, edit the file /etc/mongod.conf

Turn it from here

You can also see default databases

show dbs

You’re done

Sponsored

LEAVE A REPLY

Please enter your comment!
Please enter your name here

10 − 7 =