Enabling Solr search sharding within a Kubernetes deployment
Solr search sharding is included as an optional configuration in the HCL Commerce 9.1.16.0 Helm Chart. This enables Solr-based search deployments with large indexes to enable multiple Java Virtual Machines (JVMs) to complete indexing work in parallel, reducing indexing time, and alleviating any resource issues that can be encountered when using a single JVM.
By default, the Helm Chart supports three shards, shardA, shardB and shardC. If additional shards are required, see Adding additional shards to add them manually.
To learn more about Solr search sharding, see Solr search sharding.
Procedure
-
Modify your HCL Commerce Kubernetes deployment configuration to enable
parallel pre-processing and distributed indexing for Solr search.
- Start your HCL Commerce deployment.
-
Modify your
ts-utils
Solr-based search index pre-processing configuration files.Tip: If you want to persist the changes made to your properties files within your Utility server Docker container container, you must build a customizedts-utils
image and use this customized image for your deployment.- Enter the running Utility server Docker container.
- Open the following configuration files for modification:
- /opt/WebSphere/CommerceServer90/properties/parallelprocess/di-parallel-process-multijvms.properties
- /opt/WebSphere/CommerceServer90/properties/parallelprocess/password.properties
- Within di-parallel-process-multijvms.properties:
-
Configure the hostname and port for the individual shard servers as follows.
Each shard server name should be the same as the hostname/alias configured within your deployment.Shard.A.common.index-server-name=shard_a Shard.A.common.index-server-port=3738 … Shard.B.common.index-server-name=shard_b Shard.B.common.index-server-port=3738
Note: Server names within this file are the same as service names.For example:Global.index-server-name=ivtsolrdb2authsearch-app-master.solrdb2.svc.cluster.local Shard.A.common.index-server-name=ivtsolrdb2authsearch-app-shard-a.solrdb2.svc.cluster.local
Where:- The tenant name is
ivt
. - The environment name is
solrdb2
- The environment type is
auth
. - The namespace is
solrdb2
.
- The tenant name is
-
Configure the shard index core directory as follows.
Shard.A.en_US.unstructured-index-core-dir=/shard_a/index/solr/MC_10001/en_US/Unstructured_A/ Shard.A.en_US.structured-index-core-dir=/shard_a/index/solr/MC_10001/en_US/CatalogEntry_A/ … Shard.B.en_US.unstructured-index-core-dir=/shard_b/index/solr/MC_10001/en_US/Unstructured_B/ Shard.B.en_US.structured-index-core-dir=/shard_b/index/solr/MC_10001/en_US/CatalogEntry_B/
Note: The directory should be the absolute path inside each shard container.You can automate the shard configuration process. This is useful if, for example, you expect to create a large number of shards. The auto-sharding process will automatically configure properties such as preprocessing-start-range-value, preprocessing-end-range-value, index-core-name and index-core-dir.
For information on how to set up auto-sharding, see Sharding input properties file.
-
- Within password.properties:
Ensure that the values for dbUserPassword and searchAdminPassword are set correctly.
- Save and close the files.
-
Start the indexing process with sharding in multiple JVMs enabled.
- Navigate to the
/opt/WebSphere/CommerceServer90/bin/
directory. - Run the following
command.
For more information, see Running utilities from the Utility server Docker container../di-parallel-process.sh /opt/WebSphere/CommerceServer90/properties/parallelprocess/di-parallel-process-multijvms.properties
- Navigate to the