English 中文(简体)
How do I update Sunspot-Solr s path after I change my Application Name
原标题:

Normally my app was located here at :

/data/Site/current/

but now it s:

/data/Site2/current/

I tried to script/console into it, and reindex, and received the following error which lead me to believe that the new path is throwing it off:

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

How would I go about changing Sunspot-Solr s default dir?

最佳回答

This is because the sunspot-solr gems were not installed on the server thus all the call to gem errors here. When I installed my gems, I also had to kill its process with a pkill.

I ran

$> ps aux | grep solr

Saw it was running a process, so I ran a pkill :

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

Killed it and restarted it. Problem solved.

问题回答

暂无回答




相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签