Install MongoDB 5.0.0 On Linux 8 Using Binaries
Install MongoDB 5.0.0 On Linux 8 Using Binaries
2 using binary
In this QuickStart, we learn how to:
Section A: Prerequisite
• Install net-snmp package
• Create mongo user
• create necessary directories required for mongoDB configuration
• copy archive on Linux server
• set bash Profile
Section B: mongoDB configuration
• create the key-file and set permissions
• create config file for mongoDB instance
• Start mongoDB instance
• Connect mongoDB database
Application
Drivers
primary
Fig: Below figure showing system and directory information need to install mongoDB 4.4 on Linux.
export PATH=/u01/app/mongo/product/5.0.0/bin:$PATH
export MONGO_HOME=/u01/app/mongo/product/5.0.0/bin
Note: you can connect to mongo shell using mongo -nodb command without mongoDB configuration
• create config file for dev1 mongoDB instance. In this example I have created separate
config directory to store mongoDB instance configuration file.
[mongodb@mongo config]$ pwd
/u01/app/mongo/config
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /u01/app/mongo/data/mongod.log
# Where and how to store data.
storage:
dbPath: /u01/app/mongo/data
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /u01/app/mongo/data/mongod.pid # location of pidfile
# network interfaces
net:
port: 27017
bindIp: localhost,mongo.example.com # Listen to local interface
only, comment to listen on all interfaces.
security:
authorization: enabled
keyFile: /u01/app/mongo/pkey/dev1-key
#security:
#operationProfiling:
#replication:
INFORMATION: If Security parameter is enabled in configuration file, then create admin user after first
login. We will discuss more about the user creation in mongoDB operation and mongoDB Security
section.