我一直在研究Spark Streaming应用程序,它通过reactivemongo连接器与MongoDB连接。但是,Spark作业遇到以下异常
16:53:23.153 [ForkJoinPool-4-worker-5] ERROR reactivemongo.api.Failover2 - Got an error, no more attempts to do. Completing with a failure... reactivemongo.core.errors.ConnectionNotInitialized: MongoError['Connection is missing metadata (like protocol version, etc.) The connection pool is probably being initialized.'] at reactivemongo.core.errors.ConnectionNotInitialized$.MissingMetadata(errors.scala:67)
我无法找到调试此异常的在线参考。有没有人遇到过这个?如果是这样,关于什么可能抛出这个例外的任何想法?
我的代码片段:
...
val driver = MongoDriver()
val connection = driver.connection(List("10.211.55.10"))
val db = connection("wordCountDB")
val collection = db[BSONCollection]("counts")
...
提前致谢