Thursday, 17 September 2020

install mongoDB enterprise 4.4.0 on LVM storage

 

In this QuickStart, we learn how to:

  • Create LVM storage.
  • Download mongoDB 4.4.0 software and unzip
  • Install net-snmp package
  • create user and directory structure
  • Copy binary to mongo home
  • Set variable for mongoDB in Bash profile
  • Create config file for mongoDB instance
  • Start mongo daemon using config file
  • Validation

1] Create LVM storage.

 

·         list existing partition

 

[root@lvm_node ~]# fdisk -l


·         create new partition for LVM Disk Group

 

-          Enter P to display the existing Partitions 

-          Create New partition of 10GB size


-          Change the partition to LVM system


-          Use partprobe command to change the partition table




-          Move newly created disk to lvm PV



-          create the volume group


-          create lvm on volume group 




-          Format the LVM file system to use




                   -      Mount LVM file system to directory 


                     -        Made the changes in /etc/fstab to permanent changes




2] Download mongoDB 4.4.0 software and unzip

https://www.mongodb.com/try/download/enterprise



[mongo@lvm_node tmp]$ pwd

/tmp

[mongo@lvm_node tmp]$

[mongo@lvm_node ~]$ cd /tmp

[mongo@lvm_node tmp]$ ls -ltr

total 128900

-rw-rw-r--. 1 mongo mongo 131986084 Aug 22 15:40 mongodb-linux-x86_64-enterprise-rhel70-4.4.0.tgz

-rw-------. 1 root  root          0 Aug 25 21:16 yum.log

-rwx------. 1 root  root        836 Aug 25 21:30 ks-script-9cUA9D

 

[mongo@lvm_node tmp]$ tar -xvzf mongodb-linux-x86_64-enterprise-rhel70-4.4.0.tgz

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/LICENSE-Enterprise.txt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/MPL-2

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/README

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/THIRD-PARTY-NOTICES

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/install_compass

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongo

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongocryptd

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongod

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongodecrypt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongokerberos

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongoldap

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/bin/mongos

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/MONGOD-MIB.txt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/MONGODBINC-MIB.txt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/README-snmp.txt

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/mongod.conf.master

mongodb-linux-x86_64-enterprise-rhel70-4.4.0/snmp/mongod.conf.subagent

3] Install net-snmp package

[root@lvm_node ~]# yum install net-snmp*

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirrors.raystedman.org

 * extras: distro.ibiblio.org

 * updates: mirror.cs.uwp.edu

base                                                                                                                                               | 3.6 kB  00:00:00

extras                                                                                                                                             | 2.9 kB  00:00:00

updates                                                                                                                                            | 2.9 kB  00:00:00

Resolving Dependencies

--> Running transaction check

---> Package net-snmp.x86_64 1:5.7.2-48.el7_8.1 will be installed

--> Processing Dependency: libsensors.so.4()(64bit) for package: 1:net-snmp-5.7.2-48.el7_8.1.x86_64

---> Package net-snmp-agent-libs.x86_64 1:5.7.2-48.el7_8.1 will be installed

-

-

-

-

-

-

Dependency Updated:

  e2fsprogs.x86_64 0:1.42.9-17.el7        e2fsprogs-libs.x86_64 0:1.42.9-17.el7      elfutils.x86_64 0:0.176-4.el7              elfutils-libelf.x86_64 0:0.176-4.el7

  elfutils-libs.x86_64 0:0.176-4.el7      krb5-libs.x86_64 0:1.15.1-46.el7           libcom_err.x86_64 0:1.42.9-17.el7          libdb.x86_64 0:5.3.21-25.el7

  libdb-utils.x86_64 0:5.3.21-25.el7      libselinux.x86_64 0:2.5-15.el7             libselinux-python.x86_64 0:2.5-15.el7      libselinux-utils.x86_64 0:2.5-15.el7

  libss.x86_64 0:1.42.9-17.el7            openssl.x86_64 1:1.0.2k-19.el7             openssl-libs.x86_64 1:1.0.2k-19.el7        rpm.x86_64 0:4.11.3-43.el7

  rpm-build.x86_64 0:4.11.3-43.el7        rpm-build-libs.x86_64 0:4.11.3-43.el7      rpm-libs.x86_64 0:4.11.3-43.el7            rpm-python.x86_64 0:4.11.3-43.el7

  rpm-sign.x86_64 0:4.11.3-43.el7

 

