I have a mongodb 2.2.2 setup on ubuntu 12.04 machine and I need to modify binding_ip list while database is running, without mongo restart. Is there a way to do so?
Is it possible to do from pymongo?
p.s. I’ve actually tried
mongod –config /etc/mongodb.conf –bind_ip 127.0.0.1 31.**
with bind_ip list supplied but it says
Wed Dec 19 17:02:05 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /var/lib/mongodb/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
and I’m not sure if it is not just restarting database.
Apparently you can do with
iptables(8)rules. Then try (with 192.0.2.1 being the IP address you want to receive connections on):If you already have iptables rules then you may need a different command. Check the output of
iptables -L INPUT.