Issue installing RC on EC2 CentOS7

Greetings everyone - Could someone help please… I am running CentOS 7.7 EC2 on AWS and I followed this Doc line by line: https://rocket.chat/docs/installation/manual-installation/centos/

First, I tried to start mongo using this command: systemctl start mongod
and got the following error:

Job for mongod.service failed because the control process exited with error code. See “systemctl status mongod.service” and “journalctl -xe” for details.

And then I run this command & was able to access mongo shell:
mongod --logpath=/var/log/mongodb/mongod.log --dbpath=/var/lib/mongo --fork

But what I found very strange, if I can’t start mongo, how come I was able to login to mongo shell and do: show dbs:

show dbs
admin 0.000GB
config 0.000GB
local 0.000GB

$ rocketchat> mongod --version
db version v4.0.12

Below are the commands & errors I am getting:

Tried to start mongo
[root@rocketchat]# systemctl start mongod.service
Job for mongod.service failed because the control process exited with error code. See “systemctl status mongod.service” and “journalctl -xe” for details.

mongo status
[root@rocketchat]# systemctl status mongod.service
● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2019-09-22 00:44:50 EDT; 19min ago
Docs: https://docs.mongodb.org/manual

Sep 22 00:44:50 ip-172-31-16-29 systemd[1]: Starting MongoDB Database Server...
Sep 22 00:44:50 ip-172-31-16-29 mongod[7586]: 2019-09-22T00:44:50.348-0400 I STORAGE  
[main] Max cache overflow file size custom option: 0
Sep 22 00:44:50 ip-172-31-16-29 mongod[7586]: about to fork child process, waiting until server is 
ready for connections.
Sep 22 00:44:50 ip-172-31-16-29 mongod[7586]: forked process: 7589
Sep 22 00:44:50 ip-172-31-16-29 systemd[1]: mongod.service: control process exited, code=exited 
status=1
Sep 22 00:44:50 ip-172-31-16-29 systemd[1]: Failed to start MongoDB Database Server.
Sep 22 00:44:50 ip-172-31-16-29 systemd[1]: Unit mongod.service entered failed state.
Sep 22 00:44:50 ip-172-31-16-29 systemd[1]: mongod.service failed.

I run this command and nothing happens
systemctl start rocketchat

Then I checked status
[root@rocketchat]# systemctl status rocketchat
● rocketchat.service - The Rocket.Chat server
Loaded: loaded (/usr/lib/systemd/system/rocketchat.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2019-09-22 01:16:55 EDT; 57s ago
Process: 7757 ExecStart=/usr/local/bin/node /root/rc/rocketchat/main.js (code=exited, status=1/FAILURE)
Main PID: 7757 (code=exited, status=1/FAILURE)

Sep 22 01:16:55 ip-172-31-16-29 systemd[1]: Started The Rocket.Chat server.
Sep 22 01:16:55 ip-172-31-16-29 systemd[1]: rocketchat.service: main process exited, code=exited, status=1/FAILURE
Sep 22 01:16:55 ip-172-31-16-29 systemd[1]: Unit rocketchat.service entered failed state.
Sep 22 01:16:55 ip-172-31-16-29 systemd[1]: rocketchat.service failed.

your input is much appreciated !! Thanks.

This may be a systemd issue, check the systemd logs using
sudo sealert -a /var/log/audit/audit.log
May need to modify SE Linux permissions. Perhaps try
sudo semanage fcontext -a -t mongod_var_lib_t ‘/data/db.
sudo chcon -Rv -u system_u -t mongod_var_lib_t ‘/data/db’
sudo restorecon -Rv ‘/data/db’
sudo semanage fcontext -a -t mongod_log_t '/var/log/mongod.

sudo chcon -Rv -u system_u -t mongod_log_t ‘/var/log/mongod’
sudo restorecon -Rv ‘/var/log/mongod’
sudo semanage fcontext -a -t mongod_log_t ‘/var/run.*’
sudo chcon -Rv -u system_u -t mongod_log_t ‘/var/run’
sudo restorecon -Rv ‘/var/run’

From MongoDB documentation https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-red-hat/

Thanks @bkm ! Based on Mongo Doc, if you use default configuration during Mongo installation, you don’t need to mess with any permissions at all. But I did find the solution to my problem which is due to miss-info from RC Doc. In short, MongoDB no longer support MMAPV1 engine, after I changed it to WiredTiger, everything worked smoothly…

Please see my other thread at: