好的,我在我們的服務器上有一個rails應用程序,我安裝了thinking shinx。這裏上午12:30我每天運行截斷客戶和聯繫人表,並重新插入它們cron作業...是我crons思考獅身人面像 - 當我嘗試重新索引時出錯?
30 0 * * * /bin/bash -l -c 'cd /var/www/active && script/rails runner -e production '\''Account.db_insert'\$
34 0 * * * /bin/bash -l -c 'cd /var/www/active && RAILS_ENV=production bundle exec rake ts:index --silent'
34 0 * * * /bin/bash -l -c 'cd /var/www/active && RAILS_ENV=production bundle exec rake ts:restart --silent'
正如你可以看到crons執行其重新插入聯繫人和客戶,但Account.db_insert
每天我收到一封電子郵件,錯誤....這裏有兩個是我最近買了....
昨天的錯誤
using config file '/var/www/active/config/production.sphinx.conf'...
indexing index 'contact_core'...
FATAL: failed to lock /var/www/active/db/sphinx/production/contact_core.spl: Resource temporarily unavailable, will not index. Try --rotate option.
今天的錯誤
using config file '/var/www/active/config/production.sphinx.conf'...
indexing index 'contact_core'...
collected 403 docs, 0.0 MB
sorted 0.1 Mhits, 100.0% done
ERROR: index 'contact_core': rename /var/www/active/db/sphinx/production/contact_core.tmp.spl to /var/www/active/db/sphinx/production/contact_core.new.spl failed: No such file or directory.
total 403 docs, 25092 bytes
total 0.069 sec, 361571 bytes/sec, 5807.16 docs/sec
distributed index 'contact' can not be directly indexed; skipping.
total 5 reads, 0.001 sec, 133.7 kb/call avg, 0.2 msec/call avg
total 10 writes, 0.012 sec, 177.8 kb/call avg, 1.2 msec/call avg
任何想法,我做錯了....
UPDATE
的建議後運行
/usr/local/bin/indexer --config /etc/sphinxsearch/sphinx.conf --all --rotate
我得到這個錯誤
using config file '/etc/sphinxsearch/sphinx.conf'...
ERROR: unknown key name 'client_timeout' in /etc/sphinxsearch/sphinx.conf line 591 col 16.
FATAL: failed to parse config file '/etc/sphinxsearch/sphinx.conf'.
您正在使用不正確的conf路徑。使用你的,不要盲目地複製人們的建議。 '/ usr/local/bin/indexer --config /var/www/active/config/production.sphinx.conf --all --rotate' –