Acil müdahale gerektiren bir sorununuz mu var?Acil müdahale mi?Acil yardım alın →
Blog

MageBooster ekibinden upgrade, güvenlik, hız ve taşıma üzerine pratik Magento 2 rehberleri.

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.
Ders 13MageBooster Dersleri · 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.

Güncelleme Ekim 2026Video about 4 minSeviye Geliştiriciler ve sunucu yöneticileri

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:

AlanVideodaki değerNot
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 AuthHayırYes + 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.shİndir

#!/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.optionsİndir

# 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
LineNeden
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.ymlİndir

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

İndirmeler

opensearch-commands.shİndir

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

Sorun giderme

BelirtiNeden ve çözüm
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).

Sonraki ders

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.

▶ Tüm MageBooster derslerini YouTube’da izleyin: sırayla tüm dersler · kanala abone olun

Bu sayfada bir hata mı gördünüz? Bize bildirin, hemen düzeltelim.

Ücretsiz Site Analizi

Mağaza bilgilerinizi gönderin. Hız, güvenlik ve eklentileri inceleyip 3 iş günü içinde hemen uygulayabileceğiniz üç iyileştirme önerisiyle size dönelim.

Konuşalım

Teklif alın

Mağazanızdan bahsedin, bir iş günü içinde size dönelim. Sohbet etmeyi mi tercih edersiniz? WhatsApp'tan yazın

MageBooster UnoPim demosu talep edin UnoPim’i sizinkine benzer ürünlerle canlı görün. Yeni bir PIM ya da Akeneo’dan geçiş: plan, zaman çizelgesi ve teklifle dönüyoruz.
✓ Resmi UnoPim partneri✓ Ekibiniz için yapay zeka asistanı✓ Magento’ya bağlı
MageBooster Hyvä projenizi başlatın Sıfırdan ya da mevcut mağazanızdan. Proje planı, zaman çizelgesi ve teklifle dönüyoruz.
✓ Tasarım ve kurgu bizden✓ Hyvä’ya optimize sunucu✓ Bonus modüller dahil

MageBooster

Size ulaşalım

Bilgilerinizi ve mağaza adresinizi bırakın. Önce mağazanıza bakıyoruz, ardından bir iş günü içinde tercih ettiğiniz yoldan, telefon, WhatsApp ya da e-posta ile size ulaşıyoruz.

Partnerimiz olun