0% found this document useful (0 votes)
44 views

MongoDB 4.0 Installation

This document provides instructions for installing MongoDB on Centos 7. It details adding the MongoDB repository, installing the MongoDB package with yum, starting and enabling the mongod service, and verifying the installation and version. It also covers configuring mongod to allow remote connections by editing mongod.conf and describes log file locations. Potential problems like a failed socket unlink are addressed with solutions like deleting the socket file.

Uploaded by

manjunath61
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

MongoDB 4.0 Installation

This document provides instructions for installing MongoDB on Centos 7. It details adding the MongoDB repository, installing the MongoDB package with yum, starting and enabling the mongod service, and verifying the installation and version. It also covers configuring mongod to allow remote connections by editing mongod.conf and describes log file locations. Potential problems like a failed socket unlink are addressed with solutions like deleting the socket file.

Uploaded by

manjunath61
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Ref: https://linuxize.

com/post/how-to-install-mongodb-on-centos-7/

MongoDB installation

vim /etc/yum.repos.d/mongodb-org.repo
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

sudo yum install mongodb-org

sudo systemctl start mongod


sudo systemctl enable mongod

Verifying MongoDB Installation


$mongo
db.version()

Output
4.0.1

-----------------------------------------------------------------------------------
---------

config files
/etc/mongod.conf

to allow remote connections


vim /etc/mongod.conf
net:
bindIp: 10.91.0.213

log files
tail -f /var/log/mongodb/mongod.log
-----------------------------------------------------------------------------------
---------

Problem 1:
Failed to unlink socket file /tmp/mongodb-27017.sock

Solution 1:
To fix it, delete the /tmp/mongodb-27017.sock file manually and start the mongod
process. Check the /tmp/mongodb-27017.sock permission again, the ownership is
changed to the ‘mongodb’ user.
rm -rf /tmp/mongodb-27017.sock

You might also like