[solr]solr的安装

2019-03-27 01:04|来源: 网路

solr是什么?

翻译

SolrTM is the popular, blazing fast open source enterprise search platform from the Apache LuceneTM project. Its major features include powerful full-text search, hit highlighting, faceted search, near real-time indexing, dynamic clustering, database integration, rich document (e.g., Word, PDF) handling, and geospatial search. Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication and load-balanced querying, automated failover and recovery, centralized configuration and more. Solr powers the search and navigation features of many of the world's largest internet sites.

Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Jetty. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it easy to use from virtually any programming language. Solr's powerful external configuration allows it to be tailored to almost any type of application without Java coding, and it has an extensive plugin architecture when more advanced customization is required.

See the complete feature list for more details.

solr安装

下载:

http://archive.apache.org/dist/lucene/solr/

最新版本4.6.1

环境需求:

java 1.6版本以上;

solr运行需要java serverlet 容器,默认使用jetty,或者tomcat,jboss等等。

 

步骤:

1.wget 软件包,wget http://archive.apache.org/dist/lucene/solr/4.6.1/solr-4.6.1.tgz

2.解压, tar zxvf solr-4.6.1.tgz

3.进入到solr-4.6.1/example, 运行java -jar start.jar,这样jetty就监听在8983端口,在浏览器输入ip:8983/solr

side XXXXXXXXX

使用tomcat替代jetty

1.安装好java,安装好tomcat

2.将解压包中的solr-4.6.1/dist/solr-4.6.1.war复制到tomcat_dir/webapps/目录,并命名为solr.war

3.将solr-4.6.1/example/lib/ext/目录下的jar文件复制到tomcat_dir/lib目录下,将solr-4.6.1/example/resources/下的log4j.properties文件复制到tomcat_dir/lib目录下

这一步的目的是解决报错 startInternal SEVERE: Error filterStart,参考http://www.cnblogs.com/hupengcool/archive/2013/05/11/3072573.html

4.修改tomcat_dir/conf/server.xml

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" 
               URIEncoding="UTF-8" />

5.创建solr.xml,路径:tomcat_dir/conf/Catalina/localhost/solr.xml,内容:

<Context path="/solr" docBase="/home/app/act/tomcat/apache-tomcat-7.0.47/webapps/solr.war"
         debug="0" crossContext="true">
  <Environment name="solr/home" type="java.lang.String" value="/home/app/act/solr/example/solr/" override="true" />
</Context> 

6.下面是添加solr配置文件,这些文件包括schema.xml,solrconfig.xml等等,这些文件放置在solr/home目录下(实际上实在solr/home/collection1下)。

solr-4.6.1/example/solr/下的目录结构是

.
├── bin
├── collection1
│   ├── conf
│   │   ├── admin-extra.html
│   │   ├── admin-extra.menu-bottom.html
│   │   ├── admin-extra.menu-top.html
│   │   ├── clustering
│   │   │   └── carrot2
│   │   │       ├── kmeans-attributes.xml
│   │   │       ├── lingo-attributes.xml
│   │   │       └── stc-attributes.xml
│   │   ├── currency.xml
│   │   ├── elevate.xml
│   │   ├── lang
│   │   │   ├── contractions_ca.txt
│   │   │   ├── contractions_fr.txt
│   │   │   ├── contractions_ga.txt
│   │   │   ├── stopwords_ca.txt
│   │   │   ├── stopwords_cz.txt
│   │   │   ├── stopwords_da.txt
│   │   ├── mapping-FoldToASCII.txt
│   │   ├── mapping-ISOLatin1Accent.txt
│   │   ├── protwords.txt
│   │   ├── schema.xml
│   │   ├── scripts.conf
│   │   ├── solrconfig.xml
│   │   ├── spellings.txt
│   │   ├── stopwords.txt
│   │   ├── synonyms.txt
│   │   ├── update-script.js
│   │   ├── velocity
│   │   │   ├── browse.vm
│   │   │   ├── cluster_results.vm
│   │   │   ├── cluster.vm
│   │   │   ├── debug.vm
│   │   │   └── VM_global_library.vm
│   │   └── xslt
│   │       ├── example_atom.xsl
│   │       ├── example_rss.xsl
│   │       ├── example.xsl
│   │       ├── luke.xsl
│   │       └── updateXml.xsl
│   ├── core.properties
│   ├── data
│   │   ├── index
│   │   │   ├── _0.fdt
│   │   │   ├── _0.fdx
│   │   │   ├── _0.fnm
│   │   │   ├── _0_Lucene41_0.doc
│   │   │   ├── _0_Lucene41_0.pos
│   │   └── tlog
│   │       └── tlog.0000000000000000000
│   └── README.txt
├── README.txt
├── solr.xml
└── zoo.cfg

