文档章节

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

猪刚烈
 猪刚烈
发布于 2014/10/12 11:47
字数 607
阅读 21
收藏 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
Apache Solr介绍及安装

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

丢失的羊羔
2015/12/25
38
0
技术分享:如何用Solr搭建大数据查询平台

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

广岛秋泽
2016/03/30
0
0

没有更多内容

加载失败,请刷新页面

加载更多

开源 java CMS - FreeCMS2.8会员我的留言

项目地址:http://www.freeteam.cn/ 我的留言 从左侧管理菜单点击我的留言进入。在这里可以查看当前登录会员的所有留言记录。 查看留言 点击留言标题可以查看留言详细内容。 删除留言 选择留...

freeteam
10分钟前
1
0
OSChina 周五乱弹 —— 这就是不要女朋友的理由

Osc乱弹歌单(2018)请戳(这里) 【今日歌曲】 @狄安娜的猫 :分享丁家鑫的单曲《丁家鑫 - 克罗地亚狂想曲 - 古筝remix》 《丁家鑫 - 克罗地亚狂想曲 - 古筝remix》 手机党少年们想听歌,请...

小小编辑
41分钟前
356
12
CentOS配置Tomcat监听80端口,虚拟主机

Tomcat更改默认端口为80 更改的配置文件是: /usr/local/tomcat/conf/server.xml [root@test-a ~]# vim /usr/local/tomcat/conf/server.xml # 找到 Connector port="8080" protocol="HTTP/1......

野雪球
今天
6
0
《稻盛和夫经营学》读后感心得体会3180字范文

《稻盛和夫经营学》读后感心得体会3180字范文: 一代日本经营之圣稻盛和夫凭借刻苦勤奋的精神以及深植于佛教的商业道德准则,成为了“佛系”企业家的代表人物。在《稻盛和夫经营学》“领导人...

原创小博客
今天
4
0
java框架学习日志-5(常见的依赖注入)

依赖注入(dependency injection) 之前提到控制反转(Inversion of Control)也叫依赖注入,它们其实是一个东西,只是看的角度不同,这章详细说一下依赖注入。 依赖——指bean对象创建依赖于...

白话
今天
5
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部