Gibt es ein Problem, das dringend behoben werden muss?Notfall?Notfallhilfe anfordern →
Blog

Praxisnahe Magento-2-Leitfäden zu Upgrades, Sicherheit, Performance und Migration – geschrieben vom MageBooster-Team.

Magento 2.4.9 OpenSearch: admin settings, port 9200 tests, JVM heap and reindex (Lesson 13)

OpenSearch 3 for Magento 2.4.9: the Catalog Search settings in the admin, tests on port 9200 (_cluster/health, _cat/indices), the JVM heap in jvm.options.d, opensearch.yml basics and a catalog search reindex.
Lektion 13MageBooster-Lektionen · Magento 2.4.9

Magento OpenSearch: admin settings, tests on port 9200, JVM heap

OpenSearch is the search engine behind Magento’s catalog search and layered navigation. In this short lesson: the Catalog Search settings in the admin, three checks on port 9200, the Java heap in jvm.options.d, the basics of opensearch.yml, and a reindex. Every command can be copied or downloaded.

Aktualisiert Oktober 2026Video about 4 minNiveau Entwickler und Server-Admins

Which OpenSearch for 2.4.9

Adobe’s system requirements (checked October 2026) list OpenSearch 3 for Magento Open Source / Adobe Commerce 2.4.9, on-premises and on cloud. Elasticsearch is not listed for 2.4.9 (2.4.8 on-premises still listed Elasticsearch 8; Elasticsearch 7.17 reached end of support on 15 January 2026). So on 2.4.9 the engine is OpenSearch. How we installed OpenSearch 3 on Ubuntu 24.04 is in Lesson 1 and in our installation guide.

Catalog Search in the admin

Stores › Configuration › Catalog › Catalog › Catalog Search, scope Default Config:

FeldWert im VideoHinweis
Search EngineOpenSearchthe engine for 2.4.9
OpenSearch Server Hostname127.0.0.1the same server; otherwise the search server’s private address
OpenSearch Server Port9200OpenSearch’s default HTTP port
OpenSearch Index Prefixmagento2every index starts with it; two shops on one OpenSearch need different prefixes
Enable OpenSearch HTTP AuthNeinYes + username and password when the security plugin is on. Keep them out of screenshots.
OpenSearch Server Timeout15seconds
Test ConnectionSuccessful!tests the values on screen, before you save

Changed a value? Save Config, then reindex (below). The same with config:set:

opensearch-config-set.shDownload

#!/bin/bash
# MageBooster Lesson 13: the admin values of Catalog Search with config:set (Magento folder, as the file owner)
cd /var/www/magento
m() { sudo -u magento bin/magento config:set "$@"; }
m catalog/search/engine opensearch
m catalog/search/opensearch_server_hostname 127.0.0.1
m catalog/search/opensearch_server_port 9200
m catalog/search/opensearch_index_prefix magento2
m catalog/search/opensearch_enable_auth 0
m catalog/search/opensearch_server_timeout 15
# with the security plugin on (OpenSearch on another server): auth 1 + user/password, never typed into a shared terminal history
# m catalog/search/opensearch_enable_auth 1
# m catalog/search/opensearch_username magento
# m catalog/search/opensearch_password "$(cat /root/opensearch-pass.txt)"
sudo -u magento bin/magento indexer:reindex catalogsearch_fulltext
sudo -u magento bin/magento cache:flush

Test on port 9200

On the server, over SSH. Name, cluster name and version:

curl -s localhost:9200

Cluster health: green = every shard is assigned; yellow = all data is there but some replica copies have no second node (normal on a single server); red = data missing, check the log (/var/log/opensearch/).

curl -s 'localhost:9200/_cluster/health?pretty'

The indices: Magento creates one product index per store view (magento2_product_1_v…), with document count and size.

curl -s 'localhost:9200/_cat/indices?v&s=index'

JVM heap

OpenSearch runs on Java; the heap is the memory Java may use. Rules: -Xms = -Xmx (no resizing at runtime), about half the RAM on a server that only runs OpenSearch (the other half is the file system cache, which OpenSearch also uses), and never above about 31 GB (above that Java loses compressed object pointers). On a server shared with Magento, MariaDB, Valkey and Varnish, give it less: our 10 GB test server gets 3 GB.

grep -n '^-Xm' /etc/opensearch/jvm.options; ls /etc/opensearch/jvm.options.d/; free -h

Don’t edit jvm.options: a package update can replace it. Files in /etc/opensearch/jvm.options.d/ are read after it, so their values win:

heap.optionsDownload

# OpenSearch heap: min = max. About half the RAM on a dedicated search server, never above ~31g.
-Xms3g
-Xmx3g

Save as /etc/opensearch/jvm.options.d/heap.options, or create it with the command below.

cat > /etc/opensearch/jvm.options.d/heap.options <<'EOF'
# OpenSearch heap: min = max. About half the RAM on a dedicated search server, never above ~31g.
-Xms3g
-Xmx3g
EOF

Restart, wait until it answers, and check the running node:

systemctl restart opensearch
until curl -s localhost:9200 >/dev/null; do sleep 2; done

curl -s 'localhost:9200/_cat/nodes?v&h=name,heap.max,ram.max'

opensearch.yml

grep -E '^(network\.host|discovery\.type|plugins\.security\.disabled)' /etc/opensearch/opensearch.yml
LineWarum
network.host: 127.0.0.1OpenSearch listens on this server only
discovery.type: single-nodeone node, no cluster to look for
plugins.security.disabled: trueno HTTPS and no login: only acceptable because nobody else can reach port 9200
opensearch.ymlDownload

