com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by java.net.ConnectException: Connection refused

HI i am using Spring boot i started facing above issue.

Back my application was runing fine

Error Message:

"message": "Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]; nested exception is com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused}}]",

This should be the root cause. Where is your mongodb process running?

Mongodb process running at altas AWS

java.net.ConnectException: Connection refused

How can i solve the error