Problem Description:
In the deployment of MongoDB, the startup process encountered "version ' openssl_1.0.2 ' not found" such an error, causing MongoDB service does not come:
[root@slave-4 lib]# /usr/local/mongodb/bin/mongod -f /etc/mongodb/mongo.conf
/usr/local/mongodb/bin/mongo: /lib64/libcrypto.so.10: version `OPENSSL_1.0.2‘ not found (required by /usr/local/mongodb/bin/mongo)
[root@slave-4 lib]#
Cause Analysis:
This error is due to the version problem of OpenSSL. Therefore, you need to update OpenSSL. To view the current version number:
[root@slave-4 lib]# /usr/local/mongodb/bin/mongod -f /etc/mongodb/mongo.conf
/usr/local/mongodb/bin/mongo: /lib64/libcrypto.so.10: version `OPENSSL_1.0.2‘ not found (required by /usr/local/mongodb/bin/mongo)
[root@slave-4 lib]#
Workaround:
There are two solutions, one of which is Yum Auto-updating, and this is a simple method. There is also a situation when the machine completely blocked the external network, can not be used when yum, only manually solved.
Workaround 1--yum Automatic Updates
Reinstall Openssl:yum-y Install OpenSSL, after the installation is complete, check that the version is OK. It's good to restart MongoDB:
[root@slave-4 ~]# openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017
[root@slave-4 ~]#
[root@slave-4 ~]# rpm -qa openssl
openssl-1.0.2k-8.el7.x86_64
[root@slave-4 ~]#
Workaround 2--Manual Update
Because this time encountered this error machine, because the restrictions can not use the external network, so try to solve this manually. The following steps are done:
1. Manually compile and install openssl-1.0.2k.tar.gz this package
2, from other OpenSSL version ok machine copy a libcrypto.so.1.0.2k to this error server/lib64 below, and then the original libcrypto.so.10-> libcrypto.so.1.0.1e changed to libcrypto.so.10-libcrypto.so.1.0.2k
[root@mongodb tmp]# ll /lib64/|grep libcrypto
lrwxrwxrwx 1 root root 19 Jun 20 11:22 libcrypto.so.10 -> libcrypto.so.1.0.2k #新做的软连接
-rwxr-xr-x. 1 root root 2025472 Nov 6 2016 libcrypto.so.1.0.1e
-rwxr-xr-x 1 root root 2512448 Jun 20 11:19 libcrypto.so.1.0.2k #从其他机器拷贝过来的文件
lrwxrwxrwx. 1 root root 19 Aug 2 2017 libcrypto.so.10.bak -> libcrypto.so.1.0.1e #将原来的软连接更名备份
[root@mongodb tmp]#
3, and then start MongoDB, it succeeded.
====================== Installing openssl-1.0.2k.tar.gz steps ======================
1) See if/usr/local/openssl already exists, and if so, change the OpenSSL directory to a name and make a backup
2) Unzip the file
[Email protected] tmp]# TAR-XZF openssl-1.0.2k.tar.gz
3) configuration?
[root@mongodb tmp]# cd openssl-1.0.2k/
[root@mongodb openssl-1.0.2k]# ./config shared --prefix=/usr/local/openssl --openssldir=/usr/lib/openssl
Shared means to generate a dynamic library
Prefix? indicates the installation directory
Openssldir? indicates the configuration file directory, ubuntu defaults to /usr/lib/openssl. If other directories are set, there will be a warning when executing the openssl command.
4) Compile?& installation
[root@mongodb openssl-1.0.2k]# make & make install
5) Setting Environment variables
Vim/etc/profile, add export path= $PATH on the last line:/usr/local/openssl/bin save exit;
Use Source/etc/profile to make it effective
6) Creating Symbolic Links
[root@mongodb openssl-1.0.2k]# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl #执行这一步的时候有可能会失败,提示/usr/bin/openssl已经存在,那就将/usr/bin/openssl改个名字,重新做软连接
[root@mongodb openssl-1.0.2k]# ln -s /usr/local/ssl/openinclude/openssl /usr/include/openssl
7) Refresh the dynamic library configuration (some installation documentation is this step, but I didn't do it)
vim/etc/ld.so.conf add/usr/local/ssl/lib at the end of the file
8) The Test View version has been updated
[root@mongodb ~]# openssl version # version has been updated
OpenSSL 1.0.2k 26 Jan 2017
[root@mongodb ~]#
====================== Replace the soft connection under/lib64 ======================
Just installed the openssl-1.0.2k.tar.gz, although OpenSSL version saw the update, but the start of MongoDB will still report the same error. It is found that the soft connection libcrypto.so.10 under the/lib64 of this machine is still pointing to libcrypto.so.1.0.1e, not libcrypto.so.1.0.2k. So from another server copy of the libcrypto.so.1.0.2k file upload to this can not be connected to the error machine/lib64 below, re-do the soft connection, the libcrypto.so.10-> libcrypto.so.1.0.1e changed to libcrypto.so.10-libcrypto.so.1.0.2k:
[root@mongodb tmp]# ll /lib64/|grep libcrypto
lrwxrwxrwx 1 root root 19 Jun 20 11:22 libcrypto.so.10 -> libcrypto.so.1.0.2k #新做的软连接
-rwxr-xr-x. 1 root root 2025472 Nov 6 2016 libcrypto.so.1.0.1e
-rwxr-xr-x 1 root root 2512448 Jun 20 11:19 libcrypto.so.1.0.2k #从其他机器拷贝过来的文件
lrwxrwxrwx. 1 root root 19 Aug 2 2017 libcrypto.so.10.bak -> libcrypto.so.1.0.1e #将原来的软连接更名备份
[root@mongodb tmp]#
And then restart MongoDB to start up.
Two workarounds for Starting MongoDB report version ' openssl_1.0.2 ' not found