且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

由于 WiredTiger.turtle 权限,Mongodb 无法启动

更新时间:2022-06-16 23:14:23

与 WiredTiger.turtle 权限相同的问题.Ubuntu 18.04我的问题是我用 sudo 启动了一个 mongod 服务.这在我的数据库目录中创建了具有 root:root 所有权的文件.在没有 sudo 的情况下启动 mongod 服务时,我收到了权限被拒绝的错误.

Same problem with WiredTiger.turtle permissions. Ubuntu 18.04 My problem was I started a mongod service with sudo. This created files with root:root ownership in my database directory. When starting mongod service without sudo I received the permission denied error.

解决方案是将 db 目录中所有文件的所有权改回 mongodb:mongodb

Solution was to change ownership of all files in the db directory back to mongodb:mongodb

$ sudo chown -R mongodb:mongodb/var/lib/mongodb/*

$ sudo chown -R mongodb:mongodb /var/lib/mongodb/*