Issue encountered and fix - Installing MongoDB on Redhat 7.x via yum

This is the version of redhat I am running

[root@msdlva-dsnops03 ~]# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 7.3 (Maipo)
Release:        7.3
Codename:       Maipo


To start, we need to configure mongodb-enterprise repo

https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-red-hat/

This is the repo I used

[root@msdlva-dsnops03 ~]# vi /etc/yum.repos.d/mongodb-enterprise.repo
[mongodb-enterprise]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/3.4/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
[root@msdlva-dsnops03 ~]# yum repolist

to verify the the repo can be conneccted 
[root@msdlva-dsnops03 ~]# yum repolist
Loaded plugins: langpacks, product-id, rhnplugin, search-disabled-repos, subscription-manager
This system is receiving updates from RHN Classic or Red Hat Satellite.
mongodbenterprise                                                                                                | 2.5 kB  00:00:00
mongodbenterprise/7Server/x86_64/primary_db                                                                      |  37 kB  00:00:00
rhel-x86_64-server-7-rhscl-1                                                                                     | 1.3 kB  00:00:00
rhel-x86_64-server-extras-7                                                                                      | 1.3 kB  00:00:00
repo id                                                   repo name                                                               status
dockerrepo                                                Docker Repository                                                          110
mongodbenterprise/7Server/x86_64                          MongoDB Enterprise Repository                                               35
rhel-x86_64-server-7                                      Red Hat Enterprise Linux Server (v. 7 for 64-bit x86_64)                14,619
rhel-x86_64-server-7-rhscl-1                              Red Hat Software Collections (RHEL 7 Server x86_64)                      8,044
rhel-x86_64-server-7-thirdparty-oracle-java               Oracle Java for RHEL Server (v. 7 64-bit x86_64)                           306
rhel-x86_64-server-extras-7                               RHEL Server Extras (v. 7 for 64-bit x86_64)                                536
rhel-x86_64-server-optional-7                             RHEL Server Optional (v. 7 64-bit x86_64)                               11,098
rhel-x86_64-server-supplementary-7                        RHEL Server Supplementary (v. 7 for 64-bit x86_64)                         204
repolist: 34,952
We can see mongodbenterprise repo now and we need to make sure the status is not 0. 

Next we run 

[root@msdlva-dsnops03 ~]# yum install mongodb-enterprise

[root@msdlva-dsnops03 ~]# yum install mongodb-enterprise
Loaded plugins: langpacks, product-id, rhnplugin, search-disabled-repos, subscription-manager
This system is receiving updates from RHN Classic or Red Hat Satellite.
Resolving Dependencies
--> Running transaction check
---> Package mongodb-enterprise.x86_64 0:3.4.6-1.el7 will be installed
--> Processing Dependency: mongodb-enterprise-tools = 3.4.6 for package: mongodb-enterprise-3.4.6-1.el7.x86_64
--> Processing Dependency: mongodb-enterprise-shell = 3.4.6 for package: mongodb-enterprise-3.4.6-1.el7.x86_64
--> Processing Dependency: mongodb-enterprise-server = 3.4.6 for package: mongodb-enterprise-3.4.6-1.el7.x86_64
--> Processing Dependency: mongodb-enterprise-mongos = 3.4.6 for package: mongodb-enterprise-3.4.6-1.el7.x86_64
--> Running transaction check
---> Package mongodb-enterprise-mongos.x86_64 0:3.4.6-1.el7 will be installed
---> Package mongodb-enterprise-server.x86_64 0:3.4.6-1.el7 will be installed
--> Processing Dependency: net-snmp for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
--> Processing Dependency: cyrus-sasl for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
--> Processing Dependency: libnetsnmpmibs.so.31()(64bit) for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
--> Processing Dependency: libnetsnmpagent.so.31()(64bit) for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
--> Processing Dependency: libnetsnmp.so.31()(64bit) for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
---> Package mongodb-enterprise-shell.x86_64 0:3.4.6-1.el7 will be installed
---> Package mongodb-enterprise-tools.x86_64 0:3.4.6-1.el7 will be installed
--> Running transaction check
---> Package cyrus-sasl.x86_64 0:2.1.26-20.el7_2 will be installed
---> Package net-snmp.x86_64 1:5.7.2-24.el7_3.2 will be installed
---> Package net-snmp-agent-libs.x86_64 1:5.7.2-24.el7_3.2 will be installed
---> Package net-snmp-libs.x86_64 1:5.7.2-24.el7_3.2 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================
 Package                                 Arch                 Version                          Repository                          Size
