Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

Failed to set up listener: Cannot assign requested address when binding ips

Hey there, I’m running on a Raspberry Pi 4 with Ubuntu 20.04 and MongoDB version 4.2.7. Today I installed Mongodb but by binding the ip of my Workstation I got this Error (48 - " Failed to set up listener: SocketException: Cannot assign requested address"). But by pinging this address I get a response.

I’ve tried to bind this address over the config and also with “monogd --bind_ip 127.0.0.1:28000,192.168.xxx.xxx”. I’ve also tried to use another distro but no success…

Hi @J_Hoffm,

The bind_ip is a comma separated list of IP addresses without port number. Have you tried

mongod --bind_ip 127.0.0.1,192.168.xxx.xxx

Note you also had monogd which I assume was just a typo when posting your question.

If you want to change the port that mongod listens on you can add --port 28000 to the command above.

1 Like