Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento 2.4 reindex issue with elasticsearch

I have installed an elastic search(7.x) with Magento2.4 and I am using PHP 7.3 When I run the reindex command(bin/magento indexer:reindex) getting the following error.

Catalog Search index process unknown error: {"error":{"root_cause":[{"type":"cluster_block_exception","reason":"index [magento2_product_1_v1] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"}],"type":"cluster_block_exception","reason":"index [magento2_product_1_v1] blocked by: [TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark, index has read-only-allow-delete block];"},"status":429}

If anyone resolved this issue? Please let me know.

Thanks.

like image 214
Emily Avatar asked Sep 01 '20 14:09

Emily


People also ask

Does Magento 2.4 require elasticsearch?

As of Adobe Commerce and Magento Open Source 2.4, all installations must be configured to use Elasticsearch or OpenSearch as the catalog search solution.

How do I force reindex in Magento 2?

Reindexing via Magento 2 Admin Log in to Magento 2 Admin and navigate to System → Index Management. You will see the panel above. Select indexers, which has status Reindex Required, then select in Actions menu Update on Schedule. Press Submit button to apply selected mode to indexers.

What is elasticsearch index prefix Magento 2?

Elasticsearch index prefix Magento 2 option means that you need to enter an Elasticsearch index prefix. If you use one Elasticsearch instance for more than one Magento installation, specify a unique prefix for each installation. If not, use the default magento2 prefix.

Why do we do Reindexing in Magento 2?

When the data changes, the transformed data must be updated or reindexed. With the support of reindexing, Magento 2 store owners can quickly and correctly change the store data, reduce the waiting time of customers, and increase the conversion rate.


Video Answer


2 Answers

Just execute the following commands in the command line:

curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings -d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }'

curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

This configures your ES installation to work properly with Magento 2.

Taken from: https://www.magemonkeys.com/how-to-solve-cluster_block_exception-too_many_requests-12-disk-usage-exceeded-flood-stage-watermark-index-has-read-only-allow-delete-block-in-magento-2/

like image 77
Louis B. Avatar answered Oct 16 '22 14:10

Louis B.


Background of the issue

As ES heavily depends on the Disk space to function properly(ES stores index on file system), there are several disk watermark threshold to protect the ES cluster and you reached the highest threshold called flood which can cause important functionality in cluster to break (allocating new shards, index to name a few).

How to fix the issue

There are multiple ways to fix the issue temporary or permanent with different trade-offs, I've written a detailed post explaining the issue and various fixes Please have a look and choose what suited best for you.

like image 3
Amit Avatar answered Oct 16 '22 16:10

Amit