The Problem
I am trying but failing, in MongoDB 7.0, on Ubuntu, to bind multiple IP addresses to net.bindIp in mongod.conf
What I have tried
I have tried 127.0.0.1,x.x.x.x, 127.0.0.1;x.x.x.x, [127.0.0.1,x.x.x.x], [127.0.0.1;x.x.x.x] and mongod fails to start on each and everyone.
when the syntax is
[127.0.0.1,x.x.x.x]
I get this error
Aug 22 11:52:36 ip-172-26-1-93 mongod[41708]: Scalar option 'net.bindIp' must be a single value
and when I use any other syntax, I get this error
Aug 22 11:54:38 ip-172-26-1-93 mongod[41723]: {"t":{"$date":"2023-08-22T11:54:38.935Z"},"s":"I", "c":"CONTROL", "id":7484500, "ctx":"main","msg":"Environment variable MONGODB_CONFIG_OVERRIDE_NOFORK == 1, overriding \"processManagement.fork\" to false"}
Where I have looked
After searching this extensively, I found this answer here and the answers to this question here and after tryin their solutions I still get the same errors.
I have looked at the documentation for the latest version and I can't see where I am going wrong.
Additional
I can successfully bind 0.0.0.0, however this then defeats the object of using net.bindIp
Edit
- I have tried reinstalling MongoDB 3 times now, and still the same issue
ifconfig? – Wernfried Domscheit Aug 23 '23 at 05:27BUT thats not the IP address that I have assigned to my DNS. Im using AWS Lightsail if its any help.
– Yenmangu Aug 26 '23 at 16:59net.bindIpAll: truewill do exactly the same. What do you mean by "assigned to my DNS"? – Wernfried Domscheit Aug 26 '23 at 17:56