Discussion:
[mongodb-user] Cannot connect to docker0 (MongoDB chart)
JOHN CHAN
2018-11-10 16:22:36 UTC
Permalink
I am completely new to docker. I followed this
<https://docs.mongodb.com/charts/master/installation/?_ga=2.221574746.371872191.1541857470-1096066772.1541307560>
instruction to install mongodb chart and docker.

When I connect to 172.17.0.1, it said

Unable to connect to MongoDB using the specified URI.
The following error was returned while attempting to connect: MongoNetworkError: failed to connect to server [172.17.0.1:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 172.17.0.1:27017]
The result from pinging the specified server "172.17.0.1" from within the container is:
PING 172.17.0.1 (172.17.0.1) 56(84) bytes of data.64 bytes from 172.17.0.1: icmp_seq=1 ttl=64 time=0.050 ms
--- 172.17.0.1 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.050/0.050/0.050/0.000 ms

I have also checked the setting by using docker network inspect bridge

"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]

How can I connect to the mongodb?
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/d498cd75-40fb-409a-9e79-93ee72f37aa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Tom Hollander' via mongodb-user
2018-11-26 20:30:01 UTC
Permalink
Hi John -

The output suggests that the IP address is valid, but MongoDB cannot be
found running on the default port (27017). Are you sure that mongod is
running on your host? If you run just "mongo" from your host (not in the
container) does it connect?

Also, what OS and Docker version are you using?
Tom
Post by JOHN CHAN
I am completely new to docker. I followed this
<https://docs.mongodb.com/charts/master/installation/?_ga=2.221574746.371872191.1541857470-1096066772.1541307560>
instruction to install mongodb chart and docker.
When I connect to 172.17.0.1, it said
Unable to connect to MongoDB using the specified URI.
The following error was returned while attempting to connect: MongoNetworkError: failed to connect to server [172.17.0.1:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 172.17.0.1:27017]
PING 172.17.0.1 (172.17.0.1) 56(84) bytes of data.64 bytes from 172.17.0.1: icmp_seq=1 ttl=64 time=0.050 ms
--- 172.17.0.1 ping statistics ---1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.050/0.050/0.050/0.000 ms
I have also checked the setting by using docker network inspect bridge
"Config": [
{
"Subnet": "172.17.0.0/16",
"Gateway": "172.17.0.1"
}
]
How can I connect to the mongodb?
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+***@googlegroups.com.
To post to this group, send email to mongodb-***@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/12c5f228-7b01-4196-939f-ce30c5dc9549%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...