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.
Navigate to Martini's
Open your instance properties file and edit the
This property value should be
cloudto 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.serverinstance property value to
The comma-separated IP addresses of the ZooKeeper instances in your ZooKeeper ensemble.
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
Restart your Martini instance. This time, it should connect to your SolrCloud cluster.
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!