【问题标题】:mongodb-community not working on Apple M1mongodb-community 不适用于 Apple M1
【发布时间】:2021-11-12 13:45:38
【问题描述】:

我已经使用 brew 安装了 mongodb-community 5.0 版,遵循这篇文章对 M1 Apple Silicon Macs 的回答:How to install Mongodb on Apple M1 chip

一切正常,直到第 6 步。

  1. 在我的终端中运行“mongo”后,我得到了following errors

  2. 我搜索了stackoverflow并怀疑mongodb服务可能没有运行,但是命令“brew services list”给出了 following output.

  3. 运行“mongod”会得到following error

  4. 然而,检查“mongo --version”会得到clear indication of installation

我也多次卸载了mongodb,重新启动了整个程序。


在这一点上我很沮丧。如果有人可以让我知道这个过程中出了什么问题/我该如何解决它,那将非常有帮助。

PS:这是我的第一篇文章,如果结构不合理或不遵循社区准则,我很抱歉。如果违反任何规则,我可以尝试编辑帖子。

谢谢。

【问题讨论】:

  • 获得“连接被拒绝”意味着没有在该端口上监听,这意味着第 5 步没有正常工作。

标签: mongodb apple-m1


【解决方案1】:

请按照此步骤重新安装 mongodb,它适用于我:

  • 第一个:运行此命令(先决条件)
xcode-select --install
\\note: Homebrew requires the Xcode commandline tools
  • 第二个:为 M1 芯片安装 Homebrew(先决条件)
  • 3rd:运行此命令以获取适用于 mongodb 的 Homebrew 公式
brew tap mongodb/brew
  • 4th:运行此命令获取 mongodb 版本 5
brew install mongodb-community@5.0
  • 5th:运行此命令在后台运行mongodb
brew services start mongodb-community@5.0
// I notice that if I don't run this command I cannot connect to the server and receive the same error message like you
  • 6th:运行 mongo 并享受。我希望它有效。

【讨论】:

    猜你喜欢
    • 2021-11-19
    • 1970-01-01
    • 1970-01-01
    • 2021-02-23
    • 2023-01-08
    • 2015-04-06
    • 2022-07-02
    • 1970-01-01
    相关资源
    最近更新 更多