Installation Steps
Install MongoDB v4.0.10 Community Edition :-
- Configure the package management system (
yum) :-
Create a
/etc/yum.repos.d/mongodb-org-4.0.repo file so that you can install MongoDB directly using yum. $ Sudo vi /etc/yum.repos.d/mongodb-org-4.0.repo [mongodb-org-4.0] |
|---|
Install the MongoDB packages:-
$ sudo yum install -y mongodb-org- Directory Paths :-
By default, MongoDB runs using the
mongod user account and uses the following default directories: /var/lib/mongo (the data directory) /var/log/mongodb (the log directory)- Configuration :-
Update the below on /etc/mongod.conf file.
| # network interfaces
net:
port: 27017 bindIp: 0.0.0.0
#Authentication
security:
authorization: enabled |
|---|
- Start MongoDB :-
$ sudo service mongod start
- Connect MongoDB :-
$ mongo
No comments:
Post a Comment