Solr Server Installation for Standalone Mode
Learn how to install and configure a standalone Solr server in a way that can be used in SAP Commerce.
Quick Installation and Configuration
Context
Follow the steps for a quick installation and configuration of the solr server on your local machine.
Procedure
Solr Server Installation
Using the solrserver Extension
By enabling the solrserver extension in your localextensions.xml file, you get a Solr server instance ready to be used. The default configuration ensures that a standalone Solr server is configured, started and stopped together with the platform. This is convenient in CI or developer environments. Note that the mode property should be set to standalone.
# disables the autostart for the default Solr instance solrserver.instances.default.autostart=false solrserver.instances.standalone.autostart=true solrserver.instances.standalone.mode=standalone solrserver.instances.standalone.hostname=localhost solrserver.instances.standalone.port=8983 solrserver.instances.standalone.memory=512m
Using an External Standalone Server
Each version of SAP Commerce can support more than one Solr version to maintain compatibility. Each version includes the server directory that contains the server and the applied customizations, and the customizations directory that contains modifications that can be applied to an official Solr release. For the installation steps, see the Installation section in Multiple Solr Version Support.
-
On Linux systems:
# ./bin/solr start -p 8983 Waiting up to 30 seconds to see Solr running on port 8983 [/] Started Solr server on port 8983 (pid=23092). Happy searching! # ./bin/solr stop -p 8983 Sending stop command to Solr running on port 8983 ... waiting 5 seconds to allow Jetty process 23092 to stop gracefully.
-
On Windows systems:
# bin\solr.cmd start -p 8983 Waiting up to 30 to see Solr running on port 8983 Started Solr server on port 8983. Happy searching! # bin\solr.cmd stop -p 8983 Stopping Solr process 6256 running on port 8983 Waiting for 0 seconds, press a key to continue ...
Cluster Configuration
-
You have a high system load caused by searches and you want to balance the load among several servers
-
Indexing consumes many resources, so you need to separate indexing and searching
In a cluster configuration, there’s a leading server where indexing happens, and one or more subordinate servers. All indexes on the leading server are replicated to each one of the subordinate servers so that both leading and subordinate servers have the same indexes.
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<!--
To enable simple master/slave replication, uncomment one of the
sections below, depending on whether this solr instance should be
the "master" or a "slave". If this instance is a "slave" you will
also need to fill in the masterUrl to point to a real machine.
-->
<lst name="master">
<str name="replicateAfter">commit</str>
<str name="replicateAfter">startup</str>
<str name="confFiles">schema.xml,stopwords.txt,synonyms.txt</str>
</lst>
<!--
<lst name="slave">
<str name="masterUrl">http://your-master-hostname:port/solr/${solr.core.name}/replication</str>
<str name="pollInterval">00:00:60</str>
</lst>
-->
</requestHandler>
-
local.properties file:
solrserver.instances.master.autostart=true solrserver.instances.master.mode=standalone solrserver.instances.master.hostname=localhost solrserver.instances.master.port=8983 solrserver.instances.master.memory=512m solrserver.instances.slave.autostart=true solrserver.instances.slave.mode=standalone solrserver.instances.slave.hostname=localhost solrserver.instances.slave.port=8984 solrserver.instances.slave.memory=512m
-
config/solr/instances/master/configsets/default/conf/solrconfig.xml file:
<requestHandler name="/replication" class="solr.ReplicationHandler" > <lst name="master"> <str name="replicateAfter">commit</str> <str name="replicateAfter">startup</str> <str name="confFiles">schema.xml,stopwords.txt,synonyms.txt</str> </lst> </requestHandler> -
config/solr/instances/slave/configsets/default/conf/solrconfig.xml file:
<requestHandler name="/replication" class="solr.ReplicationHandler" > <lst name="slave"> <str name="masterUrl">http://your-master-hostname:port/solr/${solr.core.name}/replication</str> <str name="pollInterval">00:00:30</str> </lst> </requestHandler>
SAP Commerce Configuration in Backoffice Administration Cockpit
Update the Solr server configuration using the Backoffice Administration Cockpit.
-
Mode: set it to standalone.
-
Endpoint URLs: for URLs of the servers that are part of the cluster - one of them should be set as master, for example, http://master:8983/solr, http://slave:8983/solr.