按照上面可以运行solr。

 

 


转自:http://www.cnblogs.com/silenceli/p/3555590

相关问答

更多
  • Solr是一个独立的企业级搜索应用服务器,它对外提供类似于Web-service的API接口。 用户可以通过http请求,向搜索引擎服务器提交一定格式的XML文件,生成索引;也可以通过Http Get操作提出查找请求,并得到XML格式的返回结果。
  • 如果您尝试自行下载存档,则需要安装phpize。 如果您安装了phpize ,请手动执行此操作: pecl download solr-beta tar xvzf solr-2.0.0.tgz cd solr-2.0.0 phpize ./configure make sudo make install # add extension=solr.so to your php.ini / distribution extension loader ..这应该与pecl install solr-beta , ...
  • 这些DB服务器的用途不同,它在很大程度上取决于您的应用程序(以及您存储的数据类型)是否应该仅使用Solr或MySQL。 MySQL可以很好地存储具有大量关系和表格的数据(彼此相关的表格)。 Solr很适合文本搜索(正如你所说:快速索引),如果你没有很多“相关数据”,你确实可以将这些数据存储在相同的文档中。 有些人确实只使用Solr来存储他们的数据库...但我仍然认为RDBM可以很好地用于某些类型的数据。 例如:如果您想允许快速搜索系统用户并存储他们的完整个人资料,以及一些信息详细信息......最好使用So ...
  • 我会建议遵循官方指南 ,它有相当多的细节。 关于Tomcat的东西,它并没有过时,推荐的方法是在Jetty上运行Solr。 关于随时将Solr作为服务运行, 如果您正在运行Windows,则可以通过运行bin\solr.cmd来启动Solr。这将在后台启动Solr,并监听端口8983。 有关如何启动Solr的更多示例 - https://lucene.apache.org/solr/guide/7_2/solr-control-script-reference.html#starting-and-stopp ...
  • 如果您在Ubuntu服务器上的Tomcat中运行Solr,并且已经将Solr WAR部署到/webapps文件夹/webapps 。 然后,根据Solr Wiki上的Lucene / Solr 4 Spatial文档,您只需将JTS distribution /lib文件夹中的所有jar文件复制到运行Solr的WEB-INF/lib文件夹。 更新 由于您使用Jetty运行Solr,因此您需要将JTS jar文件的位置包含为类路径。 基于Clas ...
  • 我不确定,这会对您有所帮助,但请在SolrCloud 5和Zookeeper配置上传中进行交叉检查 可以使用的某些命令如下。 使用所有conf文件创建conf目录 从其中一个节点/opt/myname/solr-5.2.1/bin/solr create -c my_collection -d /opt/myname/solr-5.2.1/server/solr/myconf/conf -n my_colln_cfg -shards运行2 -relicationFactor 2 其他一些有用的链接如下:ht ...
  • 去Solr 4.10.x. 你会省去很多麻烦。 Solr 5.x中没有太多新东西对Sitecore应用程序有益。 我不确定bitnami安装程序,但据我所知,Sitecore最受欢迎的Solr版本之一是Solr 4.10.4 。 您可以从http://archive.apache.org/dist/lucene/solr/下载它 Go for Solr 4.10.x. You will save a lot of troubles. And there is not much new in Solr 5.x ...
  • 它正在使用Jetty,但未来可能不会(因为当您不必考虑围绕您的服务的webapp框架时,有很多事情变得更容易实现)。 这就是为什么5.0明确支持在现有容器中运行(它仍然可以完成 - 但你是独立的,功能可能会中断)。 至少现在可以假定应用程序的环境是某个容器并具有特定的功能集。 It's using Jetty, but it might not in the future (as there are quite a few things that gets easier to implement when ...
  • 当您以Solr用户身份运行时,必须让solr用户访问您要编写配置的目录。 如果这是/opt/solr ,则可以通过发出chown命令递归地更改目录的所有者和所有包含的文件: chown -R solr.solr /opt/solr 这假设您的系统上还有一个名为solr的组。 如果您没有solr组,请使用另一个合适的组,或将最后一个.solr保留在命令之外。 When you're running as the Solr user, you'll have to give the solr user acc ...
  • 这是因为您的Java版本可能太旧了。 几个月前我基本上问了同样的问题。 Debian - Solr无法启动,日志文件被删除 This is because your Java version is probably too old. I basically asked the same question a couple of months ago. Debian - Solr doesn't start and log file is getting deleted