微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

生产中的 Rails 应用程序无法连接到 Solr 服务器

如何解决生产中的 Rails 应用程序无法连接到 Solr 服务器

我正在尝试在我的 rails 生产服务器上配置 solr。 它在本地机器上运行良好。

下面是sunspot.yml

中的配置
production:
  solr:
    solr_home: solr
    hostname: localhost
    port: 8983
    log_level: WARNING
    path: /solr/default

staging:
  solr:
    hostname: localhost
    port: 8983
    log_level: WARNING
    path: /solr/staging
    # read_timeout: 2
    # open_timeout: 0.5

development:
  solr:
    solr_home: solr
    hostname: localhost
    port: 8982
    log_level: INFO
    path: /solr/development

test:
  solr:
    hostname: localhost
    port: 8982
    log_level: WARNING
    path: /solr/test

我已经尝试了以下方法

How to configure Solr standalone in Production server with Rails application using sunspot gem?

以下是运行 sunspot:solr:reindex

的日志
warning: parser/current is loading parser/ruby26,which recognizes
warning: 2.6.6-compliant Syntax,but you are running 2.6.4.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
rake aborted!
RSolr::Error::ConnectionRefused: Connection refused - {:data=>"{\"delete\":{\"query\":\"type:Post\"}}",:headers=>{"Content-Type"=>"application/json"},:method=>:post,:params=>{:wt=>:json},:query=>"wt=json",:path=>"update",:uri=>#<URI::HTTP http://localhost:8983/solr/default/update?wt=json>}
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:204:in `rescue in execute'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:196:in `execute'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:191:in `send_and_receive'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:94:in `update'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:157:in `delete_by_query'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/indexer.rb:68:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `block in remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/retry_5xx_session_proxy.rb:17:in `method_missing'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot.rb:502:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:196:in `solr_remove_all_from_index'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:215:in `solr_reindex'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:60:in `block (4 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/class_set.rb:16:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/class_set.rb:16:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:59:in `block (3 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:71:in `with_session'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:19:in `block (2 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/home/deploy/.rbenv/versions/2.6.4/bin/bundle:23:in `load'
/home/deploy/.rbenv/versions/2.6.4/bin/bundle:23:in `<main>'

Caused by:
Faraday::ConnectionFailed: Failed to open TCP connection to localhost:8983 (Connection refused - connect(2) for "localhost" port 8983)
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:152:in `request_via_request_method'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:137:in `request_with_wrapped_block'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:128:in `perform_request'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:70:in `block in call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter.rb:61:in `connection'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:68:in `call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/response.rb:11:in `call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/rack_builder.rb:154:in `build_response'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/connection.rb:492:in `run_request'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/connection.rb:279:in `post'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:197:in `execute'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:191:in `send_and_receive'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:94:in `update'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:157:in `delete_by_query'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/indexer.rb:68:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `block in remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/retry_5xx_session_proxy.rb:17:in `method_missing'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot.rb:502:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:196:in `solr_remove_all_from_index'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:215:in `solr_reindex'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:60:in `block (4 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/class_set.rb:16:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/class_set.rb:16:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:59:in `block (3 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:71:in `with_session'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:19:in `block (2 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/home/deploy/.rbenv/versions/2.6.4/bin/bundle:23:in `load'
/home/deploy/.rbenv/versions/2.6.4/bin/bundle:23:in `<main>'

Caused by:
Errno::ECONNREFUSED: Failed to open TCP connection to localhost:8983 (Connection refused - connect(2) for "localhost" port 8983)
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:152:in `request_via_request_method'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:137:in `request_with_wrapped_block'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:128:in `perform_request'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:70:in `block in call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter.rb:61:in `connection'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:68:in `call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/response.rb:11:in `call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/rack_builder.rb:154:in `build_response'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/connection.rb:492:in `run_request'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/connection.rb:279:in `post'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:197:in `execute'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:191:in `send_and_receive'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:94:in `update'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:157:in `delete_by_query'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/indexer.rb:68:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `block in remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/retry_5xx_session_proxy.rb:17:in `method_missing'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot.rb:502:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:196:in `solr_remove_all_from_index'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:215:in `solr_reindex'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:60:in `block (4 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/class_set.rb:16:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/class_set.rb:16:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:59:in `block (3 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:71:in `with_session'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:19:in `block (2 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/home/deploy/.rbenv/versions/2.6.4/bin/bundle:23:in `load'
/home/deploy/.rbenv/versions/2.6.4/bin/bundle:23:in `<main>'

Caused by:
Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 8983
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:152:in `request_via_request_method'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:137:in `request_with_wrapped_block'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:128:in `perform_request'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:70:in `block in call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter.rb:61:in `connection'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/adapter/net_http.rb:68:in `call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/response.rb:11:in `call'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/rack_builder.rb:154:in `build_response'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/connection.rb:492:in `run_request'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/faraday-1.1.0/lib/faraday/connection.rb:279:in `post'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:197:in `execute'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:191:in `send_and_receive'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:94:in `update'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:157:in `delete_by_query'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/indexer.rb:68:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `block in remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session.rb:197:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/retry_5xx_session_proxy.rb:17:in `method_missing'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot.rb:502:in `remove_all'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:196:in `solr_remove_all_from_index'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:215:in `solr_reindex'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:60:in `block (4 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/class_set.rb:16:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/class_set.rb:16:in `each'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:59:in `block (3 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:71:in `with_session'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/tasks.rb:19:in `block (2 levels) in <main>'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/home/deploy/.rbenv/versions/2.6.4/bin/bundle:23:in `load'
/home/deploy/.rbenv/versions/2.6.4/bin/bundle:23:in `<main>'
Tasks: TOP => sunspot:solr:reindex => sunspot:reindex
(See full trace by running task with --trace)

以下是来自 production.log

错误跟踪
D,[2021-04-06T11:43:12.418764 #8824] DEBUG -- : [c743e1e1-8111-4277-a4af-295e03bd111f]   SOLR Request (84.2ms)  [ path=select parameters={fq: ["type:Post","type_texts:Post",nil],start: 0,rows: 25,q: "*:*"} ]
I,[2021-04-06T11:43:12.419319 #8824]  INFO -- : [c743e1e1-8111-4277-a4af-295e03bd111f] Completed 500 Internal Server Error in 120ms (ActiveRecord: 2.1ms | Allocations: 26128)
F,[2021-04-06T11:43:12.419933 #8824] FATAL -- : [c743e1e1-8111-4277-a4af-295e03bd111f]   
[c743e1e1-8111-4277-a4af-295e03bd111f] RSolr::Error::Http (RSolr::Error::Http - 404 Not Found
Error:     Not Found

URI: http://localhost:8983/solr/default/select?wt=json
Request Headers: {"Content-Type"=>"application/x-www-form-urlencoded; charset=UTF-8"}
Request Data: "fq=type%3APost&fq=type_texts%3APost&&start=0&rows=25&q=*%3A*"

Backtrace: /home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:206:in `rescue in execute'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:196:in `execute'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/rsolr-2.3.0/lib/rsolr/client.rb:191:in `send_and_receive'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `block in instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/activesupport-6.0.3.4/lib/active_support/notifications.rb:180:in `instrument'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot-2.5.0/lib/sunspot/search/abstract_search.rb:49:in `execute'
/home/deploy/ont-production/shared/bundle/ruby/2.6.0/gems/sunspot_rails-2.5.0/lib/sunspot/rails/searchable.rb:395:in `solr_execute_search'):
[c743e1e1-8111-4277-a4af-295e03bd111f]   
[c743e1e1-8111-4277-a4af-295e03bd111f] (eval):2:in `post'
[c743e1e1-8111-4277-a4af-295e03bd111f] app/controllers/posts_controller.rb:35:in `search'

任何帮助将不胜感激!

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?