我在尝试安装mongodb时遇到一些错误
我对ubuntu和mongodb都是新手。ubuntu安装在虚拟机托管的windows 8.1上。我尝试在ubuntu v18.04 bionic上安装mongodb v4.2.2:我在尝试安装mongodb时遇到一些错误,mongodb,ubuntu,Mongodb,Ubuntu,我对ubuntu和mongodb都是新手。ubuntu安装在虚拟机托管的windows 8.1上。我尝试在ubuntu v18.04 bionic上安装mongodb v4.2.2: 导入公钥 ubuntu@ubuntu:~$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - OK 安装gnupg及其所需的库 ubuntu@ubuntu:~$ sudo apt-get inst
导入公钥
ubuntu@ubuntu:~$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
OK
安装gnupg及其所需的库
ubuntu@ubuntu:~$ sudo apt-get install gnupg
Reading package lists... Done
Building dependency tree
Reading state information... Done
gnupg is already the newest version (2.2.4-1ubuntu1.2).
The following package was automatically installed and is no longer required:
linux-modules-5.0.0-36-generic
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 55 not upgraded.
请重试导入密钥
ubuntu@ubuntu:~$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
OK
为Ubuntu 18.04(仿生版)创建/etc/apt/sources.list.d/mongodb-org-4.2.list文件
正如你所看到的,我在这一步中遇到了一些我无法修复的错误。 事实上,我不知道错误的原因是什么
我安装了mongodb,没有任何错误
ubuntu@ubuntu:~$ sudo apt-get install -y mongodb-org
然后我启动它并检查它的状态
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-01-21 10:24:32 PST; 4s ago
Docs: https://docs.mongodb.org/manual
Process: 2164 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=48)
Main PID: 2164 (code=exited, status=48)
Jan 21 10:24:32 ubuntu systemd[1]: Started MongoDB Database Server.
Jan 21 10:24:32 ubuntu systemd[1]: mongod.service: Main process exited, code=exited, status=48/n/a
Jan 21 10:24:32 ubuntu systemd[1]: mongod.service: Failed with result 'exit-code'.
请帮我解决这个问题
ubuntu@ubuntu:~$ sudo apt-get install -y mongodb-org
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-01-21 10:24:32 PST; 4s ago
Docs: https://docs.mongodb.org/manual
Process: 2164 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=48)
Main PID: 2164 (code=exited, status=48)
Jan 21 10:24:32 ubuntu systemd[1]: Started MongoDB Database Server.
Jan 21 10:24:32 ubuntu systemd[1]: mongod.service: Main process exited, code=exited, status=48/n/a
Jan 21 10:24:32 ubuntu systemd[1]: mongod.service: Failed with result 'exit-code'.