10018---solrserver Extension

This document introduces the hybris solrserverextension.

Before Implementing

A hybris extension may provide functionality that is licensed through different hybris modules. 

Make sure to limit your implementation to the features defined in your contractlicense. 

In case of doubt, please contact your hybris Sales representative.

Overview

The solrserver extension includes a standalone Solr server which may be automatically configured, 

started and stopped together with the Platform. This extension is not required by default, 

but it is very convenient for you to enable it in CI or developer environments.

Multiple Solr instances can be created. A Solr instance is a combination of configuration, data and log files. 

Only one Solr server can be started/stopped per instance.

Configuration

Solr Instance Settings

The extension is able to control more than one instance. Each instance has a name and can be configured via properties in the local.properties file. The following properties are available:

Property name
Default value
Description
solrserver.instances.<instance name>.autostart false If set to true, given Solr instance will be started/stopped automatically with the Platform
solrserver.instances.<instance name>.config.dir ${HYBRIS_CONFIG_DIR}/solr/instances/<instance name> Directory that contains Solr instance configuration
solrserver.instances.<instance name>.data.dir ${HYBRIS_DATA_DIR}/solr/instances/<instance name> Directory that contains Solr instance data
solrserver.instances.<instance name>.javaoptions   Additional command line options to be used by the Solr server process
solrserver.instances.<instance name>.log.dir ${HYBRIS_LOG_DIR}/solr/instances/<instance name> Directory that contains Solr instance logs
solrserver.instances.<instance name>.memory 512m The amount of memory (heap) to be used by the Solr server process
solrserver.instances.<instance name>.port 8983 TCP port that is used by Solr server (each instance should use a different port)
Default configuration
solrserver.instances.default.autostart=true
solrserver.instances.default.port=8983
solrserver.instances.default.memory=512m

Solr Server Configuration Files

In order to work properly the Solr server needs some configuration. Each instance will have its own set of configuration files that will be put under the instance configuration directory. Those files will be created automatically when the instance is created. By default it should have a structure similar to the following:



Note

Starting with version 5.7 the log4j.properties file will not be used on windows system. 

This is due to some limitations in the Solr startup scripts. To avoid issues no more than one Solr server should be started per hybris installation.

Controlling a Solr Instance / Server

Solr instances and servers may be controlled:

  • manually by using provided ant tasks;
  • automatically: Solr servers for instances with autostart=true are started when the Spring global context is 
            being initialized and are stopped when the context is being closed.

Algorithm for the Automatic Start of the Solr Server

For each Solr instance:

  1. Check if the corresponding Solr is running. If no, go to step 6.
  2. Check if the running Solr server is the proper one. If not, throw an error.
  3. If forceRestart property is set to false go to step 6.
  4. Stop the Solr server.
  5. Check if the Solr server is properly stopped. If not, throw an error.
  6. Start the Solr server.
  7. Check if the Solr server is properly started. If not, throw an error.


Some parts for the algorithm can be customized via properties in the  local.properties  file. The following properties are available:


Property name
Default value
Description
solrserver.failOnError true If an error occurs during the start of any Solr server, it will be treated as serious error and whole platform will not run.
solrserver.forceRestart true If a proper Solr server is already running when starting the platform, it will be restarted.
solrserver.maxStatusRetries                             10 The maximum number of status checks (e.g. checking if the Solr server is running or stopped). If the maximum is exceeded, an error will be thrown.
solrserver.statusInterval 5000 The interval between status checks.

Available Ant Tasks

The solrserver extension provides some additional ant tasks that can be used to control the Solr instances and servers. By using a parameter it is possible to override some of the instance properties. The default instance name is default. The following ant tasks are available:

Task Name
Description
Parameters
createSolrInstance                                      Creates a Solr instance. allowed parameters: -Dinstance.name -Dinstance.conf.dir -Dinstance.data.dir -Dinstance.log.dir
deleteSolrInstance Deletes a Solr instance. This means deleting all the configuration, data and log files. allowed parameters: -Dinstance.name -Dinstance.conf.dir -Dinstance.data.dir -Dinstance.log.dir
startSolrServer Starts a Solr server. allowed parameters: -Dinstance.name -Dinstance.port -Dinstance.conf.dir -Dinstance.data.dir -Dinstance.log.dir -Dinstance.memory -Dinstance.javaoptions
stopSolrServer Stops a Solr server. allowed parameters: -Dinstance.name -Dinstance.port -Dinstance.data.dir

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值