Skip to main content
Version: 8.8.x

Search-Primary Container

The Search Primary Server indexes Commerce data using Apache Solr and makes the data available for the Search Secondary Servers. For more information about the Search application, see Search Server in Self-Managed Commerce.

Prerequisites​

The search container image must be built and available. For information on building container images, see Building Container Images.

Suitable Environment Types​

The Search-Primary application is a core application and is always deployed.

Include in Development and QA Environments?Include in Authoring Environments?Include in Live Environments?
YesYesYes

Configuration​

The sections below describe typical configurations.

Container user​

The application container images are built to be run as user app_runner (user ID 10001), with user group app_runner (group ID 10001). Ensure that you specify the correct user and group when you run the container. Volumes should also be readable and writeable by this user. Consult your container orchestration documentation for more information.

tip

Below is an example security context snippet for a Kubernetes deployment.yaml file.

securityContext:
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001

Note about production sizing and tuning​

The values shared in this document are suggestions that are known to work well in typical scenarios.

important

Planning and validation is required to finalize resource and scaling settings for production. The settings should be reviewed and re-validated periodically, such as when significant Commerce application changes are deployed or when traffic and load requirements change. For more information, see the Self-Managed Commerce Sizing Guide.

Resource allocation​

Resource allocation can vary by usage and load. Below are typical values.

ResourceNon ProductionProduction Like (See Note)
Container Memory (MB)30723072
Container Cores0.53
Java Heap (MB)20482048

Scaling and replicas​

This service is a singleton and should not be scaled.

ConfigurationNon ProductionProduction Like (See Note)
Minimum Replicas11
Maximum Replicas11
Max Surge (%)25100
Max Unavailable (%)250

Ingresses​

The table below describes the ingress requirements for this service.

PortNon ProductionProductionPurposeComment
8080YesYesExposes the search data and services.This port must be accessible to all of the search-secondary containers in the Commerce environment, and can be exposed to developer and administrators to view status information about of the application and the indices.
8180YesYesHealth and liveness checks.This port should only be exposed internally, ideally only to the container orchestrator.
8888OptionalOptionalJMX.The container listens on this port when the ENABLE_JMX environment variable is set to true. This port should only be exposed internally to users and tools that require access to JMX data.
1081OptionalNoJava debugger.The container will listen on this port when the ENABLE_DEBUG environment variable is set to true. This port should only be exposed internally, to developers who debug Java application code. This port is typically not open in production.

Egresses​

The table below describes the egress requirements for this service.

EndpointPurposeComment
Commerce JDBC endpointCommerce databaseThis service must be able to access the Commerce database.
Commerce JMS endpointJava Messaging ServiceThis service must be able to access the JMS service for messaging, which is typically ActiveMQ.
Git ServiceOptional: inject config at start-upThe service can optionally be configured to inject config files from a secured Git project at startup time. If that is configured then the container must be able to connect to the Git project specified in environment variable EP_COMMERCE_CONFIG_REPO. For more information about secure configuration, see Injecting Commerce Configuration at Startup.

Health, Liveness and Readiness​

Container orchestration tools monitor the health and responsiveness of containers. For information about supported endpoints, see Health Monitoring Usage.

Volumes​

Mount PointPurposeComment
/ep/solrHome-master/dataStore search index data.The file system should be available wherever the search-primary container is scheduled. If the container restarts on a different compute node, the file system should be available so the search index data does not need to be recreated. 100GB is the recommended size.
/hdumpStore Java heap dump files, which are created when a Java OutOfMemoryError occurs, on a filesystem that persists after the container dies. These files are large but can be very helpful to diagnose Java memory usage issues.Each heap dump file can be multiple gigabytes in size so it is important to ensure that the filesystem is large and regularly maintained so that it does not fill up. Consider using a shared filesystem across all containers for this purpose.

Environment Variables​

The application is configured using container environment variables. Some environment variables must be set and some are optional. The environment variables are read and consumed by the container entrypoint scripts. Review Common Environment Variables for a list of required and optional environment variables that are common to all Commerce application services.

The following table shows additional environment variables specific to this service:

Variable NameDescriptionRequired
EP_SEARCH_ROLEOn the primary, set this to: master.Yes
EP_SEARCH_MASTER_URLUsed to set the Java property ep.search.master.url. It should be a valid URL that refers to the search service on the search primary. An example is http://searchmasterhostname:8082/search.Yes
EP_SEARCH_X_JVM_ARGSCan be used to set additional custom Java arguments.No
EP_CONTAINER_MEM_SEARCHUsed to set the Java heap size on the search leader. Both the initial heap (Xms) and maximum heap (Xmx) are set to this value.Yes
important

The entrypoint scripts are and will remain the source of truth on the required environment variables. Review the container entrypoint scripts in your selected release to validate the required variables.