Install Mongodb Enterprise Edition on Rocky Linux 9

In my first article about Mongodb, we are going to see how to install Mongodb Enterprise Edition on Rocky Linux 9.7.

On operation system, we have 2 disks of 30GB each one. One for operation system and another one for Mongodb database, that we will config later.

This Rocky Linux has just one network interface with IP 192.168.1.221/24, 2 processors and 4GB of RAM.

So, lets resume in a table:

ItemValor
Mongodb Version8.0
Operation System Version Rocky Linux 9.7 ARM64
Processors 2
RAM 4GB
Disk Storage 2x30GB (30GB SO), (30GB Database)
Network 1x Interface Network (IP: 192.168.1.221/24)

As this environment will be for test purposes, lets stop firewall service as well SELinux:

[root@mongodbsrv ~]$ systemctl stop firewalld
[root@mongodbsrv ~]$ systemctl disable firewalld
Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".
Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".
[root@mongodbsrv ~]$ setenforce 0

Set parameter SELINUX as disabled and restart the SO:

[root@mongodbsrv system]$ vim /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# See also:
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/using_selinux/changing-selinux-states-and-modes_using-selinux#changing-selinux-modes-at-boot-time_changing-selinux-states-and-modes
#
# NOTE: Up to RHEL 8 release included, SELINUX=disabled would also
# fully disable SELinux during boot. If you need a system with SELinux
# fully disabled instead of SELinux running with no policy loaded, you
# need to pass selinux=0 to the kernel command line. You can use grubby
# to persistently set the bootloader to boot with selinux=0:
#
#    grubby --update-kernel ALL --args selinux=0
#
# To revert back to SELinux enabled:
#
#    grubby --update-kernel ALL --remove-args selinux
#
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

[root@mongodbsrv system]$ shutdown -r 0

Now, let’s config the disk that will be used to database. First we are going to create a new partition and after that, format in xfs:

[root@mongodbsrv ~]$ fdisk -l
Disk /dev/nvme0n1: 30 GiB, 32212254720 bytes, 62914560 sectors
Disk model: VMware Virtual NVMe Disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 89C08AF9-3314-4BB9-96B3-E34838F6AC03

Device           Start      End  Sectors  Size Type
/dev/nvme0n1p1    2048  1230847  1228800  600M EFI System
/dev/nvme0n1p2 1230848  3327999  2097152    1G Linux filesystem
/dev/nvme0n1p3 3328000 62912511 59584512 28.4G Linux LVM


Disk /dev/nvme0n2: 30 GiB, 32212254720 bytes, 62914560 sectors
Disk model: VMware Virtual NVMe Disk
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/rl_192-root: 25.41 GiB, 27283947520 bytes, 53288960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/rl_192-swap: 3 GiB, 3221225472 bytes, 6291456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@mongodbsrv ~]$ fdisk /dev/nvme0n2

Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x9d3c8976.

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): 

Using default response p.
Partition number (1-4, default 1): 
First sector (2048-62914559, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-62914559, default 62914559): 

Created a new partition 1 of type 'Linux' and of size 30 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
 
[root@mongodbsrv ~]$ mkfs.xfs /dev/nvme0n2p1 
meta-data=/dev/nvme0n2p1         isize=512    agcount=4, agsize=1966016 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=0
data     =                       bsize=4096   blocks=7864064, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=16384, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Lets mount the new disk under /srv directory:

[root@mongodbsrv /]$ mount /dev/nvme0n2p1 /srv
[root@mongodbsrv /]$ df -h
Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 4.0M     0  4.0M   0% /dev
tmpfs                    1.8G     0  1.8G   0% /dev/shm
tmpfs                    716M  8.8M  708M   2% /run
efivarfs                 256K   34K  223K  14% /sys/firmware/efi/efivars
/dev/mapper/rl_192-root   26G  6.0G   20G  24% /
/dev/nvme0n1p2           960M  287M  674M  30% /boot
/dev/nvme0n1p1           599M  7.4M  592M   2% /boot/efi
tmpfs                    358M  4.0K  358M   1% /run/user/0
/dev/nvme0n2p1            30G  247M   30G   1% /srv

