Hello MongoDB people,
I am currently setting up a fresh mongoDB deployment on Digital Ocean. I have 2 droplets:
-
prod-master
droplet running my nodeJS app inside docker containers - private IP of the droplet:1.2.5.10
-
prod-mongodb
running only the mongoDB instance - private IP of the droplet:1.2.5.11
(don’t worry - despite the name these 2 droplets are not yet in production! )
Both droplets are in the same DO region, both droplets are in the same (standard/default) VPC of the DigitalOcean region, both have private IPs, both can ping
the other one via the private IP!
Until now, I was running a bindIp: 0.0.0.0
setup in my /etc/mongod.conf
and everything was fine. Now I want to secure this setup for going live.
If I understand bindIp
correctly I would now change it to bindIp: localhost,1.2.5.10
to only allow the prod-mongodb
droplet itself (= localhost) and my other main droplet (= 1.2.5.10
) to access my mongo DB. correct?
When I try this my mongod service can’t start up anymore and I end up with the following error:
"error":{"code":9001,"codeName":"SocketException","errmsg":"Cannot assign requested address"}
I now have read so many tutorials and stuff and I really can’t find any clues on what I am doing wrong! Please help me out here!
Thanks a bunch, best regards
Patrick