mongodb restart error : "path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"
모니터링 알람이 와서 확인해보니 mongoDB가 종료되어 있었다.
🔥mongodb Stopped : ...~ Stopped
restart 시 정상적으로 실행이 되고 있지 않아 /var/log/mongod/mongo.log 확인
{"t":{"$date":"2024-04-16T05:30:02.039+09:00"},"s":"I", "c":"CONTROL",
"id":20698, "ctx":"main","msg":"***** SERVER RESTARTED **"}
{"t":{"$date":"2024-04-16T05:30:02.041+09:00"},"s":"I", "c":"CONTROL",
"id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to
force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2024-04-16T05:30:02.046+09:00"},"s":"I", "c":"NETWORK",
"id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable.
If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2024-04-16T05:30:02.047+09:00"},"s":"I", "c":"STORAGE",
"id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr"
:{"pid":3085736,"port":27017,"dbPath":"/var/lib/mongo","architecture":"64-bit","host":"db1"}}
{"t":{"$date":"2024-04-16T05:30:02.047+09:00"},"s":"I", "c":"CONTROL",
"id":51765, "ctx":"initandlisten","msg":"Operating System",
"attr":{"os":{"name":"Rocky Linux release 8.7 (Green Obsidian)",
"version":"Kernel 4.18.0-425.3.1.el8.x86_64"}}}
{"t":{"$date":"2024-04-16T05:30:02.047+09:00"},"s":"I", "c":"CONTROL",
"id":21951, "ctx":"initandlisten","msg":"Options set by command line"
,"attr":{"options":{"config":"/etc/mongod.conf","net":{"bindIp":"0.0.0.0","port":*****},
"processManagement":{"fork":true,"pidFilePath":"/var/run/mongodb/mongod.pid",
"timeZoneInfo":"/usr/share/zoneinfo"},"security":{"authorization":"enabled"},
"storage":{"dbPath":"/var/lib/mongo","journal":{"enabled":true},
"wiredTiger":{"engineConfig":{"cacheSizeGB":1.5}}},
"systemLog":{"destination":"file","logAppend":true,
"path":"/var/log/mongodb/mongod.log"}}}}
{"t":{"$date":"2024-04-16T05:30:02.047+09: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"}}
{"t":{"$date":"2024-04-16T05:30:02.047+09:00"},"s":"F", "c":"-",
"id":23091, "ctx":"initandlisten","msg":"Fatal assertion","attr"
:{"msgid":40486,"file":"src/mongo/transport/transport_layer_asio.cpp","line":1048}}
{"t":{"$date":"2024-04-16T05:30:02.047+09:00"},"s":"F", "c":"-",
"id":23092, "ctx":"initandlisten","msg":"\n\naborting after fassert() failure\n\n"}
restart시 로그..
위 로그 중 아래내용 확인..
{"t":{"$date":"2024-04-16T05:30:02.047+09: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"}}
이부분을 보고 /tmp/mongodb-27017.sock 파일 소유권한이 root root로 된 것을 확인했다.
소유권 변경
# chown mongod mongod /tmp/mongodb-27017.sock
재실행
# systemctl restart mongod
실행확인
# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:***** 0.0.0.0:* LISTEN 3106105/mongod
끝
'Server > mongoDB' 카테고리의 다른 글
| [Linux]MongoDB 7.0 외부접속 명령어 -bash: mongo: command not found.. (0) | 2024.05.20 |
|---|
댓글