Please share some more details on your environment:
O/S version
How you are starting mongod
Since you are using a configuration file, I assume you have also set a systemLog.path location. There should be more informative log messages indicating the reason the mongod process was unable to start successfully.
[mongo@UATMONGODB ~]$ cat /etc/mongod.conf
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
net:
tls:
FIPSMode: true
# where to write logging data.
systemLog:
destination: file
logAppend: true
quiet: false
path: /mongo/log/mongod.log
# Where and how to store data.
storage:
dbPath: /mongo/datadir
journal:
enabled: true
# engine:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
timeZoneInfo: /usr/share/zoneinfo
# network interfaces
net:
port: 27077
bindIp: 10.10.10.10 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
security:
authorization: "enabled"
javascriptEnabled: false
setParameter:
enableLocalhostAuthBypass: false
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:
Got generic error while starting after adding mentioned replica parameters.
[root@UATMONGODB etc]# systemctl start mongod
Job for mongod.service failed because the control process exited with error code.
See "systemctl status mongod.service" and "journalctl -xe" for details.
[root@UATMONGODB etc]# journalctl -xe
Oct 13 10:21:17 UATMONGODB.katmb.com.my mongod[1229696]: try '/usr/bin/mongod --help' for more information
Oct 13 10:21:17 UATMONGODB.katmb.com.my systemd[1]: mongod.service: Control process exited, code=exited status=2
Oct 13 10:21:17 UATMONGODB.katmb.com.my systemd[1]: mongod.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit mongod.service has entered the 'failed' state with result 'exit-code'.
Oct 13 10:21:17 UATMONGODB.katmb.com.my systemd[1]: Failed to start MongoDB Database Server.
-- Subject: Unit mongod.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit mongod.service has failed.
--
-- The result is failed.
Oct 13 10:21:18 UATMONGODB.katmb.com.my dbus-daemon[1104]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Oct 13 10:21:20 UATMONGODB.katmb.com.my setroubleshoot[1229698]: AnalyzeThread.run(): Cancel pending alarm
Oct 13 10:21:20 UATMONGODB.katmb.com.my setroubleshoot[1229698]: failed to retrieve rpm info for /sys/fs/cgroup/memory/memory.limit_in_bytes
Oct 13 10:21:20 UATMONGODB.katmb.com.my dbus-daemon[1104]: [system] Activating service name='org.fedoraproject.SetroubleshootPrivileged' requested by ':1.349488' (uid=993 pid=1229698 comm="/usr/>
Oct 13 10:21:21 UATMONGODB.katmb.com.my dbus-daemon[1104]: [system] Successfully activated service 'org.fedoraproject.SetroubleshootPrivileged'
Oct 13 10:21:21 UATMONGODB.katmb.com.my setroubleshoot[1229698]: SELinux is preventing /usr/bin/mongod from open access on the file /sys/fs/cgroup/memory/memory.limit_in_bytes. For complete SELi>
Oct 13 10:21:21 UATMONGODB.katmb.com.my setroubleshoot[1229698]: SELinux is preventing /usr/bin/mongod from open access on the file /sys/fs/cgroup/memory/memory.limit_in_bytes.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that mongod should be allowed open access on the memory.limit_in_bytes file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'mongod' --raw | audit2allow -M my-mongod
# semodule -X 300 -i my-mongod.pp
Oct 13 10:21:21 UATMONGODB.katmb.com.my setroubleshoot[1229698]: AnalyzeThread.run(): Set alarm timeout to 10
Oct 13 10:21:21 UATMONGODB.katmb.com.my setroubleshoot[1229698]: AnalyzeThread.run(): Cancel pending alarm
Oct 13 10:21:22 UATMONGODB.katmb.com.my setroubleshoot[1229698]: failed to retrieve rpm info for /sys/fs/cgroup/memory/memory.limit_in_bytes
Oct 13 10:21:22 UATMONGODB.katmb.com.my setroubleshoot[1229698]: SELinux is preventing /usr/bin/mongod from getattr access on the file /sys/fs/cgroup/memory/memory.limit_in_bytes. For complete S>
Oct 13 10:21:22 UATMONGODB.katmb.com.my setroubleshoot[1229698]: SELinux is preventing /usr/bin/mongod from getattr access on the file /sys/fs/cgroup/memory/memory.limit_in_bytes.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that mongod should be allowed getattr access on the memory.limit_in_bytes file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'mongod' --raw | audit2allow -M my-mongod
# semodule -X 300 -i my-mongod.pp
Oct 13 10:21:22 UATMONGODB.katmb.com.my setroubleshoot[1229698]: AnalyzeThread.run(): Set alarm timeout to 10
Did you install MongoDB using the official packages? What specific version of MongoDB 5.x server did you install?
SELinux policies should be setup as part of the packaged installation, but can also be configured manually per Configure SELinux.
If you happen to be using an older MongoDB 5.0.x release I would strongly recommend installing the most recent patch release (currently 5.0.13) as there have been several important stability fixes. Patch releases do not introduce any backward-breaking or compatibility changes. Please review Release Notes for MongoDB 5.0 for more details.
Can you please have a look at this MongoDB log file? It should have some more relevant error messages.
MongoDB version currently is 5.0.6.
We have make seLinux permission. Do you think we still require selenux policy to be applied ?
We will try to installed patch but that’s gonna take a while with downtime approval.
But do you think this older version has any effect on the replication/oplog setup?