Reputation: 61
I am currently building an application that is load-balanced (externally via Apache), which starts an Solr 4.2 instance (or more specifically a CoreContainer). I want to set up a SolrCloud that spans all the instances of my application (with replicas etc.). I know how to set up these servers with the required Zookeeper ensemble etc.
My question pertains to the way that I interact with the SolrCloud. So here it is:
my custom application receives a request and upon this request needs to update information in the SolrCloud
since I started the Solr instance embedded with my application, I could use an EmbeddedSolrServer to interact with the index, but: is this the correct way to interact with the SolrCloud? Or does this approach circumvent the whole clustering approach that Solr takes and I am better off to separate my application from the SolrCloud cluster and use the CloudSolrServer?
Thanks in advance!
Upvotes: 1
Views: 989
Reputation: 3759
Actually there is a way to create an Embedded Solr Cloud in your application using the Solr Tests Module.
<!-- Solr Test Framework -->
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-test-framework</artifactId>
<version>6.6.1</version>
<scope>test</scope>
</dependency>
Check the UT writing by jaihind213 here it very useful.
Upvotes: 0
Reputation: 1174
For debugging purposes alone I prefer not to use EmbeddedSolrServer
. Using the EmbeddedSolrServer
throws a LockObtainFailedException
if you try accessing the index in your application and in the admin console at once.
http://wiki.apache.org/solr/EmbeddedSolr
Upvotes: 1