Fusion with External Solr Cluster

What are Solr Search Clusters?

In the context of Fusion collection creation, a Solr Search Cluster usually consists of one or more Solr instances that are running independently of the Fusion instance. Fusion’s search cluster API allows these external Solr instances to be registered with the Fusion instance so that requests might be made to the external Solr instances through Fusion.

Why external Solr Search Clusters?

Being able to have a separate Solr instance in addition to the Fusion-embedded Solr instance has its benefits. The separation of concerns which arises from keeping your system collections separate from your Solr collections allow for a more scalable and resourceful configuration.

How to use an external Solr Search Cluster with Fusion:

The best practice is to register a SolrCloud cluster with a Fusion collection instead of a standalone Solr instance. Both are possible; however if you register a standalone Solr instance with a Fusion collection, you lose the ability to manage the collection through Fusion.

Here I provide an example of setting up an external SolrCloud search cluster on a single machine. I use different ports to simulate separate machines. In practice, it is more likely that your external Solr cluster will be running on a separate machine than your Fusion instance.

 

  1. Start Fusion

    bin/fusion start

    With the default Fusion configuration intact, this will start the embedded Solr instance on port 8983


  2. Start your external Solr instance (unless you already have this instance running)

    bin/solr start -c -p 8888

  3. Create a search cluster in Fusion

    Via API:

    curl -u admin:password123 -X POST -H 'Content-type: application/json' -d '{"id":"mySolrCluster", "connectString”:”localhost:9888”, "cloud”:true}’ http://localhost:8764/api/apollo/searchCluster

    In this example, I’m using the Solr-embedded ZK instance and not the typically recommended (for production environments) ZK ensemble. If running an external ZK cluster, the connectString will be a comma-separated list of each server:host on which ZK is configured.

    Response:

    {
    "id" : "mySolrCluster",
    "connectString" : "localhost:9888",
    "cloud" : true,
    "validateCluster" : true

    }

    Via UI (versions 2.x):

    From the Fusion UI select “Applications” in the top right hand corner, then “System”. Navigate to “Solr Clusters” and “New Solr Cluster” to create a new Solr ClusterCreate your Fusion collection on that search cluster.









  4. Create your Fusion collection

    Via API:

    curl -u admin:password123 -X PUT -H 'Content-type: application/json' -d '{"searchClusterId":"mySolrCluster"}'
    http://localhost:8764/api/apollo/collections/newCollection

    Response:
    {
    "id" : "newCollection",
    "createdAt" : "2016-08-01T19:29:05.275Z",
    "searchClusterId" : "mySolrCluster",
    "solrParams" : {
    "name" : "newCollection",
    "numShards" : 1,
    "replicationFactor" : 1
     },
    "type" : "DATA",
    "metadata" : { }

    }

    Via UI:

    From Fusion UI home page click “Add a Collection”. Expand the “Advanced” tab. Enter the new Collection name. Under “Solr Cluster” select the Solr Cluster you previously created. Save the Collection.



  5. Start indexing!

 

How to visualize your search cluster in Fusion:

In the Fusion UI, navigate to “Applications” -> “System” -> “Solr Clusters”. Under your Search Cluster you can access information about cores which were created using that cluster, node health, and general system info.

More documentation about the Search Cluster API in Fusion can be found here: https://doc.lucidworks.com/fusion/2.4/REST_API_Reference/Search-Cluster-API.html

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk