but I got error: `No server chosen by com.mongodb.async.client.ClientSessionHelper$1@8c3b9d from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=10.74.155.54:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
Hi,
Could you make sure that you could reach the MongoDB server from the application instance ? Try using mongo shell to connect with the same URI to check.
The error message is generally related to an incorrect port number. For example, you only specified 10.74.155.54
without the port number, and the connection defaults to port number 27017
. Please make sure this is the correct port number of the server.
This is my
build.sbt
file
This is likely not related to the error you’re getting, but you could just specify mongo-scala-driver
as the dependency, and sbt
should be able to pull in all of the other dependencies related to the driver.
libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "2.4.2"
Regards,
Wan.