gpt4 book ai didi

mongodb - 套接字异常 : Address already in use MONGODB

转载 作者:IT老高 更新时间:2023-10-28 13:03:53 26 4
gpt4 key购买 nike

我在尝试运行 mongodb 时发现了这个错误。我通过 Homebrew 软件安装它。请帮忙

Agungs-MacBook-Pro:~ agungmahaputra$ mongod
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] MongoDB starting : pid=5189 port=27017 dbpath=/data/db 64-bit host=Agungs-MacBook-Pro.local
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] db version v3.6.0
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] git version: a57d8e71e6998a2d0afde7edc11bd23e5661c915
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] allocator: system
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] modules: none
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] build environment:
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] distarch: x86_64
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] target_arch: x86_64
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] options: {}
2017-12-26T15:31:15.911+0700 E STORAGE [initandlisten] Failed to set up listener: SocketException: Address already in use
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] now exiting
2017-12-26T15:31:15.911+0700 I CONTROL [initandlisten] shutting down with code:48
Agungs-MacBook-Pro:~ agungmahaputra$

最佳答案

您可以杀死以前的 mongod 实例并启动新的实例。

要杀死之前的 mongod 实例,首先通过键入搜索在您的机器上运行的任务列表,

sudo lsof -iTCP -sTCP:LISTEN -n -P

搜索 mongod COMMAND 及其 PID 和类型,

sudo kill <mongo_command_pid>

现在通过键入启动您的 mongod 实例,

mongod

可以看到MongoDB运行成功了。

关于mongodb - 套接字异常 : Address already in use MONGODB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47975929/

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