how to set mogodb in upstart service with authentication

后端 未结 4 1034
醉梦人生
醉梦人生 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条回答
  •  北恋
    北恋 (楼主)
    2021-01-07 10:14

    Alternatively possible to use supervisor:

    apt install supervisor
    

    Setting for process mongodb:

    create file myupstartservice.conf at location /etc/supervisor/conf.d and put below code

    [program:mongo]
    command=/usr/bin/mongod --auth --config /etc/mongod.conf
    autostart=true
    autorestart=true
    user=root
    priority=100
    

    then checkservice

    service supervisor restart

    some reference

提交回复
热议问题