Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2中的mongo容器无法访问 #5892

Closed
Wangdaen opened this issue Sep 10, 2020 · 3 comments
Closed

WSL2中的mongo容器无法访问 #5892

Wangdaen opened this issue Sep 10, 2020 · 3 comments

Comments

@Wangdaen
Copy link

在WSL2中安装docker(没有使用docker desktop,而是直接在子系统中安装docker)
1.启动mongo容器:docker run -itd --name mongo -p 27017:27017 --restart=always -v /data/mongo/data:/data/db mongo:3.2.21
mongo容器启动,在WSL2子系统中可以通过127.0.0.1:27017 进行连接,但是在win10系统中通过127.0.0.1:27017 连接会出现连接失败,无法连接到该网络。不知道怎么解决该问题。
2.通过docker run -itd --name mongo -p 27017:27017 --restart=always -v /mnt/d/mongo/data:/data/db mongo:3.2.21 来启动mongo容器会出现启动失败,该问题目前也不知道是由什么原因造成的,目前通过上#1的方式来进行启动.

@therealkenc
Copy link
Collaborator

therealkenc commented Sep 10, 2020

[edit] #4619 I had the dupe reference wrong

image

dupe #4851 #5298

@ghost
Copy link

ghost commented Sep 10, 2020

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

@ghost ghost closed this as completed Sep 10, 2020
@ghost ghost added the duplicate label Sep 10, 2020
@marshalby2
Copy link

我和你遇到一模一样的问题,在WSL2中的用docker安装了redis、mongodb、mysql,只有mysql可以在程序中访问,redis和mongodb都是连接失败

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants