我搜索了类似的主题,但似乎没有解决方案可行。有没有办法停止特定的magento索引器进程?
当我尝试从shell重新索引时,我得到了这个:
php -f indexer.php reindex all
Stock Status Index process is working now. Please try run this process later.
Product Prices Index process is working now. Please try run this process later.
Catalog URL Rewrites Index process is working now. Please try run this process later.
Product Flat Data Index process is working now. Please try run this process later.
Category Flat Data Index process is working now. Please try run this process later.
Category Products Index process is working now. Please try run this process later.
Catalog Search Index Index process is working now. Please try run this process later.
Stock Status index was rebuilt successfully
Tag Aggregation Data Index process is working now. Please try run this process later.
当我尝试查看索引器状态时,我得到了这个:
Product Attributes: Pending
Product Prices: Pending
Catalog URL Rewrites: Pending
Product Flat Data: Pending
Category Flat Data: Pending
Category Products: Pending
Catalog Search Index: Pending
Stock Status: Pending
Tag Aggregation Data: Pending
如果我从管理员重新索引,重建索引过程不会引发任何错误。是否有关于此事的一些文件的链接?
谢谢, 拉杜
答案 0 :(得分:22)
在单个HTTP请求期间,主要是索引(通常意味着我很确定它始终是这样)。如果该请求由于PHP错误而停止/超时/失败,则索引器会保留锁定文件,即使没有正在进行索引。这些文件位于
中/path/to/mage/var/locks/index_process*.lock
索引流程现在正在运作。请稍后尝试运行此过程
例外是Magento告诉你它看到了其中一个锁文件。如果您确定没有其他人试图运行索引,只需删除文件并重新启动索引。
答案 1 :(得分:4)
首先,尝试将索引模式设置为手动:
php indexer.php --mode-manual catalog_product_attribute
php indexer.php --mode-manual catalog_product_price
php indexer.php --mode-manual catalog_url
php indexer.php --mode-manual catalog_product_flat
php indexer.php --mode-manual catalog_category_flat
php indexer.php --mode-manual catalog_category_product
php indexer.php --mode-manual catalogsearch_fulltext
php indexer.php --mode-manual cataloginventory_stock
php indexer.php --mode-manual tag_summary
然后,尝试重新索引所有索引:
php indexer.php reindexall
再次将模式设置为实时:
php indexer.php --mode-realtime catalog_product_attribute
php indexer.php --mode-realtime catalog_product_price
php indexer.php --mode-realtime catalog_url
php indexer.php --mode-realtime catalog_product_flat
php indexer.php --mode-realtime catalog_category_flat
php indexer.php --mode-realtime catalog_category_product
php indexer.php --mode-realtime catalogsearch_fulltext
php indexer.php --mode-realtime cataloginventory_stock
php indexer.php --mode-realtime tag_summary
如果这不起作用,请尝试使用sudo /etc/init.d/apache2 restart
之类的东西重启apache。这应该会停止索引过程,之后您可能会再次启动它。但请注意,如果重新启动Apache,您的站点将无法使用几秒钟。
答案 2 :(得分:1)
在最新版本中,锁定文件已更改并在数据库(Magento 1.9)中工作。
登录您的phpMyAdmin,然后运行以下命令。
UPDATE index_process SET status = 'pending' WHERE status = 'working'