docker-mongodb
docker-mongodb copied to clipboard
Failed mongo connection on setup
I initialized a docker container as per your instructions, then when running "mongo $(docker inspect --format {{.NetworkSettings.IPAddress}} mongodb)" I get a connection failed error: "Error: couldn't connect to server 172.17.0.10:27017 (172.17.0.10)"
My mongo docker container looks to be setup correctly, and since I'm new to docker I'm not entirely sure how to troubleshoot this. Have you experienced this issue before?
@grepped mongo just takes time to start. You can watch the mongo logs after starting the container using docker exec -it mongodb tail -f /var/log/mongodb/mongod.log
Give it a minute or two before trying to connect.
edit: if you mount a volume at /var/lib/mongodb
subsequent startup will be faster.
@grepped was your issue resolved?