mongodb service is not starting up

前端 未结 21 753
野的像风
野的像风 2020-12-02 05:16

I\'ve installed the mongodb 2.0.3, using the mongodb-10gen debian package. Everything went well, except the service which is installed by default is not starting up when com

21条回答
  •  感动是毒
    2020-12-02 05:34

    I took a different approach:

    Background: I use mongodb, single node, local to my server, as a staging area.

    I installed mongo based on instructions available in MongoDB docs.

    So, this is not 'prime' infrastructure, does not need to be up all the time - but still essential.

    What I do: In my run script, I check if mongo is running using -

    if pgrep "mongod" >/dev/null 2>&1
    

    If it is not running, then I run

    sudo mongod &
    

    Been working like a charm, no setup etc.

    If your use case is similar, let me know if it works for you too.

    Good luck!

提交回复
热议问题