MongoDB not using /etc/mongodb.conf after I changed dbpath

前端 未结 4 1055
眼角桃花
眼角桃花 2020-12-30 04:25

Ever since I changed the dbpath in /etc/mongodb.conf, MongoDB has not been starting automatically, nor using the new dbpath. Prior to

4条回答
  •  一整个雨季
    2020-12-30 05:25

    It turns out that I needed to set the owner and group to mongodb. When I transferred the files to the new directory, I had set the owner and group to my user account nick and also tried root, neither of which worked.

    To do so, here are the following commands:

    sudo chown mongodb /home/nick/appdev/mongodb -R
    sudo chgrp mongodb /home/nick/appdev/mongodb -R
    

    To confirm that it worked, you can check the file permissions with:

    ls -l /home/nick/appdev/mongodb
    

提交回复
热议问题