UnknownHostException while connecting to mongodb using mongo spark connector and multiple hosts
rishabh
1
Reputation point
As the title says,
Using : spark.read.format("com.mongodb.spark.sql.DefaultSource") \
.option("uri", connectionString) \
.load()
to load data from mongo. It works like a charm when I use only 1 host but when hosts are>1 then it throws:
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches com.mongodb.client.internal.MongoClientDelegate
Please help
Sign in to answer