36

运行brew services start mongodb-community产生:

Bootstrap failed: 5: Input/output error
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/<myUserName>/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist` exited with 5.

当我跑步时launchctl load -w /Users/<myUserName>/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist

产量

Load failed: 5: Input/output error

我最近将 macOS 升级到 BigSur 11.5.2。

我已经卸载并重新安装了 homebrew 和 xcode。

4

8 回答 8

42

尝试这个

brew services restart <mongodb-community@4.4>

于 2021-08-31T02:57:31.013 回答
26

我可以通过自制软件运行 mongodb。我相信这解决了我的问题:

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist

其次是

launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist

于 2021-09-07T19:17:03.683 回答
9

我在 MySQL 中看到了这个问题,解决方案是我当前的配置文件不是我的 homebrew 文件夹的所有者。

我不得不更改它,因为我为另一个工作空间设置了第二个配置文件,但它们共享相同的自制路径。

我建议任何看到此错误的人尝试运行

sudo chown -R $(whoami) $(brew --prefix)/*

然后看看是否能解决它。同样,我在 MongoDB 上没有这个问题,但是当我的配置文件不拥有 brew 文件夹时,我在 MySQL 上看到了这个确切的错误。

于 2021-09-21T07:15:14.500 回答
5

看来 mongodb-community 已经启动了。因此,请通过以下命令重新启动它而不是启动:

brew services restart mongodb-community
于 2021-10-14T23:31:09.310 回答
4

要查看真正的错误,您需要在不使用 brew 的情况下运行服务

我遇到了类似的问题,但是我无法启动 apache(httpd) 而不是 mongodb。

$ brew services start httpd                                                                                                                                                        
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 
/Users/john/Library/LaunchAgents/homebrew.mxcl.httpd.plist` exited with 
5.
FAIL: 1

不幸的是,brew 没有向用户显示导致此错误的原因。起初,我尝试使用此线程中答案中的提示,但既没有重新安装 apache,也没有unload -w/load -w帮助。我在酿造日志中也没有发现任何东西。我决定调查 apache 本身。为此,我在没有 brew 的情况下运行了 apache

$ /opt/homebrew/Cellar/httpd/2.4.51/bin/apachectl start
httpd: Syntax error on line 66 of /opt/homebrew/etc/httpd/httpd.conf: Cannot load /opt/homebrew/Cellar/php@5.6/5.6.40_3/lib/httpd/modules/libphp5.so into server: dlopen(/opt/homebrew/Cellar/php@5.6/5.6.40_3/lib/httpd/modules/libphp5.so, 0x000A): tried: '/opt/homebrew/Cellar/php@5.6/5.6.40_3/lib/httpd/modules/libphp5.so' (no such file), '/usr/local/lib/libphp5.so' (no such file), '/usr/lib/libphp5.so' (no such file)
FAIL: 1

然后终于清楚了httpd服务没有启动的原因是什么。原来是php升级后,php版本变了,忘记在apache配置文件中写新的php版本了。我很快解决了这个问题,apache 启动了。

于 2021-12-04T08:57:27.483 回答
2

如果您尝试使用restart您的服务,请尝试此操作,但仍然无法正常工作

  1. 停止您的服务
brew services stop mongodb-community
  1. 重新启动你的 macOS
  2. 再次启动您的服务
brew services start mongodb-community
于 2022-01-05T03:32:33.530 回答
1

在命令解决我的问题launchctl remove homebrew.mxcl.mongodb-community之前运行类似的东西load

于 2021-10-14T01:42:18.013 回答
0

我在 postgresql 11 上遇到了类似的问题,重新启动服务没有帮助。当我的 MacBook突然重启时,问题就出现了。

在检查了端口并尝试了所有可能的解决方案后,我决定查看日志。

tail -n 100 /usr/local/var/log/postgresql@11.log

这给了我发现这个的日志的最后 100 行:

FATAL:  lock file "postmaster.pid" already exists
HINT:  Is another postmaster (PID 479) running in data directory "/usr/local/var/postgresql@11"?

显然,问题出在postmaster.pid所以我删除了它:

rm /usr/local/var/postgresql@11/postmaster.pid

再次启动 postgres 服务:

brew services start postgresql@11

瞧!有效。

于 2022-02-09T13:39:37.757 回答