代码之家  ›  专栏  ›  技术社区  ›  Trip

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

  •  0
  • Trip  · 技术社区  · 14 年前

    通常我的应用程序位于:

    /数据/站点/当前/

    但现在是:

    /数据/站点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
    

    我该如何改变太阳黑子索尔的默认目录?

    1 回复  |  直到 14 年前
        1
  •  0
  •   Trip    14 年前

    这是因为太阳黑子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'
    

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