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

前端 未结 11 1801
予麋鹿
予麋鹿 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 16:59

    Homebrew's services tap integrates formulas with the launchctl manager. Adding it is easy:

    brew tap homebrew/services
    

    You can then launch MongoDB with this command (this will also start mongodb on boot):

    brew services start mongodb
    

    You can also use stop or restart:

    brew services stop mongodb
    brew services restart mongodb
    

提交回复
热议问题