How to run a solr server in hybris 5.7 offline?
In hybris\bin\ext-commerce\solrserver\resources\solr\bin
execute solr start
.
Note that this is the path from version 6. The installation directory may differ, this is where the Solr installation package was removed.
Take a look at the README in solr / server for details on config, log dir, etc.
Also take a look solr -help
Usage: solr COMMAND OPTIONS where COMMAND is one of the following: start, stop, restart, health check, create, create_combination, create_collection, delete, version, upconfig, downconfig
An example of a stand-alone server (Solr starts in the background on port 8984): solr start -p 8984
SolrCloud example (running Solr in SolrCloud mode using localhost: 2181 to connect to Zookeeper, with 1g max heap size and remote Java debug options):
solr start -c -m 1g -z localhost: 2181 -a "-Xdebug -Xrunjdwp: transport = dt_socket, server = y, suspend = n, address = 1044"
Pass -help after any COMMAND to see information about using a specific command, such as: solr start -help or solr stop -help
source to share
In addition to the subtle answers above, let me mention all the steps required to set up a standalone Solr server in SAP Hybris.
Prerequestion
- the extension
solrserver
must be in your filelocalextensions.xml
Hybris OOTB Solr Configuration Interface
The default configuration is as follows:
solrserver.instances.default.autostart=true
solrserver.instances.default.mode=standalone
solrserver.instances.default.hostname=localhost
solrserver.instances.default.port=8983
solrserver.instances.default.memory=512m
Here you can see autostart=true
which tells the Solr server to start and stop along with the Hybris platform.
Configuring an external stand-alone server
We want to start / stop it independently of the Hybris instance. To do this, we need to disable autoplay for the default Solr instance using the following properties.
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
How to start / stop solr server
You can just use ant commands to start and stop the solr server
ant startSolrServer
ant stopSolrServer
Hybris OOTB, you can find the solr setting at hybris/bin/ext-commerce/solrserver/resources/solr/
. Now go to the folder bin
, there you can also run the solr script manually as below.
Solr Server Launch
./solr start -p 8983 #Linux systems
solr.cmd start -p 8983 #Window system
Stop solr server
./solr stop -p 8983 #Linux systems
solr.cmd stop -p 8983 #Window system
Find detailed post here
source to share