Tag Archives: and PID file is not owned by root. Refusing.

docker “mongo:systemctl start mongod.service” Error: mongod.service: New main PID 1390 does not belong to service, and PID file is not owned by root. Refusing.

Platform: Feiteng server + docker

 

 

Add parameters in docker run:

-v /sys/fs/cgroup:/sys/fs/cgroup

 

After docker exec into the container

chown -R mongodb:mongodb /var/lib/mongodb