1. Check if ElasticSearch is working and accessible from Magento server
In order to test your connection, log in to your SSH and type
If you get a JSon as response, your elasticsearch is working. Just replace the address and port above as your needs.
2. Check if the setting is correct in Magento
The settings are usually stored in the
core_config_data table. A
SELECT * FROM core_config_data WHERE path like '%elastic%' would be enough to retrieve the data.
It seems obvious, but we have a catch here:
In previous versions of Magento, those values were saved under the prefix
catalog/search/elasticsearch*, but in newer versions the path got a
7 in the end.
Now, the hostname for example, is now saved as
In my case, I spent almost an hour to realize that after restoring an old db dump. I hope now you don't.
And of course, you can also change those values with
bin/magento config:set, as follows:
bin/magento config:set catalog/search/elasticsearch7_server_hostname ELASTIC-HOSTNAME default is
bin/magento config:set catalog/search/elasticsearch7_server_port ELASTIC-PORT default is
and so on as described here.