sameersbn / docker-mongodb

Dockerfile to build a MongoDb container image which can be linked to other containers.
MIT License
47 stars 50 forks source link

Failed mongo connection on setup #1

Open ghost opened 9 years ago

ghost commented 9 years ago

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?

sameersbn commented 9 years ago

@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.

sameersbn commented 9 years ago

@grepped was your issue resolved?