Add the new mount point in fstab file to bring up the new disks at startup:

[root@mongodbsrv /]$ vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Mar 22 23:21:29 2026
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rl_192-root /                       xfs     defaults        0 0
UUID=7dd694b0-486e-43fe-9bcb-59d82b972dcc /boot                   xfs     defaults        0 0
UUID=973C-1E14          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
/dev/mapper/rl_192-swap none                    swap    defaults        0 0
/dev/nvme0n2p1 /srv                             xfs     defaults        0 0

Now, we need to create a new repository to download Mongodb and the administrative tools.

[root@mongodbsrv ~]$ vim /etc/yum.repos.d/mongodb-enterprise-8.0.repo
[mongodb-enterprise-8.0]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/9/mongodb-enterprise/8.0/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-8.0.asc

Lets just install, not start Mongodb and Mongodb Shell:

[root@mongodbsrv ~]$ sudo yum remove -y mongodb-mongosh && sudo yum install -y mongodb-mongosh-shared-openssl3
No match for argument: mongodb-mongosh
No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
MongoDB Enterprise Repository                                                                                                                                                                                                                   80 kB/s |  60 kB     00:00    
Rocky Linux 9 - BaseOS                                                                                                                                                                                                                          16 MB/s |  20 MB     00:01    
Rocky Linux 9 - AppStream                                                                                                                                                                                                                      7.5 MB/s |  17 MB     00:02    
Rocky Linux 9 - Extras                                                                                                                                                                                                                          28 kB/s |  17 kB     00:00    
Dependencies resolved.
===============================================================================================================================================================================================================================================================================
 Package                                                                        Architecture                                           Version                                                     Repository                                                             Size
===============================================================================================================================================================================================================================================================================
Installing:
 mongodb-mongosh-shared-openssl3                                                aarch64                                                2.8.1-1.el8                                                 mongodb-enterprise-8.0                                                 63 M

Transaction Summary
===============================================================================================================================================================================================================================================================================
Install  1 Package

Total download size: 63 M
Installed size: 292 M
Downloading Packages:
mongodb-mongosh-shared-openssl3-2.8.1.aarch64.rpm                                                                                                                                                                                               21 MB/s |  63 MB     00:03    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                           21 MB/s |  63 MB     00:03     
MongoDB Enterprise Repository                                                                                                                                                                                                                  2.8 kB/s | 1.6 kB     00:00    
Importing GPG key 0x4E7DCA05:
 Userid     : "MongoDB 8.0 Release Signing Key <packaging@mongodb.com>"
 Fingerprint: 4B07 52C1 BCA2 38C0 B4EE 14DC 41DE 058A 4E7D CA05
 From       : https://pgp.mongodb.com/server-8.0.asc
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                                                       1/1 
  Installing       : mongodb-mongosh-shared-openssl3-2.8.1-1.el8.aarch64                                                                                                                                                                                                   1/1 
  Running scriptlet: mongodb-mongosh-shared-openssl3-2.8.1-1.el8.aarch64                                                                                                                                                                                                   1/1 
  Verifying        : mongodb-mongosh-shared-openssl3-2.8.1-1.el8.aarch64                                                                                                                                                                                                   1/1 

Installed:
  mongodb-mongosh-shared-openssl3-2.8.1-1.el8.aarch64                                                                                                                                                                                                                          

Complete!

[root@mongodbsrv ~]$ sudo yum install -y mongodb-enterprise
Last metadata expiration check: 0:00:41 ago on Sun 22 Mar 2026 08:29:37 PM -03.
Dependencies resolved.
===============================================================================================================================================================================================================================================================================
 Package                                                                             Architecture                                        Version                                                      Repository                                                          Size
