索引被另一个进程锁定

释放双眼,带上耳机,听听看~!

问题
在CLI中进行完全重新索引时,Adobe Commerce会向您显示错误消息: ‘索引被另一个重新索引进程锁定。 正在跳过。 ​换句话说,当进程或索引类型被锁定时,您将无法重新索引该特定锁定的索引类型。 重新索引将始终跳过该索引类型。

原因
如果上一个索引未成功完成,则可能发生此错误。 可能的原因有:

该进程被另一个进程或用户中断。
内存限制。
MySQL错误,如超时。
重新索引期间出现严重的PHP错误。

重现问题的步骤
例如,假设 bash cataloginventory_stock 索引类型已锁定。
当您尝试通过运行CLI命令重新索引所有数据时
bash php bin/magento indexer:reindex ,
您将获得以下输出结果:
bash customer_grid index has been rebuilt successfully in 00:00:09
catalog_category_product index has been rebuilt successfully in 00:00:07
catalog_product_category index has been rebuilt successfully in 00:00:00
catalogrule_rule index has been rebuilt successfully in 00:00:05
catalog_product_attribute index has been rebuilt successfully in 00:00:04
cataloginventory_stock index is locked by another reindex process. Skipping.
catalog_product_price index has been rebuilt successfully in 00:00:01
catalogrule_product has been rebuilt successfully in 00:00:00
catalogsearch_fulltext index has been rebuilt successfully in 00:00:01
如上所示, bash cataloginventory_stock 已跳过索引过程。
解决方案
您需要重置索引状态,然后尝试运行新的重新索引过程。 对于重置索引状态,您需要运行以下命令:
bin/magento indexer:reset cataloginventory_stock;
如果不确定索引标识符(代码)是什么,可以使用命令列出它们:
bin/magento indexer:info
为了完整起见,下面提供了所有可能的本机索引组合:
bin/magento indexer:reset design_config_grid;
bin/magento indexer:reset customer_grid;
bin/magento indexer:reset catalog_category_product;
bin/magento indexer:reset catalog_product_category;
bin/magento indexer:reset catalogrule_rule;
bin/magento indexer:reset catalog_product_attribute;
bin/magento indexer:reset cataloginventory_stock;
bin/magento indexer:reset catalog_product_price;
bin/magento indexer:reset catalogrule_product;
bin/magento indexer:reset catalogsearch_fulltext;

声明:本站部分文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。部分文章由注册用户发布,版权归原作者所有,本社区不拥有其著作权,亦不承担相应的法律责任,如你发现本社区有涉嫌抄袭的内容,侵犯了原著者的合法权益,可联系我们进行处理。

给TA赞助
共{{data.count}}人
人已赞助
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索