如何将oracle linux虚拟机中的docker mongodb连接到mongodb compass

tvmytwxo  于 2022-12-11  发布在  Docker
关注(0)|答案(1)|浏览(117)

I installed mongodb inside docker container in oracle linux virtual machine. I need to connect this mongodb with mongodb compass. I don't have user account for mongodb and don't have mongod config file in the docker or in virtual machine.

More Information:

I created oracle linux virtual machine from oracle cloud. Then, using my current system's(windows) command prompt, I connected to that machine. Through that, I created a docker container inside the virtual machine. And then, I installed mongodb-6.0.2 inside the docker container. Now, when I try to connect this mongodb database(in virtual machine) to the mongodb compass, It is connecting to my current system's mongodb database(which was installed before the creation of this virtual machine). I also attached the screenshot of my virtual machine's docker and mongodb's information in cmd.
Here is the screenshot of ip of my docker inside the virtual machine
Can anyone solve this issue and tell me how can I make connection of this virtual machine database to mongodb compass?

aiazj4mn

aiazj4mn1#

If wanting to use Compass from Windows and connect to a MongoDB container running an Oracle cloud compute instance, you'll need to make sure networking allows for connections to port 27017 via an ingress rule in your network security group.
Another option is to use port forwarding over ssh.

相关问题