===============================================================================================================================================================================================================================================================================
Installing:
 mongodb-enterprise                                                                  aarch64                                             8.0.20-1.el9                                                 mongodb-enterprise-8.0                                             9.3 k
Installing dependencies:
 cyrus-sasl                                                                          aarch64                                             2.1.27-21.el9                                                baseos                                                              72 k
 mongodb-database-tools                                                              aarch64                                             100.15.0-1                                                   mongodb-enterprise-8.0                                              29 M
 mongodb-enterprise-cryptd                                                           aarch64                                             8.0.20-1.el9                                                 mongodb-enterprise-8.0                                              26 M
 mongodb-enterprise-database                                                         aarch64                                             8.0.20-1.el9                                                 mongodb-enterprise-8.0                                             9.5 k
 mongodb-enterprise-database-tools-extra                                             aarch64                                             8.0.20-1.el9                                                 mongodb-enterprise-8.0                                              33 M
 mongodb-enterprise-mongos                                                           aarch64                                             8.0.20-1.el9                                                 mongodb-enterprise-8.0                                              29 M
 mongodb-enterprise-server                                                           aarch64                                             8.0.20-1.el9                                                 mongodb-enterprise-8.0                                              39 M
 mongodb-enterprise-tools                                                            aarch64                                             8.0.20-1.el9                                                 mongodb-enterprise-8.0                                             9.2 k

Transaction Summary
===============================================================================================================================================================================================================================================================================
Install  9 Packages

Total download size: 157 M
Installed size: 744 M
Downloading Packages:
(1/9): mongodb-enterprise-8.0.20-1.el9.aarch64.rpm                                                                                                                                                                                              25 kB/s | 9.3 kB     00:00    
(2/9): mongodb-enterprise-database-8.0.20-1.el9.aarch64.rpm                                                                                                                                                                                     17 kB/s | 9.5 kB     00:00    
(3/9): mongodb-enterprise-cryptd-8.0.20-1.el9.aarch64.rpm                                                                                                                                                                                       16 MB/s |  26 MB     00:01    
(4/9): mongodb-database-tools-100.15.0-1.aarch64.rpm                                                                                                                                                                                           7.7 MB/s |  29 MB     00:03    
(5/9): mongodb-enterprise-database-tools-extra-8.0.20-1.el9.aarch64.rpm                                                                                                                                                                        8.9 MB/s |  33 MB     00:03    
(6/9): mongodb-enterprise-mongos-8.0.20-1.el9.aarch64.rpm                                                                                                                                                                                      9.5 MB/s |  29 MB     00:03    
(7/9): cyrus-sasl-2.1.27-21.el9.aarch64.rpm                                                                                                                                                                                                    323 kB/s |  72 kB     00:00    
(8/9): mongodb-enterprise-tools-8.0.20-1.el9.aarch64.rpm                                                                                                                                                                                        19 kB/s | 9.2 kB     00:00    
(9/9): mongodb-enterprise-server-8.0.20-1.el9.aarch64.rpm                                                                                                                                                                                       21 MB/s |  39 MB     00:01    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                           26 MB/s | 157 MB     00:06     
Rocky Linux 9 - BaseOS                                                                                                                                                                                                                         1.7 MB/s | 1.7 kB     00:00    
Importing GPG key 0x350D275D:
 Userid     : "Rocky Enterprise Software Foundation - Release key 2022 <releng@rockylinux.org>"
 Fingerprint: 21CB 256A E16F C54C 6E65 2949 702D 426D 350D 275D
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                                                       1/1 
  Running scriptlet: cyrus-sasl-2.1.27-21.el9.aarch64                                                                                                                                                                                                                      1/9 
  Installing       : cyrus-sasl-2.1.27-21.el9.aarch64                                                                                                                                                                                                                      1/9 
  Running scriptlet: cyrus-sasl-2.1.27-21.el9.aarch64                                                                                                                                                                                                                      1/9 
  Installing       : mongodb-enterprise-database-tools-extra-8.0.20-1.el9.aarch64                                                                                                                                                                                          2/9 
  Installing       : mongodb-enterprise-cryptd-8.0.20-1.el9.aarch64                                                                                                                                                                                                        3/9 
  Running scriptlet: mongodb-enterprise-server-8.0.20-1.el9.aarch64                                                                                                                                                                                                        4/9 
  Installing       : mongodb-enterprise-server-8.0.20-1.el9.aarch64                                                                                                                                                                                                        4/9 
  Running scriptlet: mongodb-enterprise-server-8.0.20-1.el9.aarch64                                                                                                                                                                                                        4/9 