========================================================================================================================================
Installing:
 mongodb-enterprise                      x86_64               3.4.6-1.el7                      mongodbenterprise                  5.9 k
Installing for dependencies:
 cyrus-sasl                              x86_64               2.1.26-20.el7_2                  rhel-x86_64-server-7                88 k
 mongodb-enterprise-mongos               x86_64               3.4.6-1.el7                      mongodbenterprise                   12 M
 mongodb-enterprise-server               x86_64               3.4.6-1.el7                      mongodbenterprise                   20 M
 mongodb-enterprise-shell                x86_64               3.4.6-1.el7                      mongodbenterprise                   12 M
 mongodb-enterprise-tools                x86_64               3.4.6-1.el7                      mongodbenterprise                   61 M
 net-snmp                                x86_64               1:5.7.2-24.el7_3.2               rhel-x86_64-server-7               321 k
 net-snmp-agent-libs                     x86_64               1:5.7.2-24.el7_3.2               rhel-x86_64-server-7               703 k
 net-snmp-libs                           x86_64               1:5.7.2-24.el7_3.2               rhel-x86_64-server-7               747 k
Transaction Summary
========================================================================================================================================
Install  1 Package (+8 Dependent packages)
Total download size: 107 M
Installed size: 294 M
Is this ok [y/d/N]: y
Downloading packages:
(1/9): cyrus-sasl-2.1.26-20.el7_2.x86_64.rpm                                                                     |  88 kB  00:00:00
(7/9): net-snmp-5.7.2-24.el7_3.2.x86_64.rpm                                                                      | 321 kB  00:00:00
(8/9): net-snmp-agent-libs-5.7.2-24.el7_3.2.x86_64.rpm                                                           | 703 kB  00:00:00
(9/9): net-snmp-libs-5.7.2-24.el7_3.2.x86_64.rpm                                                                 | 747 kB  00:00:00
warning: /var/cache/yum/x86_64/7Server/mongodbenterprise/packages/mongodb-enterprise-3.4.6-1.el7.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID a15703c6: NOKEY
Public key for mongodb-enterprise-3.4.6-1.el7.x86_64.rpm is not installed
(1/5): mongodb-enterprise-3.4.6-1.el7.x86_64.rpm                                                                 | 5.9 kB  00:00:00
(2/5): mongodb-enterprise-mongos-3.4.6-1.el7.x86_64.rpm                                                          |  12 MB  00:00:01
(3/5): mongodb-enterprise-server-3.4.6-1.el7.x86_64.rpm                                                          |  20 MB  00:00:01
(4/5): mongodb-enterprise-shell-3.4.6-1.el7.x86_64.rpm                                                           |  12 MB  00:00:01
(5/5): mongodb-enterprise-tools-3.4.6-1.el7.x86_64.rpm                                                           |  61 MB  00:00:04
----------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                    14 MB/s | 107 MB  00:00:07
Retrieving key from https://www.mongodb.org/static/pgp/server-3.4.asc
GPG key retrieval failed: [Errno 14] curl#22 - "The requested URL returned error: 407"
The installation failed, what's happening here is that yum was unable to verify the signature of the package being download. 
The workaround is to change gpgcheck to zero. 

[root@msdlva-dsnops03 ~]# vi /etc/yum.repos.d/mongodb-enterprise.repo

[mongodb-enterprise]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/3.4/$basearch/
gpgcheck=0
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
run yum install again

