系統版本CentOS release 5.7 (Final)
另外一台伺服器是6.5在安裝mongodb3.3.12版本時沒有報任何錯誤資訊。
啟動mongodb提示錯誤如下
/usr/local/mongodb/mongodb3.3.12/bin/mongod: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
分析原因
系統不知道libssl.so.10放在哪個目錄下,全域find了一下libssl.so.10檔案沒有找到。
在以下地址找到ssl101的安裝資訊https://centos.pkgs.org/5/atomic-x86_64/openssl101e-1.0.1e-9.el5.art.i386.rpm.html執行命令:# yum install openssl101e
第二次運行mongoDB提示資訊如下
/usr/local/mongodb/mongodb3.3.12/bin/mongod: /lib64/libc.so.6: version `GLIBC_2.7' not found (required by /usr/local/mongodb/mongodb3.3.12/bin/mongod)/usr/local/mongodb/mongodb3.3.12/bin/mongod: /lib64/libc.so.6: version `GLIBC_2.6' not found (required by /usr/local/mongodb/mongodb3.3.12/bin/mongod)/usr/local/mongodb/mongodb3.3.12/bin/mongod: /lib64/libc.so.6: version `GLIBC_2.8' not found (required by /usr/local/mongodb/mongodb3.3.12/bin/mongod)/usr/local/mongodb/mongodb3.3.12/bin/mongod: /lib64/libc.so.6: version `GLIBC_2.9' not found (required by /usr/local/mongodb/mongodb3.3.12/bin/mongod)/usr/local/mongodb/mongodb3.3.12/bin/mongod: /lib64/libc.so.6: version `GLIBC_2.10' not found (required by /usr/local/mongodb/mongodb3.3.12/bin/mongod)
分析原因
出現了/lib64/libc.so.6: version `GLIBC_2.7’ not found問題,glibc版本過低。
先查看一下當前系統glibc的情況:
strings /lib64/libc.so.6 |grep GLIBCGLIBC_2.2.5GLIBC_2.2.6GLIBC_2.3GLIBC_2.3.2GLIBC_2.3.3GLIBC_2.3.4GLIBC_2.4GLIBC_2.5
沒有找到支援2.6以上的,需要重新安裝glibc
升級版本:glibc-2.7.tar.gz
[root@dev201 ~]# cd /usr/src/[root@dev201 src]# tar -zxf glibc-2.7.tar.gz [root@dev201 src]# cd glibc-2.7[root@dev201 glibc-2.7]# mkdir -v ../glibc-buildmkdir: created directory `../glibc-build'[root@dev201 glibc-2.7]# cd ../glibc-build/[root@dev201 glibc-build]# /usr/src/glibc-2.7/configure --prefix=/usr/[root@dev201 glibc-build]# make [root@dev201 glibc-build]# make install
在次查看glibc情況
strings /lib64/libc.so.6 |grep GLIBCGLIBC_2.2.5GLIBC_2.2.6GLIBC_2.3GLIBC_2.3.2GLIBC_2.3.3GLIBC_2.3.4GLIBC_2.4GLIBC_2.5GLIBC_2.6GLIBC_2.7GLIBC_PRIVATE
第三次運行mongoDB提示資訊如下
/usr/local/mongodb/mongodb3.3.12/bin/mongod: /lib64/libc.so.6: version `GLIBC_2.8' not found (required by /usr/local/mongodb/mongodb3.3.12/bin/mongod)/usr/local/mongodb/mongodb3.3.12/bin/mongod: /lib64/libc.so.6: version `GLIBC_2.9' not found (required by /usr/local/mongodb/mongodb3.3.12/bin/mongod)/usr/local/mongodb/mongodb3.3.12/bin/mongod: /lib64/libc.so.6: version `GLIBC_2.10' not found (required by /usr/local/mongodb/mongodb3.3.12/bin/mongod)
看來安裝的版本還是不夠高了,
網站說在5.7上直接將glibc升級到2.10存在風險,系統會崩潰,所以放棄了升級處理。
試著換mongodb低版本試一下,用mongodb3.1.4啟動情況如下:
第四次運行mongoDB提示資訊如下
/usr/local/mongodb/mongodb3.1.4/bin/mongod: /usr//lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /usr/local/mongodb/mongodb3.1.4/bin/mongod)/usr/local/mongodb/mongodb3.1.4/bin/mongod: /usr//lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/local/mongodb/mongodb3.1.4/bin/mongod)/usr/local/mongodb/mongodb3.1.4/bin/mongod: /usr//lib64/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by /usr/local/mongodb/mongodb3.1.4/bin/mongod)/usr/local/mongodb/mongodb3.1.4/bin/mongod: /usr//lib64/libstdc++.so.6: version `CXXABI_1.3.3' not found (required by /usr/local/mongodb/mongodb3.1.4/bin/mongod)/usr/local/mongodb/mongodb3.1.4/bin/mongod: /usr//lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /usr/local/mongodb/mongodb3.1.4/bin/mongod)/usr/local/mongodb/mongodb3.1.4/bin/mongod: /usr//lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /usr/local/mongodb/mongodb3.1.4/bin/mongod)
分析原因
gcc編譯器版本過低
[root@jstukw4cgk9nve mongodb3.1.4]# strings /usr/lib/libstdc++.so.6 | grep GLIBCXX GLIBCXX_3.4GLIBCXX_3.4.1GLIBCXX_3.4.2GLIBCXX_3.4.3GLIBCXX_3.4.4GLIBCXX_3.4.5GLIBCXX_3.4.6GLIBCXX_3.4.7GLIBCXX_3.4.8GLIBCXX_FORCE_NEW
暫時放棄在該台伺服器上安裝配置mongoDB,編譯器版本不夠高,主要擔心升級以後對系統以前程式和環境有所影響。
解決辦法
http://ftp.gnu.org/gnu/glibc/
下載相關並安裝GLIBC_2.8、GLIBC_2.9、GLIBC_2.10.1進行安裝配置,目前可以正常啟動Mongodb。
安裝方法見本頁glibc-2.7.tar.gz安裝方案即可。
主要原因是系統版本過底,導致C運行庫的版本過底導致。