Setting up Elasticsearch (Plesk)
Create Docker Container
⚠️ Important Note: A Nexus account is strictly required to perform this step. If you do not have access, please ask an authorized person to handle this task.
Initialize Docker Container
Follow these steps to deploy the OpenSearch container in Plesk:
- Log in to the Plesk server via Nexus.
- Click on the Docker menu item in the left sidebar.
- Start creating a new container by clicking the
+symbol. - Select
opensearch/opensearchas the container image. Note: If the image is not immediately available for selection, use the search bar at the top to find it. - Ensure that the tag
latestis selected as the Image Version.
Configuration
General
Configure the container using the following settings:
| Configuration | Value |
|---|---|
| Containername | opensearch_(project_name) |
| Memory Limit | Yes - 2048 MB |
| Automatic Port Mapping | No |
| Manual Mapping 9200 | Something High - Has to be unused (check other containers) |
| Manual Mapping 9300 | Something High - Has to be unused (check other containers) |
| Manual Mapping 9600 | Something High - Has to be unused (check other containers) |
| Manual Mapping 9650 | Something High - Has to be unused (check other containers) |
A good strategy to find free ports is to change the 9 to a higher number, for example, 18, and then add a small number at the end. For example, 9200 becomes 18206.
Volume Mapping
Left: [Root of shop-domain]/docker/open-search or something similar. Folder needs to be created. Set Permissions to 777.
Right: /usr/share/opensearch/data
Environment Variables
| Configuration | Value |
|---|---|
| PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/share/opensearch/jdk/bin:/usr/share/opensearch/bin |
| JAVA_HOME | /usr/share/opensearch/jdk |
| LD_LIBRARY_PATH | /usr/share/opensearch/plugins/opensearch-knn/lib |
| discovery.type | single-node |
| plugins.security.ssl.http.enabled | false |
| OPENSEARCH_INITIAL_ADMIN_PASSWORD | admin |
| DISABLE_SECURITY_PLUGIN | true |
| DISABLE_INSTALL_DEMO_CONFIG | true |
| OPENSEARCH_JAVA_OPTS | -Xms2g -Xmx2g |
Configure Elasticsearch in Shopware
In the shops .env:
YOUR_PORT relates to the port you mapped Port 9200 to in the General Configuration above.
OPENSEARCH_URL=http://localhost:YOUR_PORT
ADMIN_OPENSEARCH_URL=http://localhost:YOUR_PORT
ES_MULTILINGUAL_INDEX=1
SHOPWARE_ES_ENABLED=1
SHOPWARE_ES_INDEXING_ENABLED=1
SHOPWARE_ES_INDEX_PREFIX=YOUR_PROJECT_NAME