您现在的位置是:首页 > 博客日记 > Liunx Liunx

solr-8.3.0的安装

2019-12-13 10:40:00 【Liunx】 人已围观

1.下载solr-8.3.0安装包

solr 下载页面

  1. #进入存放安装包目录
  2. cd /data/soft/
  3. #下载
  4. wget http://mirror.bit.edu.cn/apache/lucene/solr/8.3.1/solr-8.3.1.zip
  5. #解压到当前目录
  6. unzip solr-8.3.1.zip

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

  1. #安装lsof
  2. yum install lsof

2.初始化solr服务

初始化solr配置

  1. /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

启动参数:

  1. Usage: install_solr_service.sh <path_to_solr_distribution_archive> [OPTIONS]
  2. The first argument to the script must be a path to a Solr distribution archive, such as solr-5.0.0.tgz
  3. (only .tgz or .zip are supported formats for the archive)
  4. Supported OPTIONS include:
  5. -d Directory for live / writable Solr files, such as logs, pid files, and index data; defaults to /var/solr
  6. -i Directory to extract the Solr installation archive; defaults to /opt/
  7. The specified path must exist prior to using this script.
  8. -p Port Solr should bind to; default is 8983
  9. -s Service name; defaults to solr
  10. -u User to own the Solr files and run the Solr process as; defaults to solr
  11. This script will create the specified user account if it does not exist.
  12. -f Upgrade Solr. Overwrite symlink and init script of previous installation.
  13. -n Do not start Solr service after install, and do not abort on missing Java
  1. [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/
  2. Extracting /data/soft/solr-8.3.1.zip to /usr/local/solr/
  3. Installing symlink /usr/local/solr/solr -> /usr/local/solr/solr-8.3.1 ...
  4. Installing /etc/init.d/solr script ...
  5. /etc/default/solr.in.sh already exist. Skipping install ...
  6. Service solr installed.
  7. Customize Solr startup configuration in /etc/default/solr.in.sh
  8. *** [WARN] *** Your Max Processes Limit is currently 4096.
  9. It should be set to 65000 to avoid operational disruption.
  10. If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
  11. Waiting up to 180 seconds to see Solr running on port 8983 [/]
  12. Started Solr server on port 8983 (pid=4742). Happy searching!
  13. Found 1 Solr nodes:
  14. Solr process 4742 running on port 8983
  15. {
  16. "solr_home":"/var/solr/data",
  17. "version":"8.3.1 a3d456fba2cd1b9892defbcf46a0eb4d4bb4d01f - ishan - 2019-11-29 11:51:37",
  18. "startTime":"2019-12-13T03:06:29.299Z",
  19. "uptime":"0 days, 0 hours, 0 minutes, 15 seconds",
  20. "memory":"109.5 MB (%21.4) of 512 MB"}

将配置文件走软连接到etc

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

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

  1. SOLR_PID_DIR="/data/solr"
  2. SOLR_HOME="/data/solr/data"
  3. LOG4J_PROPS="/data/solr/log4j2.xml"
  4. SOLR_LOGS_DIR="/data/solr/logs"
  5. SOLR_PORT="8983"
  6. SOLR_TIMEZONE="Asia/Shanghai"
  7. #SOLR_HEAP="4096m" #内存调优

重新启动

  1. service solr restart
安装成功并启动
  1. /data/solr/data core仓库存放目录
  2. /usr/local/solr/solr/ 服务存放目录
  3. /etc/default/solr.in.sh /usr/local/solr/solr/bin/solr.in.sh solr配置文件
  1. #启动
  2. service solr start
  3. #停止
  4. service solr stop
  5. #重启
  6. service solr restart
  7. #服务启动文件位置
  8. /etc/init.d/solr


关注TinyMeng博客,更多精彩分享,敬请期待!
 

很赞哦! ()