1.下载solr-8.3.0安装包

solr 下载页面

#进入存放安装包目录
cd /data/soft/

#下载
wget http://mirror.bit.edu.cn/apache/lucene/solr/8.3.1/solr-8.3.1.zip 

#解压到当前目录
unzip solr-8.3.1.zip

请检测服务器是否安装java的jdk 在Liunx上安装Java环境JDK

#安装lsof
yum install lsof

2.初始化solr服务

初始化solr配置

/data/soft/solr-8.3.1/bin/install_solr_service.sh /data/soft/solr-8.3.1.zip -d /data/solr -i /usr/local/solr

启动参数:

Usage: install_solr_service.sh <path_to_solr_distribution_archive> [OPTIONS]
The first argument to the script must be a path to a Solr distribution archive, such as solr-5.0.0.tgz
(only .tgz or .zip are supported formats for the archive)
Supported OPTIONS include:

-d     Directory for live / writable Solr files, such as logs, pid files, and index data; defaults to /var/solr
-i     Directory to extract the Solr installation archive; defaults to /opt/
         The specified path must exist prior to using this script.
-p     Port Solr should bind to; default is 8983
-s     Service name; defaults to solr
-u     User to own the Solr files and run the Solr process as; defaults to solr
         This script will create the specified user account if it does not exist.
-f     Upgrade Solr. Overwrite symlink and init script of previous installation.
-n     Do not start Solr service after install, and do not abort on missing Java

[root@iZbp153yczpm4pp9pjs0u3Z bin]# /data/soft/solr-8.3.1/bin/install_solr_service.sh /data/soft/solr-8.3.1.zip -d /data/solr -i /usr/local/solr/

Extracting /data/soft/solr-8.3.1.zip to /usr/local/solr/

Installing symlink /usr/local/solr/solr -> /usr/local/solr/solr-8.3.1 ...

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

/etc/default/solr.in.sh already exist. Skipping install ...

Service solr installed.
Customize Solr startup configuration in /etc/default/solr.in.sh
[WARN] Your Max Processes Limit is currently 4096.
It should be set to 65000 to avoid operational disruption.
If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Waiting up to 180 seconds to see Solr running on port 8983 [/]
Started Solr server on port 8983 (pid=4742). Happy searching!

Found 1 Solr nodes:

Solr process 4742 running on port 8983
{
"solr_home":"/var/solr/data",
"version":"8.3.1 a3d456fba2cd1b9892defbcf46a0eb4d4bb4d01f - ishan - 2019-11-29 11:51:37",
"startTime":"2019-12-13T03:06:29.299Z",
"uptime":"0 days, 0 hours, 0 minutes, 15 seconds",
"memory":"109.5 MB (%21.4) of 512 MB"}


将配置文件走软连接到etc

rm -f /etc/default/solr.in.sh
ln -s /usr/local/solr/solr/bin/solr.in.sh /etc/default/solr.in.sh


在`/usr/local/solr/solr/bin/solr.in.sh`最后添加

SOLR_PID_DIR="/data/solr"
SOLR_HOME="/data/solr/data"
LOG4J_PROPS="/data/solr/log4j2.xml"
SOLR_LOGS_DIR="/data/solr/logs"
SOLR_PORT="8983"
SOLR_TIMEZONE="Asia/Shanghai"

SOLR_HEAP="4096m" #内存调优

重新启动

service solr restart


##### 安装成功并启动

/data/solr/data core仓库存放目录
/usr/local/solr/solr/ 服务存放目录
/etc/default/solr.in.sh 或 /usr/local/solr/solr/bin/solr.in.sh solr配置文件

启动

service solr start

停止

service solr stop

重启

service solr restart

服务启动文件位置

/etc/init.d/solr

Last modification:December 13th, 2019 at 11:42 am
如果觉得我的文章对你有用,请随意赞赏