gpt4 book ai didi

MongoDB - 关闭并显示代码 48

转载 作者:行者123 更新时间:2023-12-01 22:12:26 24 4
gpt4 key购买 nike

我正在尝试启动 MongoDB,但终端返回以下错误:

2017-02-06T16:26:27.037+0000 I CONTROL  [initandlisten] MongoDB starting : pid=25184 port=27017 dbpath=/data/db 64-bit host=Janiss-MacBook-Pro.local
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] db version v3.4.1
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] git version: 5e103c4f5583e2566a45d740225dc250baacfbd7
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2k 26 Jan 2017
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] allocator: system
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] modules: none
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] build environment:
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] distarch: x86_64
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] target_arch: x86_64
2017-02-06T16:26:27.037+0000 I CONTROL [initandlisten] options: {}
2017-02-06T16:26:27.038+0000 E NETWORK [initandlisten] listen(): bind() failed Address already in use for socket: 0.0.0.0:27017
2017-02-06T16:26:27.038+0000 E NETWORK [initandlisten] addr already in use
2017-02-06T16:26:27.038+0000 E NETWORK [initandlisten] Failed to set up sockets during startup.
2017-02-06T16:26:27.038+0000 E STORAGE [initandlisten] Failed to set up listener: InternalError: Failed to set up sockets
2017-02-06T16:26:27.038+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-02-06T16:26:27.038+0000 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-02-06T16:26:27.039+0000 I CONTROL [initandlisten] now exiting
2017-02-06T16:26:27.039+0000 I CONTROL [initandlisten] shutting down with code:48

如果重要的话,我正在使用 Laravel Valet。

最佳答案

似乎您已经在要启动 mongodb 的端口上运行了一个进程:

listen(): bind() failed Address already in use for socket: 0.0.0.0:27017
2017-02-06T16:26:27.038+0000 E NETWORK [initandlisten] addr already in use

您可以尝试使用以下命令终止在该端口上运行的进程:sudo Kill sudo lsof -t -i:27017

或者为 mongodb 定义另一个端口(如果您有另一个程序使用该端口)。
要在默认端口 (27017) 以外的端口上运行 mongodb,请在从终端启动 mongodb 时使用 --port 27018 参数

关于MongoDB - 关闭并显示代码 48,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42072651/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com