【问题标题】:is it the samongod or brew services start mongodb-community@4.0 to start mongoDB server?是 samongod 还是 brew services 启动 mongodb-community@4.0 来启动 mongoDB 服务器?
【发布时间】:2019-05-14 07:40:41
【问题描述】:

我是 mongodb 的新手。我正在使用the installation guide 安装MongoDB 4.0 community edition。安装后,我使用brew services start mongodb-community@4.0 运行MongoDB。为了彻底关闭服务器,我启动了一个 mongo shell,并运行了 use admindb.shutdown.Server()

接下来,要再次启动服务器,我运行brew services start mongodb-community@4.0 并得到了

`Service `mongodb-community` already started, use `brew services restart mongodb-community` to restart.` 

所以我做了brew services restart mongodb-community@4.0 并得到了以下返回的消息:

Stopping `mongodb-community`... (might take a while)
==> Successfully stopped `mongodb-community` (label: homebrew.mxcl.mongodb-community)
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)

我的问题: (1) 运行brew services start mongodb-community@4.0 和运行mongod 一样吗? (2)为什么我再次启动服务器时显示Servicemongodb-communityalready started?我没有完全关闭服务器吗?

【问题讨论】:

    标签: mongodb homebrew


    【解决方案1】:

    我认为您有两个选择。将其作为应用程序之类的服务运行(您的第一个选项)。或者从命令行运行它(你的第二个选项)。因此,根据您的需要,您可以选择其中任何一种。

    参考文档。如果你用过:brew install mongodb-community@4.0

    日志和数据库文件夹已经创建。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-08
      • 2014-02-09
      • 1970-01-01
      相关资源
      最近更新 更多