I have two VMs in a VMware cloud that belong to the same VApp and so are behind the same edge gateway. The both have their own different internal ip addresses but I route services from the outside to them using a combination of the edge gateway's ip address and port. I have a Grails application running on one VM which needs to work with an instance of MongoDB. I have that instance of MongoDB running as a service on the other VM. The issue is that when the Grails application starts up, it can't contact the MongoDB instance on the other VM by using the edge gateway's ip address and port 27017.
I have an appropriate NAT rule to forward such requests to the VM that has MongoDB on it at the same port 27017.I also have appropriate firewall rules set up.
Some helpful diagnostic information, the Grails application can successfully contact another instance of MongoDB I have running on the Amazon Web Services cloud.
And if I run Robomongo (a MongoDB gui client) on my local machine, it can contact the instance of MongoDB running on my VMware VM successfully.
I just can't get contact between my Grails application on one VM and MongoDB on the other VM. I get error from my Grails application that it couldn't find MongoDB.
EDIT: I also discovered that if from my local linux machine, I type the following at the prompt:
telnet [vmwareEdgeGateway's IP] 27017
it makes the connection. This would be supportive of the fact that I have my NAT and firewall settings configured correctly I would hope.