Documentation Home

Stand Alone Solr Server

It is usually beneficial to use Solr in a stand-alone mode. This is different than using the SolrStarter because it allows Solr to run as a network service on its own or on a shared piece of hardware (separate from a Broadleaf instance). This allows you to scale Solr independently. It allows all of your web application nodes to share a single Solr server.

Installing a Stand Alone Solr Server

In order to use Solr in a stand-alone way, download the latest supported Solr version. As of Broadleaf 6.1.3-GA, the latest supported version of Solr is 7.7.2. Solr distribution Download and unpack it to an appropriate location on the file system. Let's assume this is /path/to/solr-7.7.2.

Once solr is downloaded and unpacked, we can use content from the SolrStarter project to fasttrack the configuration. As of this document writing the latest SolrStarter is 2.2.1-GA. You will need to download the jar (broadleaf-boot-starter-solr-2.2.1-GA.jar) and unzip it to get to the needed contents.

1) Copy the files from the solr standalone directory of the SolrStarter project solr/standalone/solrhome/ into the /path/to/solr-7.7.2/server/solr.

This should copy all the configsets, cores, and the solr.xml that would be needed to start a standalone solr instance. Note that the SolrStarter has the configuration for all indexes that Broadleaf uses but often only the Catalog configuration is needed.

2) Once the configuration is in place, you should be able to start the server. From the /path/to/solr-7.7.2/bin directory you should be able to start it with the command ./solr -p 8983.

To stop Solr, you can cd to /path/to/solr-7.7.2/bin and call ./solr stop -p 8983. This stops the Solr server instance listening on port 8983.

Configuring Broadleaf to use Solr Standalone

There are three properties that define the URLs pointing to the Solr service and drive the SolrClient bean definitions:

  • solr.url.primary=http://host_name_or_ip:8983/solr/catalog
  • solr.url.reindex=http://host_name_or_ip:8983/solr/catalog_reindex
  • solr.url.admin=http://host_name_or_ip:8983/solr

Change the host_name_or_ip to the location of the standalone solr instance. This essentially is the same configuration as the SolrStarter exception we are now referencing a remote server.