The names given to the mongoDb nodes are very important. These names are used by the web application to establish connections. If we do rs.status() as a mongo client, we may see the following names highlighted in red:
connectionString = 'mongodb://mongodb-node-3.novalocal:27017,mongodb-node-1:27017,mongodb-node-2:27017/cpi?replicaSet=rs0&connectTimeoutMS=1000'
However these names don't actually resolve to an IP address. So take it work, I've modified the /etc/hosts file on the web server as follows
To test the mapping works, try the following command on the web server: