This means that there is already a service listening on the server/port combination. Most likely this is another instance of the
When you restarted, did you reboot the machine or just restart the
mognod process? If you restarted the process, how did you do it?
0.0.0.0 just means that
mongod will listen on all network interfaces. If your host has a network interface that allows incoming traffic and you don’t have firewalls in place blocking public traffic to port 27017, then you have every right to be worried about security concerns. If your server has two network cards in it, one for external and one for internal traffic, then
0.0.0.0 will bind to both of these which is not good. External network traffic does not need to connect directly to your MongoDB servers.
I would set my
bindIp up to be
127.0.0.1 address is your localhost address so can connect locally from the machine without it going over the network. If you don’t want people to connect from the MongoDB host, you can leave this IP address out. The
10.x.x.x would ideally be an internal only interface that does not allow for outside your network traffic. I only recommend using
0.0.0.0 for testing purposes and then recommend changing back to more restrictive IPs.
The configuration docs have a small section on security considerations. But it’s definitely worth making sure your database server is properly secured.