Created symlink /etc/systemd/system/multi-user.target.wants/mongod.service → /usr/lib/systemd/system/mongod.service.

  Installing       : mongodb-enterprise-mongos-8.0.20-1.el9.aarch64                                                                                                                                                                                                        5/9 
  Installing       : mongodb-enterprise-database-8.0.20-1.el9.aarch64                                                                                                                                                                                                      6/9 
  Running scriptlet: mongodb-database-tools-100.15.0-1.aarch64                                                                                                                                                                                                             7/9 
  Installing       : mongodb-database-tools-100.15.0-1.aarch64                                                                                                                                                                                                             7/9 
  Running scriptlet: mongodb-database-tools-100.15.0-1.aarch64                                                                                                                                                                                                             7/9 
  Installing       : mongodb-enterprise-tools-8.0.20-1.el9.aarch64                                                                                                                                                                                                         8/9 
  Installing       : mongodb-enterprise-8.0.20-1.el9.aarch64                                                                                                                                                                                                               9/9 
  Running scriptlet: mongodb-enterprise-8.0.20-1.el9.aarch64                                                                                                                                                                                                               9/9 
  Verifying        : mongodb-database-tools-100.15.0-1.aarch64                                                                                                                                                                                                             1/9 
  Verifying        : mongodb-enterprise-8.0.20-1.el9.aarch64                                                                                                                                                                                                               2/9 
  Verifying        : mongodb-enterprise-cryptd-8.0.20-1.el9.aarch64                                                                                                                                                                                                        3/9 
  Verifying        : mongodb-enterprise-database-8.0.20-1.el9.aarch64                                                                                                                                                                                                      4/9 
  Verifying        : mongodb-enterprise-database-tools-extra-8.0.20-1.el9.aarch64                                                                                                                                                                                          5/9 
  Verifying        : mongodb-enterprise-mongos-8.0.20-1.el9.aarch64                                                                                                                                                                                                        6/9 
  Verifying        : mongodb-enterprise-server-8.0.20-1.el9.aarch64                                                                                                                                                                                                        7/9 
  Verifying        : mongodb-enterprise-tools-8.0.20-1.el9.aarch64                                                                                                                                                                                                         8/9 
  Verifying        : cyrus-sasl-2.1.27-21.el9.aarch64                                                                                                                                                                                                                      9/9 

Installed:
  cyrus-sasl-2.1.27-21.el9.aarch64                                mongodb-database-tools-100.15.0-1.aarch64         mongodb-enterprise-8.0.20-1.el9.aarch64           mongodb-enterprise-cryptd-8.0.20-1.el9.aarch64    mongodb-enterprise-database-8.0.20-1.el9.aarch64   
  mongodb-enterprise-database-tools-extra-8.0.20-1.el9.aarch64    mongodb-enterprise-mongos-8.0.20-1.el9.aarch64    mongodb-enterprise-server-8.0.20-1.el9.aarch64    mongodb-enterprise-tools-8.0.20-1.el9.aarch64    

Complete!

And that’s it for now. Next article we will create a Cluster Replicat Set for development purposes.


Deixe um comentário