Sunspot_solr проблема с драгоценным соединением - PullRequest
0 голосов
/ 24 июня 2019

Я запускаю приложение rails, которое использует самоцветы sunspot_rails и sunspot_solr.Я сталкиваюсь с несколькими ошибками, такими как org.apache.solr.common.SolrException: Ошибка при открытии нового поисковика и RSolr :: Error :: ConnectionRefused: соединение отклонено .

Конфигурации системы

Ruby 2.2.6 Rails 4.2.2 RVM 1.29.8

java -version 
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

Я также пытался с Java8 и Java12, но это приводило к тем же ошибкам.

Gemfile

gem 'sunspot_rails'
gem 'sunspot_solr'
gem 'sunspot_mongo'

Команды, которые я запускаю, чтобы запустить solr и запустить приложение

bundle install

Устанавливает необходимые гемы

rails g sunspot_rails:install

Создает директорию solr / внутри директории проекта, но в ней отсутствуют каталоги bin / и data /, о которых другие люди упоминали по другим вопросам в StackOveflow

rake sunspot:solr:start
Successfully started Solr ...

Я вижу админ-панель solrна локальном хосте: 8982

rake sunspot:solr:run

~/RubymineProjects/kadium$ rake sunspot:solr:run --trace
DEPRECATION WARNING: The factory_girl gem is deprecated. Please upgrade to factory_bot. See https://github.com/thoughtbot/factory_bot/blob/v4.9.0/UPGRADE_FROM_FACTORY_GIRL.md for further instructions. (called from require at /home/ccomputing/.rvm/rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/bundler/runtime.rb:81)
** Invoke sunspot:solr:run (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute sunspot:solr:run

Starting Solr on port 8982 from /home/ccomputing/.rvm/gems/ruby-2.2.6@kadium/gems/sunspot_solr-2.3.0/solr/server

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
0    INFO  (main) [   ] o.e.j.u.log Logging initialized @421ms
152  INFO  (main) [   ] o.e.j.s.Server jetty-9.2.11.v20150529
166  WARN  (main) [   ] o.e.j.s.h.RequestLogHandler !RequestLog
167  INFO  (main) [   ] o.e.j.d.p.ScanningAppProvider Deployment monitor [file:/home/ccomputing/.rvm/gems/ruby-2.2.6@kadium/gems/sunspot_solr-2.3.0/solr/server/contexts/] at interval 0
444  INFO  (main) [   ] o.e.j.w.StandardDescriptorProcessor NO JSP Support for /solr, did not find org.apache.jasper.servlet.JspServlet
455  WARN  (main) [   ] o.e.j.s.SecurityHandler ServletContext@o.e.j.w.WebAppContext@7ef82753{/solr,file:/home/ccomputing/.rvm/gems/ruby-2.2.6@kadium/gems/sunspot_solr-2.3.0/solr/server/solr-webapp/webapp/,STARTING}{/home/ccomputing/.rvm/gems/ruby-2.2.6@kadium/gems/sunspot_solr-2.3.0/solr/server/solr-webapp/webapp} has uncovered http methods for path: /
462  INFO  (main) [   ] o.a.s.s.SolrDispatchFilter SolrDispatchFilter.init(): WebAppClassLoader=225672073@d737b89
522  INFO  (main) [   ] o.a.s.c.SolrResourceLoader JNDI not configured for solr (NoInitialContextEx)
522  INFO  (main) [   ] o.a.s.c.SolrResourceLoader using system property solr.solr.home: /home/ccomputing/RubymineProjects/kadium/solr
524  INFO  (main) [   ] o.a.s.c.SolrResourceLoader new SolrResourceLoader for directory: '/home/ccomputing/RubymineProjects/kadium/solr/'
657  INFO  (main) [   ] o.a.s.c.SolrXmlConfig Loading container configuration from /home/ccomputing/RubymineProjects/kadium/solr/solr.xml
715  INFO  (main) [   ] o.a.s.c.CoresLocator Config-defined core root directory: /home/ccomputing/RubymineProjects/kadium/solr
732  INFO  (main) [   ] o.a.s.c.CoreContainer New CoreContainer 997695567
733  INFO  (main) [   ] o.a.s.c.CoreContainer Loading cores into CoreContainer [instanceDir=/home/ccomputing/RubymineProjects/kadium/solr/]
733  INFO  (main) [   ] o.a.s.c.CoreContainer loading shared library: /home/ccomputing/RubymineProjects/kadium/solr/lib
733  WARN  (main) [   ] o.a.s.c.SolrResourceLoader Can't find (or read) directory to add to classloader: lib (resolved as: /home/ccomputing/RubymineProjects/kadium/solr/lib).
747  INFO  (main) [   ] o.a.s.h.c.HttpShardHandlerFactory created with socketTimeout : 600000,connTimeout : 60000,maxConnectionsPerHost : 20,maxConnections : 10000,corePoolSize : 0,maximumPoolSize : 2147483647,maxThreadIdleTime : 5,sizeOfQueue : -1,fairnessPolicy : false,useRetries : false,
2231 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.c.Config Loaded SolrConfig: solrconfig.xml
2236 INFO  (coreLoadExecutor-6-thread-3) [   ] o.a.s.c.Config Loaded SolrConfig: solrconfig.xml
2239 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.s.IndexSchema Reading Solr Schema from /home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/conf/schema.xml
2239 INFO  (coreLoadExecutor-6-thread-3) [   ] o.a.s.s.IndexSchema Reading Solr Schema from /home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/conf/schema.xml
2239 INFO  (coreLoadExecutor-6-thread-2) [   ] o.a.s.s.IndexSchema Reading Solr Schema from /home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/conf/schema.xml
2310 INFO  (coreLoadExecutor-6-thread-3) [   ] o.a.s.s.IndexSchema [default] Schema name=sunspot
2310 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.s.IndexSchema [test] Schema name=sunspot
2313 INFO  (coreLoadExecutor-6-thread-2) [   ] o.a.s.s.IndexSchema [development] Schema name=sunspot
2477 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.s.IndexSchema default search field in schema is text
2478 INFO  (coreLoadExecutor-6-thread-3) [   ] o.a.s.s.IndexSchema default search field in schema is text
2478 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.s.IndexSchema query parser default operator is AND
2478 INFO  (coreLoadExecutor-6-thread-3) [   ] o.a.s.s.IndexSchema query parser default operator is AND
2479 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.s.IndexSchema unique key field: id
2482 INFO  (coreLoadExecutor-6-thread-2) [   ] o.a.s.s.IndexSchema default search field in schema is text
2482 INFO  (coreLoadExecutor-6-thread-2) [   ] o.a.s.s.IndexSchema query parser default operator is AND
2483 INFO  (coreLoadExecutor-6-thread-2) [   ] o.a.s.s.IndexSchema unique key field: id
2479 INFO  (coreLoadExecutor-6-thread-3) [   ] o.a.s.s.IndexSchema unique key field: id
2485 INFO  (coreLoadExecutor-6-thread-3) [   ] o.a.s.c.ConfigSetProperties Did not find ConfigSet properties, assuming default properties: Can't find resource 'configsetprops.json' in classpath or '/home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/conf'
2486 INFO  (coreLoadExecutor-6-thread-3) [   ] o.a.s.c.CoreContainer Creating SolrCore 'default' using configuration from configset /home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot
2486 INFO  (coreLoadExecutor-6-thread-2) [   ] o.a.s.c.ConfigSetProperties Did not find ConfigSet properties, assuming default properties: Can't find resource 'configsetprops.json' in classpath or '/home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/conf'
2487 INFO  (coreLoadExecutor-6-thread-2) [   ] o.a.s.c.CoreContainer Creating SolrCore 'development' using configuration from configset /home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot
2488 INFO  (coreLoadExecutor-6-thread-2) [   x:development] o.a.s.c.SolrCore solr.NRTCachingDirectoryFactory
2490 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.c.ConfigSetProperties Did not find ConfigSet properties, assuming default properties: Can't find resource 'configsetprops.json' in classpath or '/home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/conf'
2493 INFO  (coreLoadExecutor-6-thread-1) [   ] o.a.s.c.CoreContainer Creating SolrCore 'test' using configuration from configset /home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot
2493 INFO  (coreLoadExecutor-6-thread-1) [   x:test] o.a.s.c.SolrCore solr.NRTCachingDirectoryFactory
2487 INFO  (coreLoadExecutor-6-thread-3) [   x:default] o.a.s.c.SolrCore solr.NRTCachingDirectoryFactory
2506 INFO  (coreLoadExecutor-6-thread-2) [   x:development] o.a.s.c.SolrCore [[development] ] Opening new SolrCore at [/home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/], dataDir=[null]
2508 INFO  (coreLoadExecutor-6-thread-1) [   x:test] o.a.s.c.SolrCore [[test] ] Opening new SolrCore at [/home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/], dataDir=[null]
2509 INFO  (coreLoadExecutor-6-thread-3) [   x:default] o.a.s.c.SolrCore [[default] ] Opening new SolrCore at [/home/ccomputing/RubymineProjects/kadium/solr/configsets/sunspot/], dataDir=[null]
2511 INFO  (coreLoadExecutor-6-thread-3) [   x:default] o.a.s.c.JmxMonitoredMap No JMX servers found, not exposing Solr information with JMX.
2785 INFO  (coreLoadExecutor-6-thread-2) [   x:development] o.a.s.u.DefaultSolrCoreState SolrCoreState ref count has reached 0 - closing IndexWriter
2785 INFO  (coreLoadExecutor-6-thread-2) [   x:development] o.a.s.u.DefaultSolrCoreState closing IndexWriter with IndexWriterCloser
2787 INFO  (coreLoadExecutor-6-thread-1) [   x:test] o.a.s.c.SolrCore [test] Closing main searcher on request.
2787 INFO  (coreLoadExecutor-6-thread-1) [   x:test] o.a.s.c.CachingDirectoryFactory Closing NRTCachingDirectoryFactory - 1 directories currently being tracked
2788 INFO  (coreLoadExecutor-6-thread-1) [   x:test] o.a.s.c.CachingDirectoryFactory looking to close /home/ccomputing/RubymineProjects/kadium/solr/test/data [CachedDir<<refCount=0;path=/home/ccomputing/RubymineProjects/kadium/solr/test/data;done=false>>]
2788 INFO  (coreLoadExecutor-6-thread-1) [   x:test] o.a.s.c.CachingDirectoryFactory Closing directory: /home/ccomputing/RubymineProjects/kadium/solr/test/data
2789 ERROR (coreLoadExecutor-6-thread-1) [   x:test] o.a.s.c.CoreContainer Error creating core [test]: Error opening new searcher
org.apache.solr.common.SolrException: Error opening new searcher
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:820)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:659)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:723)
    at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:443)
    at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:434)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:210)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.solr.common.SolrException: Error opening new searcher
    at org.apache.solr.core.SolrCore.openNewSearcher(SolrCore.java:1662)
    at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1773)
    at org.apache.solr.core.SolrCore.initSearcher(SolrCore.java:916)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:793)
    ... 9 more

Я испробовал большинство решений, которые нашел по схожим вопросам, но ни одно из них не помогло мне.Был бы очень признателен за решение этой проблемы.

Спасибо.

1 Ответ

1 голос
/ 07 июля 2019

Эта строка привлекла мое внимание:

733 WARN (main) [ ] o.a.s.c.SolrResourceLoader Can't find (or read) directory to add to classloader: lib (resolved as: <<YOUR PATH>>/solr/lib

1 / Проверьте, существует ли каталог по этому пути

2 / Если каталог существует, проверьте, что вы (есливы - пользователь, запускающий процесс Solr) владеете каталогом и его содержимым // имеете права на чтение

В качестве примечания, на самом деле, вам следует избегать предоставления пользователям в Интернете полного пути с именем пользователя, это дает мнемного информации о том, кто вы / где вы работаете, а также о том, как мне легче в конечном итоге поднять вашу систему.Вы должны отредактировать свое сообщение, чтобы скрыть полный путь.

...