Steps to create a solr cluster
- Make the following properties to make sure that the solr server does not start when hybris started
solrserver.instances.default.autostart=false
solrserver.instances.standalone.autostart=false
- Copy the contents of directory hybris\bin\ext-commerce\solrserver\resources\solr to master, slave1 & slave2
- Make the following change in the file master\server\solr\configsets\default\conf\solrconfig.xml
<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</str>
</lst>
</requestHandler >
- Make the following change in the file slave1\server\solr\configsets\default\conf\solrconfig.xml & slave2\server\solr\configsets\default\conf\solrconfig.xml
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="slave">
<str name="masterUrl">http://localhost:18984/solr/${solr.core.name}/replication</str>
<str name="pollInterval">00:00:60</str>
</lst>
</requestHandler>
- Go to master\bin directory and start the master solr server giving the command solr.cmd/solr.sh start -p 18983
- Go to slave1\bin directory and start the slave solr server giving the command solr.cmd/solr.sh start -p 18984
- Go to slave2\bin directory and start the slave solr server giving the command solr.cmd/solr.sh start -p 28984
- Update the Solr server configuration using the Back office Administration Cockpit
The most important attributes you should consider are:
- Mode: set it to standalone.
- Endpoint URLs: should contain a single master URL with the the following values http://:18983/solr and list of slave urls http://:18984/solr, http://:28984/solr
Points to Note
- When you are adding a new solr cluster slave to the cluster after making the changes in the SolrConfiguration from the back office you can do a reindex so that the new added node will be having the solr index details copied otherwise the cores from master will not be copied to the newly added slave.
- Apache Solr does not have a built-in security mechanism. As a consequence, any Solr server must not be reached from the outside world and hence must be placed in a DMZ behind a firewall.
- There are 4 solr index operations and the IndexType object contains the different index queries
- FULL: recreates the index, all items will be indexed based on a FULL index query;
- UPDATE: updates some documents in the index. Items to be indexed/updated are typically selected by an UPDATE query;
- PARTIAL_UPDATE: similar to the UPDATE operation but allows to select the fields to be updated (for faster updates);
- DELETE: deletes documents from the index. Items to be deleted are typically selected by a DELETE query.
- There are 2 indexing mode for the FULL Operation
- DIRECT: indexing occurs directly on the live index. New and updated documents are marked and old ones are removed after a successful operation;
- TWO_PHASE: indexing occurs on a temporary index. After a successful operation, the temporary index replaces the current live one.
No comments:
Post a Comment