# /etc/opensearch/opensearch.yml: the lines added in Lesson 1 (OpenSearch on the same server as Magento)
network.host: 127.0.0.1
discovery.type: single-node
plugins.security.disabled: true

ss -ltn | grep 9200

Expect 127.0.0.1:9200 only. Never open port 9200 to the internet. OpenSearch on its own server: keep the security plugin on, use HTTPS, allow only the web server in the firewall, and set HTTP Auth in the admin.

Reindex

After changing the search settings, or when search results look wrong, rebuild the catalog search index as the Magento file owner (in our lessons the user magento), in the Magento folder:

bin/magento indexer:reindex catalogsearch_fulltext

bin/magento indexer:status catalogsearch_fulltext

curl -s 'localhost:9200/_cat/indices?v&s=index'

Downloads

opensearch-commands.shDownload

#!/bin/bash
# MageBooster Lesson 13: OpenSearch for Magento 2.4.9. Run the parts one by one on the server (as root, unless noted).
# 1) Test on port 9200 (on the OpenSearch server itself)
curl -s localhost:9200
curl -s 'localhost:9200/_cluster/health?pretty'
curl -s 'localhost:9200/_cat/indices?v&s=index'

# 2) JVM heap: what is set now, and the RAM of the server
grep -n '^-Xm' /etc/opensearch/jvm.options; ls /etc/opensearch/jvm.options.d/; free -h
# your own heap file (min = max; ~half the RAM on a search-only server, never above ~31g). Change 3g to your value.
cat > /etc/opensearch/jvm.options.d/heap.options <<'EOF'
# OpenSearch heap: min = max. About half the RAM on a dedicated search server, never above ~31g.
-Xms3g
-Xmx3g
EOF
systemctl restart opensearch
until curl -s localhost:9200 >/dev/null; do sleep 2; done
curl -s 'localhost:9200/_cat/nodes?v&h=name,heap.max,ram.max'

# 3) opensearch.yml without comments, and who listens on 9200 (should be 127.0.0.1 only)
grep -E '^(network\.host|discovery\.type|plugins\.security\.disabled)' /etc/opensearch/opensearch.yml
ss -ltn | grep 9200

# 4) Reindex catalog search, as the Magento file owner, in the Magento folder
cd /var/www/magento
sudo -u magento bin/magento indexer:reindex catalogsearch_fulltext
sudo -u magento bin/magento indexer:status catalogsearch_fulltext
curl -s 'localhost:9200/_cat/indices?v&s=index'

Fehlerbehebung

SymptomUrsache und Lösung
Test Connection: Connection failedOpenSearch not running (systemctl status opensearch), wrong host/port, or HTTPS/auth on (OpenSearch 3 package defaults to the security plugin with HTTPS).
curl localhost:9200: empty reply / connection resetThe security plugin is on: OpenSearch answers on https only. Disable it for a localhost-only setup (opensearch.yml) or use https:// with credentials.
OpenSearch does not start after the heap changejournalctl -u opensearch -n 50: heap larger than free RAM, or a typo in heap.options (one option per line).
Status redA primary shard is missing: check /var/log/opensearch/ and disk space (OpenSearch stops writing above the disk watermark).
Search shows old productsbin/magento indexer:reindex catalogsearch_fulltext, and check cron (indexers on schedule).

Nächste Lektion

Lesson 14: Redis / Valkey, for the cache, the full page cache and sessions.

Slow search or a heavy catalog?We tune OpenSearch, Valkey and Varnish for Magento shops.

▶ Alle MageBooster-Lektionen auf YouTube: alle Lektionen der Reihe nach · Kanal abonnieren

Installationsanleitungen: Magento 2.4.9 unter Ubuntu Mage-OS Hyvä
Haben Sie auf dieser Seite einen Fehler entdeckt? Sagen Sie uns Bescheid, wir korrigieren ihn umgehend.

Kostenloser Shop-Audit

Senden Sie uns die Daten Ihres Shops. Wir prüfen Performance, Sicherheit und Extensions und melden uns innerhalb von 3 Werktagen mit drei schnell umsetzbaren Verbesserungen.

Sprechen wir

Angebot anfordern

Erzählen Sie uns von Ihrem Shop – wir antworten innerhalb eines Werktags. Lieber chatten? Schreiben Sie uns auf WhatsApp

MageBooster UnoPim-Demo buchen Sehen Sie UnoPim live mit Produkten wie Ihren. Ein neues PIM oder der Umstieg von Akeneo: Wir antworten mit Plan, Zeitplan und Angebot.
✓ Offizieller UnoPim-Partner✓ KI-Agent für Ihr Team eingerichtet✓ Mit Magento verbunden
MageBooster Hyvä-Projekt starten Neu oder auf Basis Ihres bestehenden Shops. Wir antworten mit Projektplan, Zeitplan und Angebot.
✓ Design und Struktur von uns✓ Hyvä-optimierter Server✓ Bonus-Module inklusive

MageBooster

Wir melden uns bei Ihnen

Hinterlassen Sie Ihre Daten und die Adresse Ihres Shops. Wir sehen uns zuerst Ihren Shop an und melden uns innerhalb eines Werktags, per Telefon, WhatsApp oder E-Mail, ganz wie Sie möchten.

Partner werden