Friday, January 26, 2018

Install MongoDB using .rpm Packages (download and install) – Linux

Install MongoDB using .rpm Packages (download and install) – Linux

Here we gonna install MongoDB 3.2.16 by downloading the .rpm packages and installing, instead of having .repo files.

Download the rpm packages


sudo yumdownloader mongodb-org-3.2.16 mongodb-org-server-3.2.16 mongodb-org-shell-3.2.16 mongodb-org-mongos-3.2.16 mongodb-org-tools-3.2.16


It will get downloaded in the home directory,


Install the binaries

sudo yum install mongodb-org-3.2.16-1.el7.x86_64.rpm mongodb-org-mongos-3.2.16-1.el7.x86_64.rpm mongodb-org-server-3.2.16-1.el7.x86_64.rpm mongodb-org-shell-3.2.16-1.el7.x86_64.rpm mongodb-org-tools-3.2.16-1.el7.x86_64.rpm


When click on enter, the below screen will appear after the successful installation,


By default, after the installation the below mentioned files will be created –

/var/log/mongodb/mongod.log
/etc/mongod.conf – Configuration File

When we start the server, the server will start according to the configuration mentioned in /etc/mongod.conf file.

Configuration File – by default

dbpath - /var/lib/mongo
logpath - /var/log/mongodb/mongod.log
port – 27017

To start the server

# sudo service mongod start


You can check the mongo service by using the command,
# ps aux | grep mongo

To Start the client

Just type mongo in the same terminal, as we forked the process which is mentioned in the config file.

# mongo


Done...







5 comments: