我想将Spark Streaming与Standalone Solr集成在一起.我在没有Zookeeper配置的Windows上独立使用Spark 1.6.1和Solr 5.2.通过传递Zookeeper配置,我能够找到一些解决方案,使他们从Spark连接到Solr.如何将Spark程序连接到独立的Solr?
I want to integrate Spark Streaming with Standalone Solr. I am using Spark 1.6.1 and Solr 5.2 standalone on windows with no Zookeeper configuration. I am able to find some solution where they are connecting to Solr from spark by passing the Zookeeper config. How can I connect my spark program to standalone Solr?
推荐答案请查看此示例是否有用 spark.apache/docs/latest/streaming-programming-guide.html#design-patterns-for-using-foreachrdd
Please see if this example is helpful spark.apache/docs/latest/streaming-programming-guide.html#design-patterns-for-using-foreachrdd
从示例中,您将需要编写自己的Connection类,该类包装 HttpSolrClient 或 ConcurrentUpdateSolrClient .您还需要编写自己的ConnectionPool类,该类将实现您自己的Connection对象的池(或者,如果其线程安全,则只需返回相同的单例对象).
From example, you will need to write your own Connection class which wraps object of HttpSolrClient or ConcurrentUpdateSolrClient. You need to also write your own ConnectionPool class which will implement pool of your own Connection objects (or if its thread safe, just return same singleton object).
更多推荐
如何在Windows上将Spark Streaming连接到独立的Solr?
发布评论