我有两个bat文件start.bat和stop.bat用于手动启动和停止SOLR服务器,是否可以创建一个windows服务,它将在启动服务时调用start.bat,并在停止service时调用stop.bat
发布于 2011-08-26 17:56:22
考虑一下Tomcat的Solr多核特性。每个核心就像一个完全成熟的安装,“独立的配置和索引,为非常不同的应用程序提供自己的配置和模式,但仍然具有统一管理的便利性”http://wiki.apache.org/solr/CoreAdmin
即使您不使用多个索引,它的设置也要优雅得多。如果Tomcat是这样设置的,那么Solr在启动时是可用的。我假设您使用的是Solr 1.4。
您需要执行以下步骤:
设置solr根目录
概述
c:\solr
|-lib
|-solr.war
|-solr.xmlcore参数指定一个新的核心。这些属性指定服务目录的索引目录是myindexdir,这将引导我们进入下一步。
创建实际的核心
概述
c:\solr
|-lib
|-solr.war
|-solr.xml
|-myindexdir
|-bin
|-conf
|-data设置tomcat
安装Tomcat,运行一次(不要跳过这一步)并打开http://localhost:8080查看它是否安装成功当然,通过使用这个目录Apache
Context docBase="c:\solr\solr.war“debug="0”crossContext="true“>
欢迎来到Solr!Solr管理员myindex
现在,像http://localhost:8080/mysearchapp/myindex/select?q=MY-QUERY一样在内核上执行操作
发布于 2011-08-25 18:51:31
Solr运行在像Tomcat这样的Servlet容器之上。因此,要启动Solr,您必须使用Servlet容器配置Solr,然后启动。
是的,你当然可以创建一个Windows服务。但是,您没有提到使用哪个Servlet容器来运行Solr?
如果是Apache Tomcat,则转到:
1. Just go to tomcat/bin folder from command prompt
2. Say service.bat install
3. You can see the service being listed in the Microsoft Services
Application
4. Right click on the service and add solr home (in Start
parameters). For an example if your Solr home is in D drive then:
-Dsolr.solr.home="D:\solr"
5.You are done. Just right click on the service, start it or even you can set
it to start automatically when your system starts.https://stackoverflow.com/questions/7188816
复制相似问题