All we need is an easy explanation of the problem, so here it is.
Unable to start mongod daemon after upgrading OS from Ubuntu 16 to 18
[email protected]:~# mongod --version
db version v4.0.4
git version: f288a3bdf201007f3693c58e140056adf8b04839
OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
allocator: tcmalloc
modules: none
build environment:
distmod: ubuntu1804
distarch: x86_64
target_arch: x86_64
[email protected]:~#
cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
[email protected]:~# /usr/bin/mongod --config /etc/mongo/db8303/mongodb.conf &
/usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /usr/bin/mongod)
The difference that I’m seeing before and after OS upgrade on libcurl version:
before:
[email protected]:~# ls -lrt /usr/lib/x86_64-linux-gnu/libcurl*
/usr/lib/x86_64-linux-gnu/libcurl.so.4 -> libcurl.so.4.4.0
/usr/lib/x86_64-linux-gnu/libcurl.so.3 -> libcurl.so.4
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.4.0
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3 -> libcurl-gnutls.so.4
/usr/lib/x86_64-linux-gnu/libcurl.so.4.4.0
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.4.0
After:
[email protected]:~# ls -lrt /usr/lib/x86_64-linux-gnu/libcurl
/usr/lib/x86_64-linux-gnu/libcurl.so.4 -> libcurl.so.4.5.0
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.5.0
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.3 -> libcurl-gnutls.so.4
/usr/lib/x86_64-linux-gnu/libcurl.so.4.5.0
/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4.5.0
Did anyone face similar issues ?
How to fix this issue ?
How to solve :
I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.
Method 1
Support for Ubuntu 18.04 was added in Mongo 4.0.6, see https://jira.mongodb.org/browse/SERVER-37778
You have version 4.0.4
Method 2
I tried following different options :
Option1: with Ubuntu-16 mongo binaries (before option3 step2); if we are okay with libcurl3
1. apt-get remove libcurl4
2. apt-get install libcurl3
3. able to start the daemon
Option2: didn’t work
1. apt-get remove libcurl4
2. apt-get install libcurl4
3. /etc/init.d/mongo_db7020
/usr/bin/mongod: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /usr/bin/mongod)
Option3: copying mongodb 18 binaries worked
1. apt-get remove libcurl4
2. rsync -asvh mongoserver:/usr/bin/mongodb-linux-x86_64-ubuntu1804-4.0.4/bin/* /usr/bin/mongodb-linux-x86_64-ubuntu1604-4.0.4/bin
3. apt-get install libcurl4
4. able to start the daemon
Option 1 & 3 worked fine for me.
Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0