

We were concerned about the security using 0.0.0.0 to bind. I hope I understood the context correctly and that this makes some sense. from outside of your GCP network, GCP will route/NAT from the external IP address to the internal address of your VM. For connections coming from externally, i.e. You should be able to have MongoDB bind to the internal IP address 10.128.0.6. In fact, the external address can be changed at any time and the VM wouldn’t notice - the internal IP address would stay the same. So the VM only knows its internal IP address but it has no knowledge of the external address. Instead, I think you should be able to see the internal IP address 10.128.0.6 in the VM (e.g. But as you also mentioned, you can’t see this IP address on the VM itself.

From your MongoDB log it seems that you tried to have MongoDB bind to the reserved external IP address 35.232.21.94. I know this is a few days old and you already found a solution, but I noticed from the screenshot that you’re on a GCP VM with an internal and an external IP address. You may want to contact Google Cloud support for further guidance on creating your desired network configuration. If your intent was to add a public external IP that allows direct connection to your deployment, the Google Cloud docs I suggested earlier should be helpful. If so, your VM would not have a local network interface associated with the external IP: all requests will be forwarded via SSH and (from mongod's point of view) appear to be coming from localhost or the private IP. The MongoDB startup exception indicates that the requested IP address is not a local network IP that can be assigned by the bindIp directive:įailed to set up listener: SocketException: Cannot assign requested addressįrom your screenshot, it looks like you may have set up SSH port forwarding from an external IP address to the internal IP address. Hi this is definitely a problem with network configuration for the VM. Maybe something to do with the IP address on the VM?

T00:00:07.645+0000 W ASIO No TransportLayer configured during NetworkInterface startup T00:00:07.414+0000 I CONTROL Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify -sslDisabledProtocols 'none

It is also easier to review if you can share log lines and similar information as text rather than images. If you are still having issues, please share the relevant lines from the MongoDB log which should include the reason for the mongod process shutting down. etc/nf is the default on CentOS if you installed the official MongoDB packages and are starting as a service). You aren’t editing the correct config file (which doesn’t appear to be the case here). You have a syntax error in your MongoDB config file. There is a running process already bound to the requested IP and port number. You are trying to bind to an IP that isn’t associated with a local network interface on this instance (the IP address should appear in the output of ifconfig -a | grep "inet"). If a bindIp directive isn’t working (and this is the only value you’ve changed for a previously working configuration), some common reasons are: A cloud instance typically will not have a public IP until you explicitly add one, and you would want a static IP (see: Google Cloud: Reserving a static external IP address) if you are using that to connect to your MongoDB deployment.īefore binding to a public IP, I strongly recommend reviewing the MongoDB Security Checklist and ensuring you have enabled authentication, configured role-based access control, and set up TLS/SSL. You can include multiple bind IP addresses in a comma-delimited list or alternatively use net.bindIpAll to bind to all network interfaces on this instance. Hi you check the MongoDB server logs for more details on why the service isn’t starting? The default location on CentOS should be /var/log/mongodb.
