Is there a problem that needs an urgent fix?Urgent fix?Get emergency help →
Blog

Practical Magento 2 guides on upgrades, security, speed and migration, written by the 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.
Lesson 13MageBooster Lessons · 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.

Updated October 2026Video about 4 minLevel Developers and 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:

FieldValue in the videoNote
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 AuthNoYes + 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
LineWhy
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'

Troubleshooting

SymptomCause and fix
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).

Next lesson

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.

▶ Watch every MageBooster lesson on YouTube: all lessons in order · subscribe to the channel

Installation guides: Magento 2.4.9 on Ubuntu Mage-OS Hyvä
Spotted a mistake on this page? Tell us and we will fix it right away.

Free Site Audit

Send your store details. We check speed, security and extensions, then reply with three quick wins within 3 working days.

Let's talk

Get a quote

Tell us about your store and we’ll reply within one working day. Prefer to chat? Say hello from WhatsApp

MageBooster Book a UnoPim demo See UnoPim live with products like yours. A new PIM or a move from Akeneo: we reply with a plan, a timeline and a quote.
✓ Official UnoPim partner✓ AI agent set up for your team✓ Connected to Magento
MageBooster Start your Hyvä project From scratch or from your current store. We reply with a project plan, a timeline and a quote.
✓ Design and structure by us✓ Hyvä-optimised server✓ Bonus modules included

MageBooster

Let us get in touch with you

Leave your details and your store address. We look at your store first and contact you within one business day, by phone, WhatsApp or email, whichever you prefer.

Partner with us