gpt4 book ai didi

mongodb - 尝试访问 `http://127.0.0.1:27017/`时出错,并且在运行 `mongod`时出现多个错误

转载 作者:行者123 更新时间:2023-12-03 11:59:56 26 4
gpt4 key购买 nike

当我尝试通过mongod访问http://127.0.0.1:27017/时,出现以下错误:

It looks like you are trying to access MongoDB over HTTP on the native driver port.

另外,当我尝试运行 mongod时,出现以下错误:
Space-O-Mac-Pro:~ cyberspacer$ mongod
2015-09-10T22:12:36.741+0200 E NETWORK [initandlisten] listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
2015-09-10T22:12:36.741+0200 E NETWORK [initandlisten] addr already in use
2015-09-10T22:12:36.770+0200 W - [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.
2015-09-10T22:12:36.816+0200 I STORAGE [initandlisten] exception in initAndListen: 98 Unable to lock file: /data/db/mongod.lock errno:35 Resource temporarily unavailable. Is a mongod instance already running?, terminating
2015-09-10T22:12:36.816+0200 I CONTROL [initandlisten] dbexit: rc: 100
Space-O-Mac-Pro:~ cyberspacer$

如何解决这些错误?我是否需要更改 mongod监听的URL 0.0.0.0:27017来解决此错误: [initandlisten] listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017

最佳答案

mongod端口并不意味着可以通过http访问。这非常类似于尝试使用邮件客户端浏览网络。

您应该通过mongo shell或客户端驱动程序访问MongoDB。

至于您的另一个问题:似乎已经有一个mongod实例在运行。要重新启动mongod,请执行以下操作

sudo killall mongod && mongod

关于mongodb - 尝试访问 `http://127.0.0.1:27017/`时出错,并且在运行 `mongod`时出现多个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32510869/

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