0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7でLodgeを導入したら記事を登録できなかった

Last updated at Posted at 2017-04-27

原因:Solrが正常に動作していなかった。

対応1:yumのJDK1.8 → 公式のJDK1.8

参考:http://stackoverflow.com/questions/34958993/solr-sunspot-runs-but-wont-start

対応2:「config/sunspot.yml」の「path: /solr/production」→「path: /solr/default」

参考:http://stackoverflow.com/questions/19759906/rails-app-solr-throwing-rsolrerrorhttp-404-not-found-when-executing-searc

詳細

ログを見ると、「Connection Refused」が発生していた。

I, [2017-04-27T09:49:17.162558 #2495]  INFO -- : Completed 500 Internal Server Error in 86ms (ActiveRecord: 17.9ms)
F, [2017-04-27T09:49:17.165441 #2495] FATAL -- :
RSolr::Error::ConnectionRefused (Connection refused - {:data=>"<?xml ...

JDKが合ってないとダメみたいなので、wgetでダウンロードしたJDKに変更。

# alternatives --config java

  選択       コマンド
-----------------------------------------------
*  1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64/jre/bin/java)
 + 2           /usr/java/jdk1.8.0_131/jre/bin/java

今度は「404 Not Found」が発生。

RSolr::Error::Http (RSolr::Error::Http - 404 Not Found
Error:     Not Found

sunspot.ymlの「path: /solr/production」が変わってるみたいなので、「path: /solr/default」へ変更。

production:
  solr:
    hostname: localhost
    port: 8983
    log_level: INFO
    path: /solr/default
    # read_timeout: 2
    # open_timeout: 0.5

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

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

これで私は登録できるようになりました。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?