I have been trying to host a mongo db server on a oracle virtual machine (using oracle linux 8). I have been using the mongodb extention for vscode to test the connection, but I keep getting this error:
“Unable to load connection: MongoServerSelectionError: connect ETIMEDOUT :27017”
Here are my connection settings:
It could be that the server is only bound to 127.0.0.1 and not listening on a lan IP.
Check your configuration file for bindIp or bindIpAll :
grep bindIp /etc/mongod.conf
If you need to connect to the database from other hosts then this will need to be updated, the default is to only bind localhost. If you only need vscode to access it remotely consider using the “SSH Tunnel” options on the connection form.
Also be aware of how to secure your installation once you allow access from other source: