「Centos Stream 8」Apache Solr8.8.1をインストールする方法

操作方法
1.Javaバージョン確認
# java –version
openjdk 15.0.2 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 15.0.2+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15.0.2+7, mixed mode, sharing)

2.Apache Solrをダウンロード
# wget https://downloads.apache.org/lucene/solr/8.8.1/solr-8.8.1.tgz

3.tgzファイルを解凍
# tar xvf solr-8.8.1.tgz
# cd /usr/local/src/solr-8.8.1
solrをインストール
# sudo ./bin/install_solr_service.sh ../solr-8.8.1.tgz

id: `solr': no such user
Creating new user: solr

Extracting ../solr-8.8.1.tgz to /opt


Installing symlink /opt/solr -> /opt/solr-8.8.1 ...


Installing /etc/init.d/solr script ...


Installing /etc/default/solr.in.sh ...

Service solr installed.
Customize Solr startup configuration in /etc/default/solr.in.sh
The currently defined JAVA_HOME (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-4.el8.x86_64) refers
to a location where Java could not be found.  Aborting.
Either fix the JAVA_HOME variable or remove it from the
environment so that the system PATH will be searched.
The currently defined JAVA_HOME (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-4.el8.x86_64) refers
to a location where Java could not be found.  Aborting.
Either fix the JAVA_HOME variable or remove it from the
environment so that the system PATH will be searched.

エラーログ対策
#vi /etc/default/solr.in.sh
修正前
#SOLR_JAVA_HOME
修正後
SOLR_JAVA_HOME=“/usr/lib/jvm/adoptopenjdk-15-hotspot"

■ solrを起動
# sudo systemctl start solr

ステータスを確認
# sudo systemctl status solr

● solr.service - LSB: Controls Apache Solr as a Service
   Loaded: loaded (/etc/rc.d/init.d/solr; generated)
   Active: active (exited) since Tue 2021-03-16 17:59:49 JST; 15s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10132 ExecStart=/etc/rc.d/init.d/solr start (code=exited, status=0/SUCCESS)

 3月 16 17:59:28 localhost.localdomain solr[10132]: *** [WARN] *** Your open file limit is currently 1024.
 3月 16 17:59:28 localhost.localdomain solr[10132]:  It should be set to 65000 to avoid operational disruption.
 3月 16 17:59:28 localhost.localdomain solr[10132]:  If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or>
 3月 16 17:59:28 localhost.localdomain solr[10132]: *** [WARN] ***  Your Max Processes Limit is currently 6924.
 3月 16 17:59:28 localhost.localdomain solr[10132]:  It should be set to 65000 to avoid operational disruption.
 3月 16 17:59:28 localhost.localdomain solr[10132]:  If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or>
 3月 16 17:59:48 localhost.localdomain solr[10132]: [422B blob data]
 3月 16 17:59:48 localhost.localdomain solr[10132]: Started Solr server on port 8983 (pid=10270). Happy searching!
 3月 16 17:59:49 localhost.localdomain solr[10132]: [14B blob data]
 3月 16 17:59:49 localhost.localdomain systemd[1]: Started LSB: Controls Apache Solr as a Service.

■ FireWallを設定
# firewall-cmd –add-port=8983/tcp –zone=public –permanent
success
# firewall-cmd –reload
success

■ Apache Solrにアクセス
http://192.168.229.129:8983/

CentOS

Posted by arkgame