how to set mogodb in upstart service with authentication

后端 未结 4 1016
醉梦人生
醉梦人生 2021-01-07 09:45

I have created a superuser tom in mongodb v2.6.11 with username & password and now i want to add this at ubunt

4条回答
  •  旧时难觅i
    2021-01-07 10:08

    1 : Got to -> $cd /etc/init/

    2 :Through vi Or nano editor Create file myservice.conf with below code

    description "service to start mongodb at startup"
    author "plutopunch :)"
    
    start on started mountall
    stop on shutdown
    
    respawn
    respawn limit 99 5
    
    script
         export HOME="/home/admin"
    
         exec sudo mongod --port 27017 --auth --dbpath /var/lib/mongodb
    end script
    
    post-start script
    end script
    

    3 : restart pc

    http://upstart.ubuntu.com/cookbook/

提交回复
热议问题