I have purchased a Dedicated MongoDb Cluster on Atlas and using the following URL in my Java Web Application:
mongodb+srv://satinder:@cluster1.cqtc2.mongodb.net/?retryWrites=true&w=majority&appName=Cluster1
Here is the issue that I am facing:
When I am developing my webapp on my local Ubuntu 24.04 - there is no issue and the application works like a charm!
However, the moment I deploy my webapp to the VPS as production app - the application fails to load and generates the following exception:
com.mongodb.MongoTimeoutException: Timed out while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=REPLICA_SET, servers=[{address:27017=cluster1-shard-00-02.cqtc2.mongodb.net …
This is where I am stuck at the moment.
Any input would be greatly appreciated.
Thanks
Satinder Singh