Complete!

[root@lvm_node ~]#

 

4] create user and directory structure

[root@lvm_node ~]# adduser mongo

[root@lvm_node ~]# passwd mongo

Changing password for user mongo.

New password:

BAD PASSWORD: The password is shorter than 8 characters

Retype new password:

passwd: all authentication tokens updated successfully.

[root@lvm_node ~]#

[root@lvm_node ~]# chown mongo:mongo /u01/app

[root@lvm_node ~]# chmod 775 /u01/app

[root@lvm_node ~]#

[root@lvm_node ~]# su - mongo

Last login: Sat Aug 29 17:29:23 EDT 2020 on pts/0

[mongo@lvm_node ~]$

[mongo@lvm_node ~]$ mkdir -p /u01/app/mongo/product

[mongo@lvm_node 4.4.0]$

[mongo@lvm_node 4.4.0]$ mkdir -p /u01/app/mongo/etc

[mongo@lvm_node 4.4.0]$ mkdir -p /u01/app/mongo/data

[mongo@lvm_node 4.4.0]$ mkdir -p /u01/app/mongo/log

[mongo@lvm_node 4.4.0]$

 

5] Copy binary to mongo home 

[mongo@lvm_node tmp]$ mv mongodb-linux-x86_64-enterprise-rhel70-4.4.0 /u01/app/mongo/product/

[mongo@lvm_node tmp]$ cd /u01/app/mongo/product/

[mongo@lvm_node product]$ ls -ltr

total 4

drwxrwxr-x. 4 mongo mongo 4096 Aug 29 17:36 mongodb-linux-x86_64-enterprise-rhel70-4.4.0

[mongo@lvm_node product]$ mv mongodb-linux-x86_64-enterprise-rhel70-4.4.0 4.4.0

[mongo@lvm_node product]$ cd 4.4.0

[mongo@lvm_node 4.4.0]$ pwd

/u01/app/mongo/product/4.4.0

[mongo@lvm_node 4.4.0]$

6] Set variable for mongoDB in Bash profile 




7]  Create config file for mongoDB instance

[mongo@lvm_node 4.4.0]$ cd /u01/app/mongo/etc/

[mongo@lvm_node etc]$ pwd

/u01/app/mongo/etc

[mongo@lvm_node etc]$ vi mongoDB.conf

[mongo@lvm_node etc]$ cat mongoDB.conf

# 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/log/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  # Listen to local interface only, comment to listen on all interfaces.

security:

 authorization: enabled

 keyFile: /u01/app/mongo/pkey/dev1-key

#security:

#operationProfiling:

#replication:


8] Start mongo daemon using config file


[mongo@lvm_node etc]$ pwd

/u01/app/mongo/etc

[mongo@lvm_node etc]$ ls -ltr

total 4

-rw-rw-r--. 1 mongo mongo 783 Aug 29 18:40 mongoDB.conf

[mongo@lvm_node etc]$ mongod -f /u01/app/mongo/etc/mongoDB.conf

about to fork child process, waiting until server is ready for connections.

forked process: 16097

child process started successfully, parent exiting

[mongod@localhost ~]$

9] validation

[mongo@lvm_node etc]$ mongo

MongoDB shell version v4.4.0

connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb

Implicit session: session { "id" : UUID("fcec5d01-62d1-40e2-9d38-a12e8d6529b0") }

MongoDB server version: 4.4.0

MongoDB Enterprise > db.version()

4.4.0

MongoDB Enterprise >


2 comments:

  1. I have done all the steps above on RH8.5 with mongo 4.4.13.
    Of course I have changed the info from 4.4.0 to 4.4.13, however if i try to start mongod I do get the info the mongod is unkown. Any hint is welcome.

    ReplyDelete

work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...