2012-03-29 61 views
14

我已经搜索了类似的主题,但没有解决方案似乎工作。有没有办法阻止特定的magento索引器进程?有没有办法停止magento索引器进程?

当我尝试从外壳重新索引我得到这个:

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 

如果我从管理员重新索引,重新编制过程中抛出没有错误。是否有链接到这方面的一些文件?

感谢, 拉杜

回答

3

首先,尝试索引模式设置为手动:

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,您的站点将不能使用几秒钟。

+0

重启动Apache没有帮助。 – Mike 2015-05-13 17:41:26

22

在单个HTTP请求期间,大多数情况下都会进行索引(主要是指我非常确定它总是)。如果该请求由于PHP错误而停止/超时/失败,则索引器会留下锁定文件,即使没有编制索引。这些文件位于

/path/to/mage/var/locks/index_process*.lock 

现在的

指数过程工作。请稍后尝试运行此过程

异常是Magento告诉你它看到其中一个锁定文件。如果您确定没有其他人试图运行索引,只需删除这些文件并重新启动索引。

+1

我咨询了'top',如果它没有显示lsphp5会话(LiteSpeed WS)以相当高的速度并且持续不断地进行计时,那么我知道没有索引进程实际上正在运行。下一步是删除锁定文件并分别通过命令行运行每个reindex,以确保所有运行完成,避免资源耗尽和过早失败的会话。它在各种Magento操作过程中支付“顶部”费用,以便您知道正常的处理器使用情况,然后这变成一个简单的诊断。 – 2012-03-30 01:08:07

+1

艾伦,如果你可以请把一些关于magento的索引过程。我开始了一个索引过程(目录搜索索引),并通过关闭浏览器来停止。现在理想情况下,它也应该终止后面的php进程,但是当我检查mysql processlist ouptut时,它暗示magento仍然在后台索引,索引仍然在后台运行,当我看到solr文件也在更新时,得到确认。我不明白magento如何设法保持流程运行。该站点处于暂停状态,所以没有人从shell或浏览器启动索引。 – anshuman 2012-10-31 10:26:00

+0

这个路径中有** NO **锁定文件夹'/ path/to/mage/var /' – 2015-10-06 06:03:39

相关问题