Review the server environment, we need to allow Server B to access the Server A MongoDB database.
Server A - MongoDB server Private IP - 192.168.162.129 / 17 Server B - Application Server Private IP - 192.168.204.205 / 17
bind_ip, but unable to start
mongod process anymore.
#$ vim /etc/mongod.conf # Listen to local interface only. Comment out to listen on all interfaces. bind_ip = 127.0.0.1, 192.168.162.129, 192.168.204.205
E NETWORK [initandlisten] listen(): bind() failed errno:99 Cannot assign requested address for socket: 192.168.204.205:27017 E STORAGE [initandlisten] Failed to set up sockets during startup.
bind_ip is for “local interface only”, put
192.168.162.129 (Server A private ip) is enough for clients (like Server B) on the same LAN to access.
#$ vim /etc/mongod.conf # Listen to local interface only. Comment out to listen on all interfaces. bind_ip = 127.0.0.1, 192.168.162.129