[root@msdlva-dsnops03 ~]# yum install mongodb-enterprise


[root@msdlva-dsnops03 ~]# yum install mongodb-enterprise
Loaded plugins: langpacks, product-id, rhnplugin, search-disabled-repos, subscription-manager
This system is receiving updates from RHN Classic or Red Hat Satellite.
mongodbenterprise                                                                                                | 2.5 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package mongodb-enterprise.x86_64 0:3.4.6-1.el7 will be installed
--> Processing Dependency: mongodb-enterprise-tools = 3.4.6 for package: mongodb-enterprise-3.4.6-1.el7.x86_64
--> Processing Dependency: mongodb-enterprise-shell = 3.4.6 for package: mongodb-enterprise-3.4.6-1.el7.x86_64
--> Processing Dependency: mongodb-enterprise-server = 3.4.6 for package: mongodb-enterprise-3.4.6-1.el7.x86_64
--> Processing Dependency: mongodb-enterprise-mongos = 3.4.6 for package: mongodb-enterprise-3.4.6-1.el7.x86_64
--> Running transaction check
---> Package mongodb-enterprise-mongos.x86_64 0:3.4.6-1.el7 will be installed
---> Package mongodb-enterprise-server.x86_64 0:3.4.6-1.el7 will be installed
--> Processing Dependency: net-snmp for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
--> Processing Dependency: cyrus-sasl for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
--> Processing Dependency: libnetsnmpmibs.so.31()(64bit) for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
--> Processing Dependency: libnetsnmpagent.so.31()(64bit) for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
--> Processing Dependency: libnetsnmp.so.31()(64bit) for package: mongodb-enterprise-server-3.4.6-1.el7.x86_64
---> Package mongodb-enterprise-shell.x86_64 0:3.4.6-1.el7 will be installed
---> Package mongodb-enterprise-tools.x86_64 0:3.4.6-1.el7 will be installed
--> Running transaction check
---> Package cyrus-sasl.x86_64 0:2.1.26-20.el7_2 will be installed
---> Package net-snmp.x86_64 1:5.7.2-24.el7_3.2 will be installed
---> Package net-snmp-agent-libs.x86_64 1:5.7.2-24.el7_3.2 will be installed
---> Package net-snmp-libs.x86_64 1:5.7.2-24.el7_3.2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================
 Package                                 Arch                 Version                          Repository                          Size
========================================================================================================================================
Installing:
 mongodb-enterprise                      x86_64               3.4.6-1.el7                      mongodbenterprise                  5.9 k
Installing for dependencies:
 cyrus-sasl                              x86_64               2.1.26-20.el7_2                  rhel-x86_64-server-7                88 k
 mongodb-enterprise-mongos               x86_64               3.4.6-1.el7                      mongodbenterprise                   12 M
 mongodb-enterprise-server               x86_64               3.4.6-1.el7                      mongodbenterprise                   20 M
 mongodb-enterprise-shell                x86_64               3.4.6-1.el7                      mongodbenterprise                   12 M
 mongodb-enterprise-tools                x86_64               3.4.6-1.el7                      mongodbenterprise                   61 M
 net-snmp                                x86_64               1:5.7.2-24.el7_3.2               rhel-x86_64-server-7               321 k
 net-snmp-agent-libs                     x86_64               1:5.7.2-24.el7_3.2               rhel-x86_64-server-7               703 k
 net-snmp-libs                           x86_64               1:5.7.2-24.el7_3.2               rhel-x86_64-server-7               747 k

Transaction Summary
========================================================================================================================================
Install  1 Package (+8 Dependent packages)

Total size: 107 M
Installed size: 294 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : cyrus-sasl-2.1.26-20.el7_2.x86_64                                                                                    1/9
  Installing : 1:net-snmp-libs-5.7.2-24.el7_3.2.x86_64                                                                              2/9
  Installing : 1:net-snmp-agent-libs-5.7.2-24.el7_3.2.x86_64                                                                        3/9
  Installing : 1:net-snmp-5.7.2-24.el7_3.2.x86_64                                                                                   4/9
  Installing : mongodb-enterprise-server-3.4.6-1.el7.x86_64                                                                         5/9
