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

前端 未结 4 1082
眼角桃花
眼角桃花 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:23

    After checking all permission in the data, journal and log folders as suggested, my problem was solved by giving permission to a lock file in the /tmp folder

    sudo chown mongod:mongod mongodb-27017.sock 
    

    I was running it as a AWS Amazon Linux instance. I figured that out by executing as the mongod user as below, and then, researching the error code. It might be useful for other troubleshooting.

    sudo -S -u mongod mongod -f /etc/mongod.conf
    

提交回复
热议问题