在 ubuntu 上安装 Mongodb 后无法运行

在 ubuntu 上安装 Mongodb 后无法运行

由于制裁问题,我通过更改 DNS 安装了 Mongodb。现在,我已经安装了 mongodb,但是当我在 Ubuntu 终端中输入“mongod”时,我得到了以下信息:

2020-04-17T12:38:01.073+0430 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-04-17T12:38:01.078+0430 W  ASIO     [main] No TransportLayer configured during NetworkInterface startup
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten] MongoDB starting : pid=2476 port=27017 dbpath=/data/db 64-bit host=ata-Aspire-E1-571G
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten] db version v4.2.5
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten] git version: 2261279b51ea13df08ae708ff278f0679c59dc32
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten] allocator: tcmalloc
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten] modules: none
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten] build environment:
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten]     distmod: ubuntu1804
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten]     distarch: x86_64
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten]     target_arch: x86_64
2020-04-17T12:38:01.078+0430 I  CONTROL  [initandlisten] options: {}
2020-04-17T12:38:01.079+0430 E  NETWORK  [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock Operation not permitted
2020-04-17T12:38:01.079+0430 F  -        [initandlisten] Fatal Assertion 40486 at src/mongo/transport/transport_layer_asio.cpp 684
2020-04-17T12:38:01.079+0430 F  -        [initandlisten] 

***aborting after fassert() failure

然后,当我使用命令“sudo mongod”重新运行它时,我遇到:

2020-04-17T12:42:30.535+0430 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2020-04-17T12:42:30.536+0430 W  ASIO     [main] No TransportLayer configured during NetworkInterface startup
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten] MongoDB starting : pid=2514 port=27017 dbpath=/data/db 64-bit host=ata-Aspire-E1-571G
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten] db version v4.2.5
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten] git version: 2261279b51ea13df08ae708ff278f0679c59dc32
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten] allocator: tcmalloc
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten] modules: none
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten] build environment:
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten]     distmod: ubuntu1804
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten]     distarch: x86_64
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten]     target_arch: x86_64
2020-04-17T12:42:30.537+0430 I  CONTROL  [initandlisten] options: {}
2020-04-17T12:42:30.537+0430 E  STORAGE  [initandlisten] Failed to set up listener: SocketException: Address already in use
2020-04-17T12:42:30.552+0430 I  CONTROL  [initandlisten] now exiting
2020-04-17T12:42:30.552+0430 I  CONTROL  [initandlisten] shutting down with code:48

当我输入“sudo systemctl status mongodb”时,我得到了这个:

Unit mongodb.service could not be found.

但是,当我输入此命令时,我得到了正确的答案:“mongo --eval'db.runCommand({connectionStatus: 1})'”

MongoDB shell version v4.2.5
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("a24c786b-d161-4c3c-91bd-a55198d72505") }
MongoDB server version: 4.2.5
{
    "authInfo" : {
        "authenticatedUsers" : [ ],
        "authenticatedUserRoles" : [ ]
    },
    "ok" : 1
}

现在,我想知道问题可能是什么?

相关内容