Created symlink from /etc/systemd/system/multi-user.target.wants/mongod.service to /usr/lib/systemd/system/mongod.service.
  Installing : mongodb-enterprise-tools-3.4.6-1.el7.x86_64                                                                          6/9
  Installing : mongodb-enterprise-shell-3.4.6-1.el7.x86_64                                                                          7/9
  Installing : mongodb-enterprise-mongos-3.4.6-1.el7.x86_64                                                                         8/9
  Installing : mongodb-enterprise-3.4.6-1.el7.x86_64                                                                                9/9
  Verifying  : mongodb-enterprise-server-3.4.6-1.el7.x86_64                                                                         1/9
  Verifying  : 1:net-snmp-agent-libs-5.7.2-24.el7_3.2.x86_64                                                                        2/9
  Verifying  : 1:net-snmp-libs-5.7.2-24.el7_3.2.x86_64                                                                              3/9
  Verifying  : cyrus-sasl-2.1.26-20.el7_2.x86_64                                                                                    4/9
  Verifying  : 1:net-snmp-5.7.2-24.el7_3.2.x86_64                                                                                   5/9
  Verifying  : mongodb-enterprise-3.4.6-1.el7.x86_64                                                                                6/9
  Verifying  : mongodb-enterprise-tools-3.4.6-1.el7.x86_64                                                                          7/9
  Verifying  : mongodb-enterprise-mongos-3.4.6-1.el7.x86_64                                                                         8/9
  Verifying  : mongodb-enterprise-shell-3.4.6-1.el7.x86_64                                                                          9/9

Installed:
  mongodb-enterprise.x86_64 0:3.4.6-1.el7

Dependency Installed:
  cyrus-sasl.x86_64 0:2.1.26-20.el7_2                                mongodb-enterprise-mongos.x86_64 0:3.4.6-1.el7
  mongodb-enterprise-server.x86_64 0:3.4.6-1.el7                     mongodb-enterprise-shell.x86_64 0:3.4.6-1.el7
  mongodb-enterprise-tools.x86_64 0:3.4.6-1.el7                      net-snmp.x86_64 1:5.7.2-24.el7_3.2
  net-snmp-agent-libs.x86_64 1:5.7.2-24.el7_3.2                      net-snmp-libs.x86_64 1:5.7.2-24.el7_3.2

Complete!

Now verify my mongodb installation

[root@msdlva-dsnops03 ~]# which mongod
/bin/mongod
[root@msdlva-dsnops03 ~]# mongod --port 11111 --dbpath /apps/sample/ --logpath /apps/sample/s.log --fork
about to fork child process, waiting until server is ready for connections.
forked process: 505
child process started successfully, parent exiting
[root@msdlva-dsnops03 ~]# mongo --port 11111
MongoDB shell version v3.4.6
connecting to: mongodb://127.0.0.1:11111/
MongoDB server version: 3.4.6
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
Server has startup warnings:
2017-07-28T10:40:13.848-0400 I CONTROL  [initandlisten]
2017-07-28T10:40:13.848-0400 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-07-28T10:40:13.848-0400 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2017-07-28T10:40:13.848-0400 I CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2017-07-28T10:40:13.848-0400 I CONTROL  [initandlisten]
2017-07-28T10:40:13.911-0400 I CONTROL  [initandlisten]
2017-07-28T10:40:13.911-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2017-07-28T10:40:13.911-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-07-28T10:40:13.911-0400 I CONTROL  [initandlisten]
2017-07-28T10:40:13.911-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2017-07-28T10:40:13.911-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2017-07-28T10:40:13.911-0400 I CONTROL  [initandlisten]
MongoDB Enterprise >
Enjoy!

Comments

Popular posts from this blog

MongoDB Tips: Kill long running processes

Oracle Goldengate Extract, Pump, and Replicat

MongoDB Ops Manager Basic Installation and Configuration