Below is the config file
mongod.conf
for documentation of all options, see:
http://docs.mongodb.org/manual/reference/configuration-options/
where to write logging data.
systemLog:
destination: file
logAppend: true
path: /database/log/mongodb/mongod.log
Where and how to store data.
storage:
dbPath: /database/data/mongodb
journal:
enabled: true
engine:
mmapv1:
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: 27019
bindIp: 127.0.0.1,hostname # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
#security:
#operationProfiling:
#replication:
replication:
replSetName: “SNT-NP-DEV-rs01”
#sharding:
Enterprise-Only Options
#auditLog:
#snmp:
One thing to share here, while doing rs.status(), host name showing as localhost not the actual hostname.
“members” : [
{
“_id” : 0,
“name” : “localhost:27019”,
“health” : 1,
“state” : 1,
“stateStr” : “PRIMARY”,
“uptime” : 5876,
“optime” : {
“ts” : Timestamp(1654867891, 1),
“t” : NumberLong(1)
},