본문 바로가기
ERROR

[MongoDB] 설치 후 실행 안됨(status=14 , status=100)

by DenverAlmighty 2022. 11. 26.
반응형

0. 실행 환경

AWS t2.xlarge
OS : Redhat 8.6
MongoDB Version : 6.0.3

1. Error 확인

# 서비스 상태 확인
systmectl status mongod
# 로그 확인
tail -50 /var/log/mongodb/mongod.log | grep error

1) status=14

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

2) status=100

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
728x90
반응형