文档章节

分别使用Jetty和Tomcat搭建Solr服务器(Setting up Solr Server with Jetty or Tomcat)

猪刚烈
 猪刚烈
发布于 2014/10/12 11:47
字数 607
阅读 20
收藏 0

1 Prerequisites


1.1 Apache Ant

Any recent version should do and is available at http://ant.apache.org/.

(This manual is base on Solr 1.3.0. and It's suitable for any recent version. The reason we use Ant is that the version of Solr (1.3.0) we use is very old, there’s no available distribution for download. We need build with Ant from source code.)


2 Setup Solr Server with Jetty


Solr can run in any java servlet container of your choice. Specially, we can start up Solr with a jetty server located at “example” directory under Solr installation directory. So, for developers, this is the most convenient way to start up a Solr server. (NOTE: this is not suitable for production environment!)

2.1 Check Out Solr

Shell> svn co http://svn.apache.org/repos/asf/lucene/solr/tags/release-1.3.0 apache-solr-1.3.0
NOTE: Version 1.3.0 is required, because the client version of Solr (a.k.s solrj) in Currensee is 1.3.0

2.2 Build Example

Shell> cd apache-solr-1.3.0
Shell> ant example

Build example will help us generate a runnable jetty server with Solr.

2.3 Deploy Configuration Files

Solr server communicating with clients base on common configurations (e.g. the structure of documents to be indexed), any projects (clients) have to provide its own configuration files. Normally, these files should be under a directory, and this directory is so called Solr Home. For example: the home of solr's example project is "apache-solr-1.3.0/example/solr". When starting Solr server, we have to specify Solr Home via a system property:-Dsolr.solr.home=solr.

2.4 Start Up Solr Server

Make sure you are under example directory, then, execute:
Shell> java -Dsolr.solr.home=solr -jar start.jar
This will start up the Jetty application server on port 8983, and use your terminal to display the logging information from Solr. If no errors or exceptions, you can access: http://localhost:8983/solr/admin/ to verify whether this sever is available. This is the main starting point for Administering Solr.


3 Setup Solr Server with Standalone Tomcat


3.1 Modify Tomcat Setting

Download & install tomcat, open file" conf/server.xml", replace element <Connector port="8080" ...../> with

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

this setting change tomcat default port to solr's default port and set URI encoding as UTF-8

3.2 Build Solr Distribution

Shell> cd  apache-solr-1.3.0

# Use 'ant dist' to build the Solr WAR and JAR files.

Shell> ant dist

# Copy generated solr war to tomcat webapps dir and rename to solr.war

Shell> cp dist/apache-solr-1.3.0.war /path/to/tomcat/webapps/solr.war

3.3 Prepare Solr Home Directory

To simplify this manual, we use the home directory of Solr's example project. so, we can set its path or copy it to tomcat:

Shell> cp -r apache-solr-1.3.0/example/solr /path/to/tomcat

3.4 Set System Property for Tomcat

If you are under tomcat home dir, open "/bin/catalina.sh",  add

JAVA_OPTS=-Dsolr.solr.home=solr

at the begining.

Actually, if we didn't copy the home directory of Solr's example project to tomcat home dir, you set path at here, then, the JAVA_OPTS should be:

JAVA_OPTS=-Dsolr.solr.home=/path/to/apache-solr-1.3.0/example/solr

3.5 Start Up Solr Server

If you are under tomcat home dir, run:

Shell> bin/catalina.sh run

This will start up the Jetty application server on port 8983, and use your terminal to display the logging information from Solr. If no errors or exceptions, you can access: http://localhost:8983/solr/admin/ to verify whether this sever is available. This is the main starting point for Administering Solr.

本文转载自:http://blog.csdn.net/bluishglc/article/details/7514251

共有 人打赏支持
猪刚烈
粉丝 22
博文 708
码字总数 110
作品 1
海淀
程序员
Solr7.4.0在windows系统下使用Jetty和Tomcat运行教程

SOLR 7.4.0版本,JDK需要8.0以上的版本,如果用Tomcat运行,Tomcat也要选择8.0以上的版本。 下载地址:http://www.apache.org/dyn/closer.lua/lucene/solr/7.4.0 solr可以使用jetty和tomcat运...

zchuanzhao
07/12
0
0
Solr之——整合Tomcat

Solr是一种基于Lucene的全文搜索引擎,有关Solr的详细内容请参考官方文档,这里不做详细说明,我们这里主要介绍Solr如何与Tomcat做整合。 特别说明:本文中的Solr使用的是3.5.0,Tomcat版本为...

龙之天空
2016/07/13
29
0
windows solrcloud伪分布式搭建

一 、概述 最近几个月装了好几次windows solrcloud伪分布式,参考了其他博客,我自己也总结了一下,包含一些注意和一些错误的解决方法。 参考博客: http://blog.csdn.net/wanghui2008123/ar...

小叮当_加V
2016/12/14
90
0
技术分享:如何用Solr搭建大数据查询平台

0×00 开头照例扯淡 自从各种脱裤门事件开始层出不穷,在下就学乖了,各个地方的密码全都改成不一样的,重要帐号的密码定期更换,生怕被人社出祖宗十八代的我,甚至开始用起了假名字,我给自己起一...

广岛秋泽
2016/03/30
0
0
Apache Solr介绍及安装

Solr是什么 Solr是一个基于Lucene java库的企业级搜索服务器,包含XML/HTTP,JSON API,高亮查询结果,缓存,复制,还有一个WEB管理界面。Solr运行在Servlet容器中,其架构如下: 主要功能包...

丢失的羊羔
2015/12/25
38
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

python3.6 取整除法

python3.6 中取整除法运算逻辑如下: d 非零,那么商 q 满足这样的关系: a = qd + r ,且0 ≤ r n1=7//3#7 = 3*2 +1n2=-6.1//3#-7 = 3*(-3)+2'{},{}'.format(n1,n2) 从运行结果可以...

colinux
29分钟前
3
0
阶段总结——用虚拟机搭建一个高可用负载均衡集群架构

[toc] linux基本知识已经介绍完,现有一个业务需要操作,通过对这个项目的操作,可以复习、总结、巩固之前的知识点; ** 用13台虚拟机搭建一个高可用负载均衡集群架构出来,并运行三个站点,...

feng-01
32分钟前
0
0
mysql 设置utf8字符集 (CentOS)

1.查看数据库及mysql应用目前使用的编码方式 (1)链接mysql 客户端 (2)执行:status 结果: 2.修改mysql 应用的字符编码(server characterset ) (1)打开配置文件:vim /etc/mysql/my...

qimh
32分钟前
0
0
windows无法格式化u盘解决方法

1。点开始-运行-输入cmd-format f: /fs: fat32 (这里f:是指U盘所在盘符) 这个格式化会很慢 请耐心等待

大灰狼wow
43分钟前
0
0
MySql 8.0连接失败

原来,MySql 8.0.11 换了新的身份验证插件(caching_sha2_password), 原来的身份验证插件为(mysql_native_password)。而客户端工具Navicat Premium12 中找不到新的身份验证插件(caching_s...

放飞E梦想O
今天
1
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部