我在執行我創建的圖像時遇到了一些問題。該服務需要連接到MongoDB中即使它是由它監聽的本地主機:27017運行碼頭圖像時出錯
下面是錯誤:
INFO 5 --- [localhost:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server localhost:27017
[main] org.mongodb.driver.cluster : No server chosen by WritableServerSelector from cluster description ClusterDescription{type=UNKNOWN, connectionMode=MULTIPLE, all=[ServerDescription{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}]}. Waiting for 30000 ms before timing out
您可以發佈您Dockerfile和碼頭工人,compose.yml如有 –
喜wassim,我評論它是承擔。謝謝 –
也許你在兩個不同的容器中運行mongo和應用程序,奇怪的是它們都有自己的本地版本 –