Mongodb v4.0 .2 installation on RHEL 7.1

78 views
Skip to first unread message

Raymond Chow

unread,
Oct 9, 2018, 9:29:34 PM10/9/18
to mongodb-user
I have been trying to install the community version 4.0.2 on RHEL 7.1. The instruction is vague and I hope someone might be able to give me a hand or two...  )).

Below is the error message-

# mongo

MongoDB shell version v4.0.2

connecting to: mongodb://127.0.0.1:27017

2018-10-09T17:45:04.619-0500 E QUERY    [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused :

connect@src/mongo/shell/mongo.js:257:13

@(connect):1:6

exception: connect failed


# semanage port -a -t mongod_port_t -p tcp 27017

ValueError: Port tcp/27017 already defined


# service mongod start

Redirecting to /bin/systemctl start  mongod.service

Failed to issue method call: Unit mongod.service failed to load: No such file or directory.


systemctl start  mongod.service

Failed to issue method call: Unit mongod.service failed to load: No such file or directory.


# ls -ld /var/lib/mongo

ls: cannot access /var/lib/mongo: No such file or directory


# ls -ld /var/log/mongo

ls: cannot access /var/log/mongo: No such file or directory


# mongo --version

MongoDB shell version v4.0.2

git version: fc1573ba18aee42f97a3bb13b67af7d837826b47

OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013

allocator: tcmalloc

modules: none

build environment:

    distmod: rhel70

    distarch: x86_64

    target_arch: x86_64

----------------------------------

I removed it by following the uninstall instruction. When I re-install agaiin I get the following error:


]$ sudo yum install -y mongodb-org

Loaded plugins: langpacks

mongodb-org-4.0    

No package mongodb-org available.

Error: Nothing to do


This is the script:

$ cat mongod-org-4.0.repo 

[mongodb-org-4.0]

name=MongoDB Repository

baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/

gpgcheck=1

enabled=1

gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

------------------------------------


How do I start troubleshooting? I have check /etc/var, there is no mongo directory. I can't even find the mongod.conf file. 



Any help to geet this up wouold be most appreciated.


Best,
Ray




Matt Lord

unread,
Oct 10, 2018, 11:56:47 AM10/10/18
to mongodb-user
Hi Raymond,

It looks like the mongodb-org-server package did not get installed as the repo is not setup correctly. Is your mongod-org-4.0.repo file in /etc/yum.repos.d/ ?

Do you see the repo listed as enabled in the output of: 
yum repolist all 

Best Regards,

Matt

Raymond Chow

unread,
Oct 10, 2018, 1:08:41 PM10/10/18
to mongod...@googlegroups.com
Thanks Matt,

I look into the repo file and ran it one after another to see where it was failing. I got to the point where yum started to pull the packages. That is where it fails. Henceforth, I manually downloaded all the packages and use the rpm to install each package.

It is currently up and running. I was able to see the log files.

Thanks for the hint. It helps.


Ray



Reply all
Reply to author
Forward
0 new messages