AWS t2.xlarge
OS : Redhat 8.6
MongoDB Version : 6.0.3
# 서비스 상태 확인
systmectl status mongod
# 로그 확인
tail -50 /var/log/mongodb/mongod.log | grep error
systemstatus
(code=exited, status=14)
mongod.log
{"t":{"$date":"2022-11-26T06:41:23.568+00:00"},"s":"E", "c":"NETWORK", "id":23024, "ctx":"initandlisten","msg":"Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
rm /tmp/mongodb-27017.sock
systemctl start mongod
service status
ExecStart=/usr/bin/mongod $OPTIONS (code=exited, status=100)
mongod.log
{"t":{"$date":"2022-11-26T06:51:14.023+00:00"},"s":"E", "c":"CONTROL", "id":20557, "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"IllegalOperation: Attempted to create a lock file on a read-only directory: /var/lib/mongo"}}
chown -R mongod:mongod /var/lib/mongo