文档章节

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

猪刚烈
 猪刚烈
发布于 2014/10/12 11:47
字数 607
阅读 47
收藏 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.

猪刚烈

猪刚烈

粉丝 22
博文 708
码字总数 110
作品 1
海淀
程序员
私信 提问
加载中
请先登录后再评论。
CDH5: 使用parcels配置lzo

一、Parcel 部署步骤 1 下载: 首先需要下载 Parcel。下载完成后,Parcel 将驻留在 Cloudera Manager 主机的本地目录中。 2 分配: Parcel 下载后,将分配到群集中的所有主机上并解压缩。 3 激...

cloud-coder
2014/07/01
6.8K
1
Nutch学习笔记4-Nutch 1.7 的 索引篇 ElasticSearch

上一篇讲解了爬取和分析的流程,很重要的收获就是: 解析过程中,会根据页面的ContentType获得一系列的注册解析器, 依次调用每个解析器,当其中一个解析成功后就返回,否则继续执行下一个解...

强子哥哥
2014/06/26
712
0
树莓派(Raspberry Pi):完美的家用服务器

自从树莓派发布后,所有在互联网上的网站为此激动人心的设备提供了很多有趣和具有挑战性的使用方法。虽然这些想法都很棒,但树莓派( RPi )最明显却又是最不吸引人的用处是:创建你的完美家用...

异次元
2013/11/09
7.2K
8
在多个浏览器上运行脚本--Queen

假设你想和朋友们玩这么个游戏:你写下某个数字,然后让朋友们猜你写的是什么数字。你的朋友们将不断的给你一些猜测的数字,直到猜中为止。 现在想象你的朋友都是使用的浏览器,这个游戏就相...

匿名
2013/01/24
4.6K
1
opm-server-mirror

代码更新 2009-11-25: 加入反爬虫功能。直接Web访问服务器将跳转到Google。 使用方法 下载index.zip 解压index.zip得到index.php 将index.php传到支持php和cURL的国外服务器上 打开 http:/...

luosheng86
2013/01/29
1K
0

没有更多内容

加载失败,请刷新页面

加载更多

C#中const和readonly有什么区别? - What is the difference between const and readonly in C#?

问题: What is the difference between const and readonly in C#? C#中const和readonly什么区别? When would you use one over the other? 您什么时候可以使用另一个? 解决方案: 参考一...

fyin1314
14分钟前
17
0
百度地图SDK新版内测邀请

本文作者:用****9 百度地图开放平台为开发者提供七大基础服务能力,其中地图SDK和导航SDK是开发者广泛使用的重要基础服务,为了满足开发者更多使用需求以及提升开发者集成后的应用效果,本次...

百度开发者中心
前天
0
0
获取JavaScript数组中的所有唯一值(删除重复项) - Get all unique values in a JavaScript array (remove duplicates)

问题: I have an array of numbers that I need to make sure are unique. 我需要确定一个唯一的数字数组。 I found the code snippet below on the internet and it works great until th......

javail
今天
11
0
如何检查字符串是否为空? - How to check if the string is empty?

问题: Does Python have something like an empty string variable where you can do: Python是否有类似空字符串变量的内容可以在其中执行: if myString == string.empty: Regardless, wh......

富含淀粉
今天
19
0
您如何存储未跟踪的文件? - How do you stash an untracked file?

问题: I have changes to a file, plus a new file, and would like to use git stash to put them away while I switch to another task. 我对一个文件进行了更改,再加上一个新文件,并希......

技术盛宴
今天
39
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部