Connect a Grails application to MongoDB through an NAT instance on AWS

I am currently trying to set up the mongo replica set in VPC with this quick start guide https://s3.amazonaws.com/quickstart-reference/mongodb/latest/doc/MongoDB_on_the_AWS_Cloud.pdf .

I have a grails application that runs on an AWS instance that was also used to host the mongo instance. Now I want to separate the web application from mongo. I already followed the above guide and set up my replica using a NAT instance with which I can access through ssh. Now I am wondering how to configure grails so that it connects to this mongo instance, and not to the instance on its own instance.

I just installed the db host and everything in the DataSource.groovy file and everything was fine, but I can’t find how to configure it to go through NAT to the main replica node.

Do you guys know what to do next?

Cheers, Tobias

+4
source share

All Articles