When I try to start the mongo service(systemctl start mongodb) I get this error in journalctl:
Mar 21 15:36:18 redhat7 systemd[1]: Started High-performance, schema-free document-oriented database.
Mar 21 15:36:18 redhat7 systemd[1]: Starting High-performance, schema-free document-oriented database...
Mar 21 15:36:18 redhat7 mongod[14333]: about to fork child process, waiting until server is ready for con
Mar 21 15:36:18 redhat7 mongod[14333]: forked process: 14335
Mar 21 15:36:18 redhat7 systemd[1]: mongod.service: main process exited, code=exited, status=1/FAILURE
Mar 21 15:36:18 redhat7 systemd[1]: Unit mongod.service entered failed state.
Mar 21 15:36:18 redhat7 systemd[1]: mongod.service failed.
But running the following command as root, works!
sudo -u mongod /usr/bin/mongod -f /etc/mongod1.conf
/lib/systemd/system/mongod.service
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
[Service]
User=mongod
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod1.conf
[Install]
WantedBy=multi-user.target