How to Install MongoDB 5 on Oracle Linux
To Install MongoDB on Oracle Linux
Introduction :
MongoDB is a popular and versatile NoSQL database engine that stores data in JSON format. It comes with a set of cool and nifty features, such as file storage, data replication, Ad-hoc queries, and load balancing, to name just a few. A number of blue-chip companies have integrated MongoDB into their applications including Adobe, Facebook, Google, eBay, and Coinbase.
Installation steps :
Step 1 : Check the version of the OS
[root@linuxhelp ~]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.4"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.4"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:4:server"
Step 2 : Create a repo file for mongodb
[root@linuxhelp ~]# vim /etc/yum.repos.d/mongodb.repo
[mongodb-org-5.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/5.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-5.0.asc
Step 3 : Install mongodb using yum
[root@linuxhelp ~]# yum install mongodb-org
MongoDB Repository 4.9 kB/s | 2.5 kB 00:00
Dependencies resolved.
============================================================================================================================================
Package Architecture Version Repository Size
============================================================================================================================================
Installing:
mongodb-org x86_64 5.0.5-1.el8 mongodb-org-5.0 11 k
Installing dependencies:
mongodb-database-tools x86_64 100.5.1-1 mongodb-org-5.0 47 M
mongodb-mongosh x86_64 1.1.7-1.el7 mongodb-org-5.0 44 M
mongodb-org-database x86_64 5.0.5-1.el8 mongodb-org-5.0 11 k
mongodb-org-database-tools-extra x86_64 5.0.5-1.el8 mongodb-org-5.0 16 k
mongodb-org-mongos x86_64 5.0.5-1.el8 mongodb-org-5.0 19 M
mongodb-org-server x86_64 5.0.5-1.el8 mongodb-org-5.0 28 M
mongodb-org-shell x86_64 5.0.5-1.el8 mongodb-org-5.0 15 M
mongodb-org-tools x86_64 5.0.5-1.el8 mongodb-org-5.0 11 k
Transaction Summary
============================================================================================================================================
Install 9 Packages
Total download size: 153 M
Installed size: 563 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): mongodb-org-5.0.5-1.el8.x86_64.rpm 20 kB/s | 11 kB 00:00
(2/9): mongodb-org-database-5.0.5-1.el8.x86_64.rpm 34 kB/s | 11 kB 00:00
MB 00:07
--------------------------------------------------------------------------------------------------------------------------------------------
Total 19 MB/s | 153 MB 00:07
warning: /var/cache/dnf/mongodb-org-5.0-85529b2afce6c228/packages/mongodb-database-tools-100.5.1.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID e2c63c11: NOKEY
MongoDB Repository 1.5 kB/s | 1.6 kB 00:01
Importing GPG key 0xE2C63C11:
Userid : "MongoDB 5.0 Release Signing Key <packaging@mongodb.com>"
Fingerprint: F567 9A22 2C64 7C87 527C 2F8C B00A 0BD1 E2C6 3C11
From : https://www.mongodb.org/static/pgp/server-5.0.asc
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
_64 7/9
Installing : mongodb-org-tools-5.0.5-1.el8.x86_64
Verifying : mongodb-org-shell-5.0.5-1.el8.x86_64 8/9
Verifying : mongodb-org-tools-5.0.5-1.el8.x86_64 9/9
Installed:
mongodb-database-tools-100.5.1-1.x86_64 mongodb-mongosh-1.1.7-1.el7.x86_64 mongodb-org-5.0.5-1.el8.x86_64
mongodb-org-database-5.0.5-1.el8.x86_64 mongodb-org-database-tools-extra-5.0.5-1.el8.x86_64 mongodb-org-mongos-5.0.5-1.el8.x86_64
mongodb-org-server-5.0.5-1.el8.x86_64 mongodb-org-shell-5.0.5-1.el8.x86_64 mongodb-org-tools-5.0.5-1.el8.x86_64
Complete!
Step 4 : start the mongodb service
[root@linuxhelp ~]# systemctl start mongod.service
Step 5 : Enable the mongodb service
[root@linuxhelp ~]# systemctl enable mongod
Step 6 : check the status of mongodb
[root@linuxhelp ~]# systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2021-12-18 07:41:46 IST; 37s ago
Docs: https://docs.mongodb.org/manual
Main PID: 6193 (mongod)
Memory: 449.0M
CGroup: /system.slice/mongod.service
└─6193 /usr/bin/mongod -f /etc/mongod.conf
Dec 18 07:41:43 linuxhelp systemd[1]: Starting MongoDB Database Server...
Dec 18 07:41:43 linuxhelp mongod[6191]: about to fork child process, waiting until server is ready for connections.
Dec 18 07:41:43 linuxhelp mongod[6191]: forked process: 6193
Dec 18 07:41:46 linuxhelp mongod[6191]: child process started successfully, parent exiting
Dec 18 07:41:46 linuxhelp systemd[1]: Started MongoDB Database Server.
Step 7 : Enter into Mongodb terminal
[root@linuxhelp ~]# mongo
MongoDB shell version v5.0.5
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("4489e52a-f0db-4773-b417-a8c4b7c9932c") }
MongoDB server version: 5.0.5
================
Warning: the "mongo" shell has been superseded by "mongosh",
which delivers improved usability and compatibility.The "mongo" shell has been deprecated and will be removed in
an upcoming release.
For installation instructions, see
https://docs.mongodb.com/mongodb-shell/install/
================
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
https://docs.mongodb.com/
Questions? Try the MongoDB Developer Community Forums
https://community.mongodb.com
---
The server generated these startup warnings when booting:
2021-12-18T07:41:43.922+05:30: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem
2021-12-18T07:41:45.963+05:30: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
2021-12-18T07:41:45.963+05:30: /sys/kernel/mm/transparent_hugepage/enabled is 'always'. We suggest setting it to 'never'
---
---
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).
The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.
To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---
>
With this Installation of MongoDB on Oracle Linux comes to an End.
Comments ( 0 )
No comments available