Skip to content

Home

Introduction

Development

IDEs

Services

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

Connecting to SolrCloud

The ability to connect Martini to a SolrCloud cluster is an already built-in feature. It will take just a few, simple configuration changes. Before doing this however, you should ensure that connecting to SolrCloud is supported by your Martini license.

Procedure

  1. Navigate to Martini's data directory.

    1
    cd <martini-home>/data
    
  2. Open your instance properties file and edit the solr.mode, solr.url, and solr.prefix properties.

    • solr.mode

      This property value should be cloud to tell Martini we'll be using SolrCloud. It triggers Martini to use the delegating version of Solr. That is, Martini will iterate through a list of declared Solr servers and use the first server that successfully connects to a Solr core.

      Delegating Solr servers

      Martini also ships with a built-in feature that allows it to use an embedded Solr server in place of the cloud or remote Solr cluster when the latter is unavailable.

      This feature is turned off, by default, but you can turn it on by setting the solr.embedded.delegate.server instance property value to true.

    • solr.url

      The comma-separated IP addresses of the ZooKeeper instances in your ZooKeeper ensemble.

    • solr.prefix

      The prefix of your collection names.

    Here's how we did ours:

    1
    2
    3
    solr.mode=cloud
    solr.url=192.168.21.71:2181,192.168.21.72:2181,192.168.21.73:2181
    solr.prefix=jte
    
  3. Restart your Martini instance. This time, it should connect to your SolrCloud cluster.

    1
    2
    cd <martini-home>/bin/
    ./toro-martini start
    

    While Martini is starting, check the logs to see if the collections have been initialized properly. You should see something similar to the logs below if Martini was able to communicate properly with the SolrCloud cluster:

    1
    2
    3
    4
    25/04/18 08:56:49.977 INFO  [CloudSolrClient] Starting core: 'invoke_monitor'
    25/04/18 08:56:50.037 INFO  [CloudSolrClient] Starting core: 'invoke_monitor' completed
    25/04/18 08:56:49.402 INFO  [CloudSolrClient] Starting core: 'tracker'
    25/04/18 08:56:49.963 INFO  [CloudSolrClient] Starting core: 'tracker' completed
    

That's it! Your Martini instance is now using the SolrCloud cluster that you have just configured!