waid 发表于 2015-11-11 15:52:04

jetty配置solr

  1.到jetty官方网站下载jetty8
  


  2.解压文件 把solr4.8目录中的solr目录(索引文件及配置)拷贝到jetty8根目录
  


  3.把solr4.8/webapps下的solr.war解压然后把解压后的目录solr拷贝到jetty8/webapps目录下 此目录下的.war文件可以都删除
  


  4.在jetty/context下创建solr.xml文件(其它.xml文件可以删除) 文件内容如下:
  

<?xml version=&quot;1.0&quot;encoding=&quot;ISO-8859-1&quot;?>
<!DOCTYPE Configure PUBLIC &quot;-//Jetty//Configure//EN&quot; &quot;http://www.eclipse.org/jetty/configure.dtd&quot;>
<Configure class=&quot;org.eclipse.jetty.webapp.WebAppContext&quot;>
<Set name=&quot;contextPath&quot;>/solr</Set>
<Set name=&quot;war&quot;><SystemProperty name=&quot;jetty.home&quot; default=&quot;.&quot;/>/webapps/solr</Set>
<Set name=&quot;extractWAR&quot;>false</Set>
<Set name=&quot;copyWebDir&quot;>false</Set>
<Set name=&quot;defaultsDescriptor&quot;><SystemProperty name=&quot;jetty.home&quot; default=&quot;.&quot;/>/etc/webdefault.xml</Set>
<Get name=&quot;securityHandler&quot;>
<Set name=&quot;loginService&quot;>
<New class=&quot;org.eclipse.jetty.security.HashLoginService&quot;>
<Set name=&quot;name&quot;>Test Realm</Set>
<Set name=&quot;config&quot;><SystemProperty name=&quot;jetty.home&quot; default=&quot;.&quot;/>/etc/realm.properties</Set>
</New>
</Set>
<Set name=&quot;authenticator&quot;>
<New class=&quot;org.eclipse.jetty.security.authentication.FormAuthenticator&quot;>
<Set name=&quot;alwaysSaveUri&quot;>true</Set>
</New>
</Set>
<Set name=&quot;checkWelcomeFiles&quot;>true</Set>
</Get>
</Configure>

5.修改jetty/bin/jetty.sh文件添加以下两行:  
  

JETTY_HOME=/home/eboss/jetty-solr #根据实际调整此路径
exportJETTY_HOME
JAVA_OPTIONS=&quot;-Xmx4g -Xms4g -Xmn1g -XX:MaxPermSize=128m -XX:NewRatio=1 -XX:SurvivorRatio=8 -XX:+UseParallelGC -XX:ParallelGCThreads=5 -XX:+UseParallelOldGC -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods&quot;



  
  6.下载此包 解压后把文件(.jar)文件拷贝到jetty/ext下或者拷贝 solr8/lib/ext中的文件 到 jetty/lib/ext中
  


  7.启动solr
  cd jetty/bin
  ./jetty.sh start
  


  


  



版权声明:本文为博主原创文章,未经博主允许不得转载。
页: [1]
查看完整版本: jetty配置solr