I'm trying to set up a MongoDB cluster using Docker Compose, but I can't get Compass to connect. Here's my Docker Compose configuration: I've got three MongoDB instances (mongo1, mongo2, mongo3), all set up with replica set configurations. I'm exposing the ports and running a script to initiate the replica set. But when I try to connect with Compass, it seems like it's not working. Any ideas on what configuration I need to use?
2 Answers
What connection string are you using in Compass? Make sure to specify the correct URI, which should look something like `mongodb://localhost:27017`. If you're connecting from the host, this should work as expected.
I had a similar issue. I found that I needed to update my `/etc/hosts` file to make it work, but that's not ideal. I'm also trying to build a seamless development environment across Windows, Linux, and macOS without having to do system-specific tweaks. Maybe there's another way around it? I’d love your suggestions!
Related Questions
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String