What is the correct way to start a mongod service on linux / OS X?

前端 未结 11 1741
予麋鹿
予麋鹿 2020-11-30 16:39

I\'ve installed mongodb and have been able to run it, work with it, do simple DB read / write type stuff. Now I\'m trying to set up my Mac to run mongod as a service.

11条回答
  •  庸人自扰
    2020-11-30 17:20

    Just installed MongoDB via Homebrew. At the end of the installation console, you can see an output as follows:

    To start mongodb:

    brew services start mongodb
    

    Or, if you don't want/need a background service you can just run:

    mongod --config /usr/local/etc/mongod.conf
    

    So, brew services start mongodb, managed to run MongoDB as a service for me.

提交回复
热议问题