1概述:
windows和linux安装方式相同。
2.准备:
1)下载solr4.4 resin ik
2)更改ik与solr兼容部分打包ik.jar
3)解压solr4.4到D盘 将D:\solr-4.4.0\example\solr目录复制到D:\resin盘,改名solr_home,并将D:\solr-4.4.0\example\solr-webapp\solr.war复制到
D:\resin\webapp目录下
4)将D:\solr-4.4.0\example\lib\ext下的所有jar和ik.jar放入solr.war的WEB-INF\lib下 在WEB-INF下建立classes目录将D:\solr-4.4.0\example\resources\log4j.properties放入此目录 将solr.log=logs/设为solr.log=log
5)在resin.xml更改两处如下
1.
<host id="" root-directory="."> 2. <!--
- Configures the main application cluster. Load-balancing configurations
- will also have a web cluster.
-->
<cluster id="app">
<server-default>
<jvm-arg>-Xms512m</jvm-arg>
<jvm-arg>-Xmx512m</jvm-arg>
<jvm-arg>-Xmn256m</jvm-arg>
<jvm-arg>-XX:PermSize=128m</jvm-arg>
<jvm-arg>-XX:MaxPermSize=256m</jvm-arg>
<jvm-arg>-Dbootstrap_confdir=D:/resin/solr_home/collection/conf</jvm-arg>
<jvm-arg>-Dcollection.configName=question</jvm-arg>
<jvm-arg>-Djetty.port=8080</jvm-arg>
<jvm-arg>-DzkRun</jvm-arg>
<jvm-arg>-DzkHost=localhost:9080</jvm-arg>
<jvm-arg>-DnumShards=2</jvm-arg>
<thread-max>100</thread-max>
<socket-timeout>30s</socket-timeout>
<keepalive-max>512</keepalive-max>
<keepalive-timeout>60s</keepalive-timeout>
</server-default>
6)复制resin目录为resin1
7)更改resin1下resin.properties端口
app_servers : 127.0.0.1:6801
app.http : 8081
web.http : 8081
8)更改resin1下resin.xml 3处
1. <server-multi id-prefix="app-" address-list="${app_servers}" port="6801">
<!--新增-->
<watchdog-port>6601</watchdog-port>
</server-multi>
2.<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/" root-directory="webapps/ROOT"/>
<web-app id="/solr" document-directory="webapps/solr" archive-path="D:/resin1/webapps/solr.war" character-encoding="utf-8">
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>D:/resin1/solr_home</env-entry-value>
</env-entry>
</web-app>
</host>
3. <!--
- Configures the main application cluster. Load-balancing configurations
- will also have a web cluster.
-->
<cluster id="app">
<server-default>
<jvm-arg>-Xms512m</jvm-arg>
<jvm-arg>-Xmx512m</jvm-arg>
<jvm-arg>-Xmn256m</jvm-arg>
<jvm-arg>-XX:PermSize=128m</jvm-arg>
<jvm-arg>-XX:MaxPermSize=256m</jvm-arg>
<jvm-arg>-Djetty.port=8081</jvm-arg>
<jvm-arg>-DzkHost=localhost:9080</jvm-arg>
<thread-max>100</thread-max>
<socket-timeout>30s</socket-timeout>
<keepalive-max>512</keepalive-max>
<keepalive-timeout>60s</keepalive-timeout>
</server-default>
9)在resin和resin1下执行启动
10)resin优化
resin.properties:
web_admin_enable : false
session_store : false (不需要考虑session 持久化)
resin_doc : false
dev_mode:false
proxy_cache_enable : false (关闭静态页的缓存)
resin.xml
<server-default>
<jvm-arg>-Xms1024m</jvm-arg>
<jvm-arg>-Xmx1024m</jvm-arg>
<jvm-arg>-Xmn256m</jvm-arg>
<jvm-arg>-XX:PermSize=128m</jvm-arg>
<jvm-arg>-XX:MaxPermSize=256m</jvm-arg>
<jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>
<thread-max>1024</thread-max>
<socket-timeout>30s</socket-timeout>
<keepalive-max>512</keepalive-max>
<keepalive-timeout>60s</keepalive-timeout>
<server-default>
11) 多核布置 将multicore改成solr 复制到resin根目录下
resin.xml下添加
<host id="" root-directory=".">
<!--
- webapps can be overridden/extended in the resin.xml
-->
<web-app id="/solr" document-directory="webapps/solr" archive-path="webapps/solr.war" character-encoding="utf-8">
<env-entry>
<env-entry-name>solr/home</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>solr</env-entry-value>
</env-entry>
</web-app>
</host>
<cluster id="app">
<server-default>
<jvm-arg>-Xms2048m</jvm-arg>
<jvm-arg>-Xmx2048m</jvm-arg>
<jvm-arg>-Xmn512m</jvm-arg>
<jvm-arg>-XX:PermSize=512m</jvm-arg>
<jvm-arg>-XX:MaxPermSize=512m</jvm-arg>
<jvm-arg>-Dbootstrap_conf=true</jvm-arg>
<jvm-arg>-Djetty.port=7100</jvm-arg>
<jvm-arg>-DzkHost=10.10.82.204:2181,10.10.82.204:2182,10.10.82.204:2183</jvm-arg>
<jvm-arg>-DnumShards=1</jvm-arg>
<thread-max>1024</thread-max>
<socket-timeout>30s</socket-timeout>
<keepalive-max>512</keepalive-max>
<keepalive-timeout>60s</keepalive-timeout>
</server-default>