CentOS   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了CentOs7.3 搭建 Solr单机服务大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_618_3@概述 CentOs7.3 搭建 Solr单机服务 Solr是什么? Solr是一款优秀的基于Lucene的全文检索服务器,它对Lucene进行了扩展,提供了非常丰富的查询语言,并对查询进行了性能优化。Solr和Lucene都由Apache Software Foundation(www.apache.org)管理。 Apache Solr 参指南 环境 VMware版本号:12.0.0 CentOS版

CentOs7.3 搭建 Solr单机服务

@H_618_3@Solr是什么?

Solr是一款优秀的基于Lucene的全文检索服务器,它对Lucene进行了扩展,提供了非常丰富的查询语言,并对查询进行了性能优化。Solr和Lucene都由Apache Software Foundation(www.apache.org)管理。

Apache Solr 参考指南

@H_618_3@环境

VMware版本号:12.0.0
CentOS版本:CentOS 7.3.1611
Solr 版本:solr-6.6.0
JDK环境:jdk-8u144-linux-x64.tar.gz 具体参《CentOs7.3 安装 JDK1.8》

@H_618_3@注意事项

关闭防火墙

$ systemctl stop firewalld.service

Solr 安装

@H_618_3@下载 Solr

下载最新版本的Solr ,我在北京我就选择,清华镜像比较快,文件大概140M

清华镜像:https://mirrors.tuna.tsinghua.edu.cn/apache/lucene/solr/6.6.0/

阿里镜像:https://mirrors.aliyun.com/apache/lucene/solr/6.6.0/

@H_618_3@提取tar文件
$ cd /opt/
$ wget https://mirrors.tuna.tsinghua.edu.cn/apache/lucene/solr/6.6.0/solr-6.6.0.tgz
$ tar -zxf solr-6.6.0.tgz 
$ cd solr-6.6.0

Solr 操作

@H_618_3@1.启动服务
$ /opt/solr-6.6.0/bin/solr start -force

响应

Warning: Available entropy is low. As a result,use of the UUIDField,SSL,or any other features that require
RNG might not work properly. To check for the amount of available entropy,use 'cat /proc/sys/kernel/random/entropy_avail'.

NOTE: Please install lsof as this script needs it to deter@L_874_13@ if Solr is listening on port 8983.

Started Solr server on port 8983 (pid=3020). Happy searching!

启动Solr与不同的端口,要更改Solr监听端口,可以-p在启动时使用参数

例如:

$ /opt/solr-6.6.0/bin/solr start -p 8984
@H_618_3@2.访问管理UI

浏览器输入 ip:port

http://192.168.252.121:8983/solr/

如果Solr没有运行,您的浏览器会抱怨说它无法连接到服务器。检查您的端口号,然后重试。

@H_618_3@3.服务状态

如果您不确定Solr是否在本地运行

$ /opt/solr-6.6.0/bin/solr status

响应

Found 1 Solr nodes: 

Solr process 4177 running on port 8983
{
  "solr_home":"/opt/solr-6.6.0/server/solr","version":"6.6.0 5c7a7b65d2aa7ce5ec96458315c661a18b320241 - ishan - 2017-05-30 07:32:53","startTime":"2017-08-23T16:18:24.088Z","uptime":"0 days,0 hours,0 minutes,18 seconds","memory":"32.9 MB (%6.7) of 490.7 MB"}
@H_618_3@4.创建Solr库
bin/solr create -c <name>
$ /opt/solr-6.6.0/bin/solr create -c ymq -force

响应

Copying configuration to new core instance directory:
/opt/solr-6.6.0/server/solr/ymq

CreaTing new core 'ymq' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=ymq&instanceDir=ymq

{
  "responseHeader":{
    "status":0,"QTime":2665},"core":"ymq"}

浏览器输入 ip:port

http://192.168.252.121:8983/solr/

@H_618_3@5.停止服务
$ /opt/solr-6.6.0/bin/solr stop -p 8983

响应

Sending stop command to Solr running on port 8983 ... waiTing up to 180 seconds to allow jetty process 3554 to stop gracefully.

可以使用该-all参数来停止所有运行的Solr实例

$ /opt/solr-6.6.0/bin/solr stop -all

响应

Sending stop command to Solr running on port 8983 ... waiTing up to 180 seconds to allow jetty process 3249 to stop gracefully.

大佬总结

以上是大佬教程为你收集整理的CentOs7.3 搭建 Solr单机服务全部内容,希望文章能够帮你解决CentOs7.3 搭建 Solr单机服务所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。