5
7

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.

Apache Solrのインストール

Last updated at Posted at 2018-12-24

やってみたのでメモ

前提

  • CentOS7
  • Java8インストール済み

手順

  1. tarファイルをダウンロードする

    # curl -LkvOf https://ftp.jaist.ac.jp/pub/apache/lucene/solr/8.4.1/solr-8.4.1.tgz
    
  2. ダウンロードしたtarファイルを展開する

    # tar zxf solr-8.4.1.tgz
    
  3. 展開してできたディレクトリを/opt配下に移動する

    # mv solr-8.4.1 /opt/solr
    
  4. solr 実行用ユーザを作成する

    # useradd solr
    
  5. ディレクトリを作成する

    # mkdir -p /var/solr/data
    
  6. solr.xmlファイルを/var/solr/dataディレクトリ配下に移動させる

    # mv /opt/solr/server/solr/solr.xml /var/solr/data/
    
  7. 環境変数を設定する

    # vi /opt/solr/bin/solr.in.sh
    
    solr.in.sh
    SOLR_PID_DIR=/var/solr
    SOLR_HOME=/var/solr/data
    LOG4J_PROPS=/var/solr/log4j2.xml
    SOLR_LOGS_DIR=/var/solr/logs
    
  8. /opt/solr/var/solrの所有者をsolr実行用ユーザに変更する

    # chown -R solr:solr /opt/solr /var/solr
    
  9. サービスファイルを作成する

    # vi /etc/systemd/system/solr.service
    
    solr.service
    [Unit]
    Description=Apache Solr Service
    
    [Service]
    Type=forking
    User=solr
    EnvironmentFile=/opt/solr/bin/solr.in.sh
    ExecStart=/opt/solr/bin/solr start
    ExecStop=/opt/solr/bin/solr stop
    
    [Install]
    WantedBy=multi-user.target
    
  10. 再読み込みする

    # systemctl daemon-reload
    
  11. 起動する

    # systemctl start solr
    
  12. http://<IPアドレス>:8983/solrにブラウザでアクセスする
    Solr管理者画面.png

参考

5
7
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
5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?