2012-03-29 81 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

相關問題