This article talks about solutions for issues caused by incorrect Elasticsearch (ES) installation and configuration.
On Magento Cloud please note that service upgrades cannot be pushed to the production environment without 48 business hours' notice to our infrastructure team. This is required as we need to ensure that we have an infrastructure support engineer available to update your configuration within a desired timeframe with minimal downtime to your production environment. So 48 hours prior to when your changes need to be on production submit a support ticket detailing your required service upgrade and stating the time when you want the upgrade process to start.
Elasticsearch version compatibility with Magento
- Magento Commerce and Magento Commerce Cloud:
- Magento Open Source v2.3.0+ supports ES 5.x and 6.x (but 6.x is recommended).
The following symptoms indicate Elasticsearch is not configured correctly:
Error: No alive nodes in your cluster- this error can appear in Magento logs:
- or in the prompt (when you run a reindex, for example)
- Errors indicating that the Elasticsearch version is not compatible with your current version of Magento (this is a Magento Commerce Cloud specific error):
[YYYY-MM-DD HH:MM:SS] CRITICAL: Fix configuration with given suggestions: - Elasticsearch version #<version> is not compatible with current version of magento Upgrade elasticsearch version to ~5.0
version is the Elasticsearch Service running on the Cloud environment.
Elasticsearch is not installed properly. This could be due to:
- A typo in the configuration file.
- A version in the configuration file that does not match any version of Elasticsearch that is installed for the environment.
- A version that is correctly installed in the environment, correctly configured in the configuration file, but is not a supported version for the currently installed version of Magento.
To correctly set up Elasticsearch:
- Merchants on Magento Commerce Cloud can follow the steps in DevDocs Set up Elasticsearch service.
- Merchants on Magento Commerce and Magento Open Source can follow the steps in DevDocs Install and configure Elasticsearch.
After you have set up Elasticsearch, check that it's configured correctly:
- Log in to your server.
- Check the version number of Elasticsearch (2.x, 5.x, or 6.x) in the output of running the command:
curl -XGET <Elasticsearch hostname>:<Elasticsearch server port>For example, in Magento Cloud Commerce:
curl -XGET localhost:9200
- Check what is configured in Magento Configuration by running the command:
php bin/magento config:show catalog/search
catalog/search/engineand ensure it matches with the Elasticsearch version number. For example, in Magento Cloud Commerce:
- ElasticSearch 5.X - elasticsearch5
- ElasticSearch 6.X - elasticsearch6
- ElasticSearch 2.X - elasticsearch
index_prefix. If you have several environments, make sure you have different
index_prefixvalues for them.