问题描述
我正在运行一个 NodeJS
应用程序,其中包含 。一切正常,我可以通过连接到容器内的Mongo来看到我的所有数据。但是当我连接到时,我看不到任何数据。
I'm running a NodeJS
App with docker-compose. Everything works fine and I can see all my data by connecting to Mongo inside container. But when I connect to RoboMongo I don't see any data.
如何我处理这个问题?
推荐答案
您应该在Docker容器内进行一个Robomongo SSH隧道连接MongoDB。首先,您应该在docker容器内安装一个ssh服务器。
You should do a Robomongo SSH tunnel connection to MongoDB inside docker container. First of all you should install a ssh server inside your docker container.
之后,您应该在Robomongo中配置您的连接。
在连接设置中有Robomongo连接的配置选项卡。
After that you should configure your connection in Robomongo.Inside "Connection Settings" there are configuration tabs of your Robomongo Connection.
转到SSH选项卡,并将您的SSH连接配置到docker容器。之后,转到连接选项卡,并将您的连接配置为MongoDB,就像在localhost范围。
Go to "SSH" Tab and configure your SSH connection to the docker container. After that go to "Connection" Tab and configure your connection to MongoDB as if it was in localhost scope.
这篇关于将robomongo连接到mongoDB docker容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!