【问题标题】:Get this error to start the mongo db : Failed to set up listener: SocketException: Address already in use获取此错误以启动 mongo db:无法设置侦听器:SocketException:地址已在使用中
【发布时间】:2020-09-26 02:31:58
【问题描述】:

我最近开始使用 mongoDB 并一次又一次地遇到这个问题。我想我错过了一些东西,但不知道问题出在哪里。我正在开发最新的 mongo db 版本 4.0.1。

iron@iron-System-Product-Name:/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/codesnippets$ sudo mongod --dbpath db
2018-08-24T09:30:26.351+0530 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] MongoDB starting : pid=5994 port=27017 dbpath=db 64-bit host=iron-System-Product-Name
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] db version v4.0.1
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] git version: 54f1582fc6eb01de4d4c42f26fc133e623f065fb
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] allocator: tcmalloc
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] modules: none
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] build environment:
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten]     distmod: ubuntu1604
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten]     distarch: x86_64
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten]     target_arch: x86_64
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] options: { storage: { dbPath: "db" } }
2018-08-24T09:30:26.354+0530 E STORAGE  [initandlisten] Failed to set up listener: SocketException: Address already in use
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] now exiting
2018-08-24T09:30:26.354+0530 I CONTROL  [initandlisten] shutting down with code:48

【问题讨论】:

标签: mongodb


【解决方案1】:
  • sudo lsof -iTCP -sTCP:LISTEN -n -P
  • sudo kill <mongo_command_pid>
  • mongod

试试这三个命令,你一定能摆脱它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-07
    • 2021-09-26
    • 2012-09-12
    • 1970-01-01
    • 2014-03-16
    • 1970-01-01
    • 1970-01-01
    • 2015-08-30
    相关资源
    最近更新 更多