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

前端 未结 11 1782
予麋鹿
予麋鹿 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:21

    First Step

    install mongodb in your linux machine with

    apt install mongodb-client && apt install mongodb-server

    second step is

    change the database path instead of your system default path if you want.
    so do the following steps and change it for yourself.

    mongod --directoryperdb --dbpath /var/lib/mongodb/data/db --logpath /var/lib/mongodb/log/mongodb.log --logappend --rest
    

    and in your windows machine do it just like that just put an --install flag. you have to get a successful message.

    Best Regards...

提交回复
热议问题