Magento 2.4 will not install or index catalog search without Elasticsearch or OpenSearch. A refused connection, an empty reply, security_exception, and FORBIDDEN/12 are different faults. Read the body of the error before you change Magento. When that body is one long JSON line, paste it into the JSON Formatter and read the reason field.

Adobe’s current on-premises table lists OpenSearch 3 for Commerce 2.4.9, and both Elasticsearch 8 and OpenSearch 3 for the 2.4.8 patch line. Cloud has moved harder toward OpenSearch. Match the table for your version instead of keeping whatever 7.x or 8.17 binary happened to be installed last year.
| What you see | What it means |
|---|---|
curl: (7) Failed to connect to localhost port 9200: Connection refused |
Nothing is listening. The service is stopped, bound to another interface, or using another port. |
Empty reply from server while the port is open |
A process accepted TCP and closed it. Common when you send HTTP to an Elasticsearch 8 port that expects HTTPS. |
security_exception |
The cluster requires authentication or TLS and the request did not satisfy it. |
cluster_block_exception … FORBIDDEN/12/index read-only / allow delete |
Elasticsearch marked indexes read-only because a node crossed the flood-stage disk watermark. |
Java failing to start, then a later empty reply, is the first row followed by a half-started process. Fix startup before you touch Magento config.
curl -sS -D- http://127.0.0.1:9200
curl -sS -k https://127.0.0.1:9200
Elasticsearch 8 enables security and HTTPS by default. A successful body contains "tagline" and a version number. If only the https URL works, Magento’s search hostname, port, and “Enable HTTPS” must match that URL.
php bin/magento config:show catalog/search/engine
php bin/magento config:show catalog/search/elasticsearch7_server_hostname
php bin/magento config:show catalog/search/opensearch_server_hostname
On 2.4.6 and later the engine value is opensearch or an elasticsearch id, and the hostname fields are separate. An old elasticsearch7_* value left behind does not configure an OpenSearch server.
Windows: install Elasticsearch as a service only if you accept the RAM it reserves. A laptop that cannot give the JVM its heap will log a startup failure and never open 9200. Lowering the heap in jvm.options (-Xms and -Xmx together) is the documented way to fit a dev box. It does not fix a cluster that is up but read-only.
journalctl -u elasticsearch or journalctl -u opensearch. On Windows, the Elasticsearch log folder next to the install.127.0.0.1 is correct for a local Magento. A bind of a public IP is not required and should not be open to the internet.php bin/magento cache:flush config
php bin/magento indexer:reindex catalogsearch_fulltext
Create a user that can read and write the Magento indexes, and put that user in Magento’s search configuration (Admin: Stores → Configuration → Catalog → Catalog Search, or config:set for the username and password). Do not turn security off on a server other than a disposable laptop. If you do disable it locally, say so in the install notes so nobody copies that elasticsearch.yml to production.
Test with the same credentials Magento will use:
curl -sS -k -u 'USER:PASSWORD' https://127.0.0.1:9200
A 401 means the password is wrong. A security_exception about indices means the user is authenticated and not allowed to touch that index.
Elastic’s watermark guide describes the flood-stage behavior: at about 95% disk the cluster sets index.blocks.read_only_allow_delete. Deletes of whole indexes are still allowed. Document deletes are not. Magento indexing then fails even though search used to work. The illustrated response uses HTTP 403. Look that code up in the HTTP Status Code Lookup. Here 403 is the read-only block, not an admin login failure.
curl -sS -k -u 'USER:PASSWORD' -X PUT "https://127.0.0.1:9200/_all/_settings" \
-H 'Content-Type: application/json' \
-d '{"index.blocks.read_only_allow_delete": null}'
Run that only after you know why the disk filled. Clearing the block on a full disk puts it back on the next write.
Do not disable cluster.routing.allocation.disk.threshold_enabled to hide the error. Elastic’s own issue discussion notes that turning thresholds off also stops the automatic unlock.
indexer:reindex catalogsearch_fulltext finishes without cluster_block_exception.No. Elasticsearch sets that block when a node crosses the flood-stage disk watermark. Free disk first.
Elasticsearch 8 often listens with HTTPS and security on. Try https before you change Magento.
No. Create a user that can write the Magento indexes and put that user in the catalog search settings.