mongodb mongod:加载共享库时出错:libssl.so.10 libcrypto.so.10
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33693635/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
mongod: error while loading shared libraries: libssl.so.10 libcrypto.so.10
提问by Hadi
Problem
问题
I downloaded the mongodb 3.0.7
tar files. Then I added the bin directory to my path:
我下载了mongodb 3.0.7
tar文件。然后我将 bin 目录添加到我的路径中:
export PATH=<mongodb-install-directory>/bin:$PATH
Then when I run the mongodb server:
然后当我运行 mongodb 服务器时:
mongod --fork --logpath "/home/me/mongolog" --dbpath "/home/me/data"
I get this error:
我收到此错误:
mongod: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory
What I did
我做了什么
I tried this solution. In brief I updated my openssl:
我试过这个解决方案。简而言之,我更新了我的 openssl:
sudo apt-get update
sudo apt-get install libssl1.0.0 libssl-dev
and then:
进而:
cd /lib/x86_64-linux-gnu
sudo ln -s libssl.so.1.0.0 libssl.so.10
sudo ln -s libcrypto.so.1.0.0 libcrypto.so.10
but it says that it cannot find libssl.so.10
and libcrypto.so.10
. I don't know what to do!
但它说它找不到libssl.so.10
和libcrypto.so.10
。我不知道该怎么办!
采纳答案by user2607479
sudo apt-get purge mongodb-org*
Just start over from here.
从这里重新开始。
If you don't want 3.2, do not
如果你不想要 3.2,不要
sudo apt-get install -y mongodb-org
Specify the version for all the individual components in the next step.
在下一步中指定所有单个组件的版本。
OR you can copy the correct version link from mongodb.
或者您可以从mongodb复制正确的版本链接。
You will need to
你需要
cd /Downloads
wget wget https://fastdl.mongodb.org/linux/mongodb-correct-version.tgz
tar -zxvf mongodb-correct-version.tgz
You should see all the executables. Make sure /usr/local/bin is in your PATH
您应该会看到所有的可执行文件。确保 /usr/local/bin 在您的 PATH 中
echo $PATH
Create a symbolic link for the mongod server and check the version.
为 mongod 服务器创建符号链接并检查版本。
sudo ln -s ~/Downloads/mongodb-correct-version/bin/mongod /usr/local/sbin/bin/mongod
mongod --version
Now create a symbolic link for the shell and check the version.
现在为 shell 创建一个符号链接并检查版本。
sudo ln -s ~/Downloads/mongodb-correct-version/bin/mongo /usr/local/bin/mongo
mongo --version
Create a directory path for the server.
为服务器创建目录路径。
mkdir ~/data
mkdir ~/data/db
Start the server and let it run from a separate terminal than the shell.
启动服务器并让它从与 shell 不同的终端运行。
mongod --dbpath ~/data/db/
It should be listening on port 27017. In a new terminal, start mongo.
它应该侦听端口 27017。在一个新终端中,启动 mongo。
mongo
回答by Dziamid
Seems that mongo is expecting libssl files in /usr/lib/
:
似乎 mongo 需要 libssl 文件/usr/lib/
:
sudo cp /lib/x86_64-linux-gnu/libssl.so.1.0.0 /usr/lib/libssl.so.10
sudo cp /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /usr/lib/libcrypto.so.10
回答by u7791006
Check your server version, your system may be centos, but downloaded the ubuntu version of the mongodb. Download again just fine
检查你的服务器版本,你的系统可能是centos,但是下载的是ubuntu版本的mongodb。重新下载就好了
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.10.tgz
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.10.tgz
回答by azatar
I'm using MongoDB v3.4.6 on Ubuntu 14.04 LTS and have the same issue:
我在 Ubuntu 14.04 LTS 上使用 MongoDB v3.4.6 并且有同样的问题:
mongod: error while loading shared libraries: libnetsnmpmibs.so.30: cannot open shared object file: No such file or directory
To FIX it, I had to install snmp with apt-get
:
要修复它,我必须使用以下命令安装 snmp apt-get
:
$ sudo apt-get update
$ sudo apt-get install snmp
Hope this helps someone somewhere out there beneath the pale moonlight... <8,_,)-----
希望这能帮助苍白月光下某个地方的某个人...... <8,_,)-----
回答by Sviatoslav Oleksiv
I had the same error, even after following instructions below. But my problem was solved when I tried sudo mongo
即使按照以下说明操作,我也遇到了同样的错误。但是当我尝试时我的问题就解决了sudo mongo
回答by regnex
i had this same problem and what i did was
我有同样的问题,我所做的是
- created
/data/db
in the root folder(i use a Linux distro) - then,
mongod --dbpath ~/data/db/
- then,
mongo
/data/db
在根文件夹中创建(我使用 Linux 发行版)- 然后,
mongod --dbpath ~/data/db/
- 然后,
mongo
i hope this helps anyone facing the same problem in future
我希望这可以帮助将来遇到同样问题的任何人