Is er een probleem dat snel moet worden opgelost?Spoedfix nodig?Vraag spoedhulp aan →
Blog

Praktische Magento 2-gidsen over upgrades, beveiliging, snelheid en migratie, geschreven door het 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.
Les 13MageBooster-lessen · 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.

Bijgewerkt Oktober 2026Video about 4 minNiveau Developers en serverbeheerders

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:

VeldWaarde in de videoOpmerking
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 AuthNeeYes + 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.shDownloaden

#!/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.optionsDownloaden

# 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
LineWaarom
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.ymlDownloaden

# /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.shDownloaden

#!/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'

Problemen oplossen

SymptoomOorzaak en oplossing
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).

Volgende les

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.

▶ Bekijk alle MageBooster-lessen op YouTube: alle lessen op volgorde · abonneer je op het kanaal

Zie je een fout op deze pagina? Laat het ons weten, dan passen we het meteen aan.

Gratis webshop-audit

Stuur ons de gegevens van je webshop. We controleren snelheid, beveiliging en extensies en sturen je binnen 3 werkdagen drie quick wins.

Laten we praten

Vraag een offerte aan

Vertel ons over je webshop, dan reageren we binnen één werkdag. Liever chatten? Stuur ons een WhatsApp

MageBooster Boek een UnoPim-demo Bekijk UnoPim live met producten zoals de jouwe. Een nieuwe PIM of een overstap van Akeneo: we sturen je een plan, een planning en een offerte.
✓ Officiële UnoPim-partner✓ AI-agent ingericht voor je team✓ Gekoppeld aan Magento
MageBooster Start je Hyvä-project Vanaf nul of vanuit je huidige webshop. We reageren met een projectplan, een tijdlijn en een offerte.
✓ Design en structuur door ons✓ Voor Hyvä geoptimaliseerde server✓ Bonusmodules inbegrepen

MageBooster

Wij nemen contact met je op

Laat je gegevens en het adres van je webshop achter. We bekijken eerst je webshop en nemen binnen één werkdag contact op, via telefoon, WhatsApp of e-mail, wat jij het liefst hebt.

Word partner