jamebal/jmal-cloud-server

docker-compose部署后 连接不上mongo

Closed this issue · 3 comments

v2.8.4 Latest
image
image
mongo无法获取到IP地址

server日志:
Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=mongo:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: Connect timed out}}]

mongo日志:
{"t":{"$date":"2024-05-26T22:03:43.263+08:00"},"s":"E", "c":"STORAGE", "id":20557, "ctx":"initandlisten","msg":"DBException in initAndListen, terminating","attr":{"error":"Location28596: Unable to determine status of lock file in the data directory /data/db: boost::filesystem::status: Permission denied: "/data/db/mongod.lock""}}

mongodb没有权限访问/data/db目录

收到!

破案:群晖系统,docker-compose部署,需要给挂载的路径设置everyone用户的读写权限。