systemctl start mongod.service报如下异常
mongod.service: control process exited, code=exited status=1
Failed to start High-performance, schema-free document-oriented database.
Unit mongod.service entered failed state.
mongod.service failed
journalctl -xe
会查到如下原因
SELinux is preventing /usr/bin/mongod from write access on the directory
所以关闭掉SELinux功能
临时和永久关闭Selinux
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
systemctl start mongod.service 启动正常