更改应用程序名称后,如何更新Sunspot-Solr的路径

时间:2010-06-22 15:02:57

标签: ruby-on-rails solr sunspot

通常我的应用程序位于:

/数据/站点/电流/

但现在是:

/数据/站点2 /电流/

我尝试将脚本/控制台插入其中,并重新编制索引,并收到以下错误,这使我相信新路径正在抛弃它:

RSolr::RequestError: Solr Response: Failed_to_acquire_random_test_lock_please_verify_filesystem_for_lock_directory_solrdataindex_supports_locking__javalangRuntimeException_Failed_to_acquire_random_test_lock_please_verify_filesystem_for_lock_directory_solrdataindex_supports_locking__at_orgapachelucenestoreNativeFSLockFactoryacquireTestLockNativeFSLockFactoryjava88__at_orgapachelucenestoreNativeFSLockFactorymakeLockNativeFSLockFactoryjava126__at_orgapachelucenestoreDirectorymakeLockDirectoryjava131__at_orgapacheluceneindexIndexWriterinitIndexWriterjava1544__at_orgapacheluceneindexIndexWriterinitIndexWriterjava1402__at_orgapachesolrupdateSolrIndexWriterinitSolrIndexWriterjava190__at_orgapachesolrupdateUpdateHandlercreateMainIndexWriterUpdateHandlerjava98__at_orgapachesolrupdateDirectUpdateHandler2openWriterDirectUpdateHandler2java173__at_orgapachesolrupdateDirectUpdateHandler2deleteByQueryDirectUpdateHandler2java325__at_orgapachesolrupdateprocessorRunUpdateProcessorprocessDeleteRunUpdateProcessorFactoryjava71__at_orgapachesolrhandlerXMLLoaderprocessDeleteXMLLoaderjava234__at_orgapachesolrhandlerXMLLoaderprocessUpdateXMLLoaderjava180__at_orgapachesolrhandlerXMLLoaderloadXMLLoaderjava69__at_orgapachesolrhandlerContentStreamHandlerBasehandleRequestBodyContentStreamHandlerBasejava54__at_orgapachesolrhandlerRequestHandlerBasehandleRequestRequestHandlerBasejava131__at_orgapachesolrcoreSolrCoreexecuteSolrCorejava1316__at_orgapachesolrservletSolrDispatchFilterexecuteSolrDispatchFilterjava338__at_orgapachesolrservletSolrDispatchFilterdoFilterSolrDispatchFilterjava241__at_orgmortbayjettyservletServletHandler$CachedChaindoFilterServletHandlerjava1089__at_orgmortbayjettyservletServletHandlerhandleServletHandlerjava365__at_orgmortbayjettysecuritySecurityHandlerhandleSecurityHandlerjava216__at_orgmortbayjettyservletSessionHandlerhandleSessionHandlerja
from /usr/lib/ruby/gems/1.8/gems/rsolr-0.12.1/lib/rsolr/connection/requestable.rb:39:in `request'
from /usr/lib/ruby/gems/1.8/gems/rsolr-0.12.1/lib/rsolr/client.rb:34:in `request'
from /usr/lib/ruby/gems/1.8/gems/rsolr-0.12.1/lib/rsolr/client.rb:22:in `update'
from /usr/lib/ruby/gems/1.8/gems/rsolr-0.12.1/lib/rsolr/client.rb:76:in `delete_by_query'
from /usr/lib/ruby/gems/1.8/gems/sunspot-1.0.5/lib/sunspot/indexer.rb:55:in `remove_all'
from /usr/lib/ruby/gems/1.8/gems/sunspot-1.0.5/lib/sunspot/session.rb:145:in `remove_all'
from /usr/lib/ruby/gems/1.8/gems/sunspot-1.0.5/lib/sunspot/session.rb:145:in `each'
from /usr/lib/ruby/gems/1.8/gems/sunspot-1.0.5/lib/sunspot/session.rb:145:in `remove_all'
from /usr/lib/ruby/gems/1.8/gems/sunspot-1.0.5/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
from /usr/lib/ruby/gems/1.8/gems/sunspot-1.0.5/lib/sunspot.rb:406:in `remove_all'
from /usr/lib/ruby/gems/1.8/gems/sunspot_rails-1.0.5/lib/sunspot/rails/searchable.rb:163:in `solr_remove_all_from_index'
from /usr/lib/ruby/gems/1.8/gems/sunspot_rails-1.0.5/lib/sunspot/rails/searchable.rb:182:in `reindex'
from (irb):2

我如何改变Sunspot-Solr的默认目录?

1 个答案:

答案 0 :(得分:0)

这是因为sunspot-solr gems没有安装在服务器上,因此所有调用gem错误都在这里。当我安装我的宝石时,我也不得不用pkill杀死它的过程。

我跑了

$> ps aux | grep solr

看到它正在运行一个进程,所以我运行了一个pkill:

pkill -term -f '/usr/lib/jvm/sun-jdk-1.6/bin/java -Djava.net.preferIPv4Stack=true -Dsolr.solr.home=solr -jar start.jar'

杀了它并重新启动它。问题解决了。