1. 程式人生 > >resin3.0版本和resin3.1以上版本的配置檔案

resin3.0版本和resin3.1以上版本的配置檔案

resin3.0版本的配置:

<!--
   - Resin 3.0 configuration file.
  -->
<resin xmlns="http://caucho.com/ns/resin"
       xmlns:resin="http://caucho.com/ns/resin/core">
  <!--
     - Logging configuration for the JDK logging API.
    -->
  <log name="" path="stdout:" timestamp="[%H:%M:%S.%s] "/>

  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>

  <!--
     - For production sites, change dependency-check-interval to something
     - like 600s, so it only checks for updates every 10 minutes.
    -->
  <dependency-check-interval>-1</dependency-check-interval>

  <!--
     - You can change the compiler to "javac" or jikes.
     - The default is "internal" only because it's the most
     - likely to be available.
    -->
  <javac compiler="internal" args=""/>

  <!-- Security providers.
     - <security-provider>
     -    com.sun.net.ssl.internal.ssl.Provider
     - </security-provider>
    -->

  <!--
     - If starting bin/resin as root on Unix, specify the user name
     - and group name for the web server user.
     -
     - <user-name>resin</user-name>
     - <group-name>resin</group-name>
    -->

  <!--
     - Configures threads shared among all HTTP and SRUN ports.
    -->
  <thread-pool>
    <!-- Maximum number of threads. -->
    <thread-max>1024</thread-max>

    <!-- Minimum number of spare connection threads. -->
    <spare-thread-min>10</spare-thread-min>
  </thread-pool>

  <!--
     - Configures the minimum free memory allowed before Resin
     - will force a restart.
    -->
  <min-free-memory>1M</min-free-memory>

  <server>
    <!-- adds all .jar files under the resin/lib directory -->
    <class-loader>
      <tree-loader path="${resin.home}/lib"/>
      <tree-loader path="${server.root}/lib"/>
    </class-loader>

    <!-- Configures the keepalive -->
    <keepalive-max>500</keepalive-max>
    <keepalive-timeout>10s</keepalive-timeout>

    <resin:if test="${resin.isProfessional()}">
      <select-manager enable="true"/>
    </resin:if>

    <!-- listen to the http ports only after the server has started. -->
    <bind-ports-after-start/>

    <!-- The http port -->
    <http server-id="a" host="*" port="8080"/>

    <!--
       - SSL port configuration:
       -
       - <http port="8443">
       -   <openssl>
       -     <certificate-file>keys/gryffindor.crt</certificate-file>
       -     <certificate-key-file>keys/gryffindor.key</certificate-key-file>
       -     <password>test123</password>
       -   </openssl>
       - </http>
      -->

    <!--
       - The local cluster, used for load balancing and distributed
       - backup.
      -->
    <cluster>
      <srun server-id="" host="127.0.0.1" port="6802"/>
    </cluster>

    <!--
       - Configures the persistent store for single-server or clustered
       - in Resin professional.
      -->
    <resin:if test="${resin.isProfessional()}">
      <persistent-store type="cluster">
        <init path="session"/>
      </persistent-store>
    </resin:if>

    <!--
       - Enables/disables exceptions when the browser closes a connection.
      -->
    <ignore-client-disconnect>true</ignore-client-disconnect>

    <!--
       - For security, use a different cookie for SSL sessions.
       - <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>
      -->

    <!--
       - Enables the cache (available in Resin Professional) 
      -->
    <resin:if test="${isResinProfessional}">
      <cache path="cache" memory-size="8M"/>
    </resin:if>

    <!--
       - Enables periodic checking of the server status.
       -
       - With JDK 1.5, this will ask the JDK to check for deadlocks.
       - All servers can add <url>s to be checked.
      -->
    <resin:if test="${isResinProfessional}">
      <ping>
        <!-- <url>http://localhost:8080/test-ping.jsp</url> -->
      </ping>
    </resin:if>

    <!--
       - Defaults applied to each web-app.
      -->
    <web-app-default>
      <!--
         - Extension library for common jar files.  The ext is safe
         - even for non-classloader aware jars.  The loaded classes
         - will be loaded separately for each web-app, i.e. the class
         - itself will be distinct.
        -->
      <class-loader>
        <tree-loader path="${server.root}/ext-webapp"/>
      </class-loader>

      <!--
         - Sets timeout values for cacheable pages, e.g. static pages.
        -->
      <cache-mapping url-pattern="/" expires="5s"/>
      <cache-mapping url-pattern="*.gif" expires="60s"/>
      <cache-mapping url-pattern="*.jpg" expires="60s"/>

      <!--
         - Servlet to use for directory display.
        -->
      <servlet servlet-name="directory"
              servlet-class="com.caucho.servlets.DirectoryServlet"/>

      <!--
         - Enable EL expressions in Servlet and Filter init-param
        -->
      <allow-servlet-el/>

      <!--
         - for security, disable session URLs by default.
        -->
      <session-config>
        <enable-url-rewriting>false</enable-url-rewriting>
      </session-config>

      <!--
         - For security, set the HttpOnly flag in cookies.
         - <cookie-http-only/>
        -->
    </web-app-default>

    <!--
       - Sample database pool configuration
       -
       - The JDBC name is java:comp/env/jdbc/test
         <database>
           <jndi-name>jdbc/mysql</jndi-name>
           <driver type="org.gjt.mm.mysql.Driver">
             <url>jdbc:mysql://localhost:3306/test</url>
             <user></user>
             <password></password>
            </driver>
            <prepared-statement-cache-size>8</prepared-statement-cache-size>
            <max-connections>20</max-connections>
            <max-idle-time>30s</max-idle-time>
          </database>
      -->

    <!--
       - Default host configuration applied to all virtual hosts.
      -->
    <host-default>
      <class-loader>
        <compiling-loader path="webapps/WEB-INF/classes"/>
        <library-loader path="webapps/WEB-INF/lib"/>
      </class-loader>

      <!--
         - With another web server, like Apache, this can be commented out
         - because the web server will log this information.
        -->
      <access-log path="logs/access.solr.log" 
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1W"/>
	<stdout-log path="log/solrout.log"
            archive-format="solrout-%Y%m%d.log.gz"
            timestamp="[%Y.%m.%d %H:%M:%S.%s]"
            rollover-size="5000mb"
            rollover-period="1W"/>
	<stderr-log path="log/solrerr.log"
            archive-format="solrerr-%Y%m%d.log.gz"
            timestamp="[%Y.%m.%d %H:%M:%S.%s]"
            rollover-size="5000mb"
            rollover-period="1W"/>

      <!-- creates the webapps directory for .war expansion -->
      <web-app-deploy path="webapps"/>

      <!-- creates the deploy directory for .ear expansion -->
      <ear-deploy path="deploy">
        <ear-default>
          <!-- Configure this for the ejb server
             -
             - <ejb-server>
             -   <config-directory>WEB-INF</config-directory>
             -   <data-source>jdbc/test</data-source>
             - </ejb-server>
            -->
        </ear-default>
      </ear-deploy>

      <!-- creates the deploy directory for .rar expansion -->
      <resource-deploy path="deploy"/>

      <!-- creates a second deploy directory for .war expansion -->
      <web-app-deploy path="deploy"/>
    </host-default>

    <!-- includes the web-app-default for default web-app behavior -->
    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <host id="test.index.com" root-directory=".">
        <host-alias>doc.index.com</host-alias>
        <character-encoding>UTF-8</character-encoding>
        <web-app id="/solr" document-directory="/home/app/workspace/index/solr"  />
    </host>

   </server>
</resin>
resin3.1以及以上版本加入了cluster的概念,配置如下:
<!--
   - Resin 3.1 configuration file.
  -->
<resin xmlns="http://caucho.com/ns/resin"
       xmlns:resin="http://caucho.com/ns/resin/core">

  <!-- adds all .jar files under the resin/lib directory -->
  <class-loader>
    <tree-loader path="${resin.home}/ext-lib"/>
    <tree-loader path="${resin.root}/ext-lib"/>

    <tree-loader path="${resin.home}/lib"/>
    <tree-loader path="${resin.root}/lib"/>
  </class-loader>

  <!--
     - Management configuration
     -
     - Remote management requires at least one enabled admin user.
    -->
  <management path="${resin.root}/admin">
    <user name="admin" password="password" disable="true"/>

    <resin:if test="${resin.professional}">
      <deploy-service/>
      <jmx-service/>
      <log-service/>
      <xa-log-service/>
    </resin:if>
  </management>

  <!--
     - Logging configuration for the JDK logging API.
    -->
  <log name="" level="info" path="stdout:"
       timestamp="[%H:%M:%S.%s] {%{thread}} "/>

  <!--
     - 'info' for production
     - 'fine' or 'finer' for development and troubleshooting
    -->
  <logger name="com.caucho" level="info"/>

  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>

  <!--
     - For production sites, change dependency-check-interval to something
     - like 600s, so it only checks for updates every 10 minutes.
    -->
  <dependency-check-interval>2s</dependency-check-interval>

  <!--
     - SMTP server for sending mail notifications
    -->
  <system-property mail.smtp.host="127.0.0.1"/>
  <system-property mail.smtp.port="25"/>

  <!--
     - Sets the default character encoding to utf-8
     -
     - <character-encoding>utf-8</character-encoding>
    -->

  <!--
     - You can change the compiler to "javac", "eclipse" or "internal".
    -->
  <javac compiler="internal" args="-source 1.5"/>

  <!-- Security providers.
     - <security-provider>
     -    com.sun.net.ssl.internal.ssl.Provider
     - </security-provider>
    -->

  <!-- Uncomment to use Resin's XML implementations
     -
     - <system-property javax.xml.parsers.DocumentBuilderFactory
     -                 ="com.caucho.xml.parsers.XmlDocumentBuilderFactory"/>
     - <system-property javax.xml.parsers.SAXParserFactory
     -                 ="com.caucho.xml.parsers.XmlSAXParserFactory"/>
    -->

  <cluster id="app-tier">
   
    <root-directory>.</root-directory>

    <server-default>
     
      <http address="10.120.45.222" port="8080"/>
      <jvm-arg>-Xmx256m</jvm-arg>
      <jvm-arg>-Xss1m</jvm-arg>
      <jvm-arg>-Xdebug</jvm-arg>
      <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>

      <watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg>
      <watchdog-port>6600</watchdog-port>
      <memory-free-min>1M</memory-free-min>
      <thread-max>256</thread-max>
      <socket-timeout>65s</socket-timeout>
      <keepalive-max>128</keepalive-max>
      <keepalive-timeout>15s</keepalive-timeout>
    </server-default>

   
    <server id="" address="127.0.0.1" port="6800"/>

  
    <resin:if test="${resin.professional}">
      <persistent-store type="cluster">
        <init path="session"/>
      </persistent-store>
    </resin:if>
    <resin:if test="${resin.professional}">
      <cache path="cache" memory-size="64M">
        <rewrite-vary-as-private/>
      </cache>
    </resin:if>
    <resin:if test="${resin.professional}">
      <ping>
        <!-- <url>http://localhost:8080/test-ping.jsp</url> -->
      </ping>
    </resin:if>
   <web-app-default>
      <prologue>
        <class-loader>
          <tree-loader path="${resin.root}/ext-webapp-lib"/>
        </class-loader>
        <allow-servlet-el/>
      </prologue>
    
      <cache-mapping url-pattern="/" expires="5s"/>
      <cache-mapping url-pattern="*.gif" expires="60s"/>
      <cache-mapping url-pattern="*.jpg" expires="60s"/>
      <cache-mapping url-pattern="*.png" expires="60s"/>

      <session-config>
        <enable-url-rewriting>false</enable-url-rewriting>
      </session-config>
        <jsp>
          <validate-taglib-schema>true</validate-taglib-schema>
          <fast-jstl>true</fast-jstl>
        </jsp>
   </web-app-default>

   
    <resin:import path="${resin.home}/conf/app-default.xml"/>


  
    <host-default>
     
      <access-log path="logs/access.log" 
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1W"/>

     
      <web-app-deploy path="webapps"/>

     
      <ear-deploy path="deploy">
        <ear-default>
          <ejb-server>
            <config-directory>WEB-INF</config-directory>
          </ejb-server>
        </ear-default>
      </ear-deploy>

    
      <resource-deploy path="deploy"/>
    </host-default>

   
    <host-deploy path="hosts">
      <host-default>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

   
    <host id="" root-directory=".">
      <web-app id="/" root-directory="webapps/ROOT"/>
      <web-app id="/resin-admin" root-directory="${resin.home}/php/admin">
      <prologue>
          <resin:set var="resin_admin_external" value="false"/>
          <resin:set var="resin_admin_insecure" value="true"/>
        </prologue>
      </web-app>
    </host>

  </cluster>
   

  <!--
     - Configuration for the web-tier/load-balancer
    -->
  <resin:if test="${resin.professional}">
    <cluster id="web-tier">
      <server-default>
        <!-- The http port -->
        <http address="10.120.45.222" port="9080"/>
      </server-default>

      <server id="web-a" address="127.0.0.1" port="6700"/>

      <cache path="cache" memory-size="64M"/>

      <host id="">
        <web-app id="/">

           <rewrite-dispatch>
             <load-balance regexp="" cluster="app-tier"/>
           </rewrite-dispatch>

        </web-app>
      </host>
    </cluster>
  </resin:if>
  
  
  
 
<!--  應用程式配置solr例項 -->

  <cluster id="solr">
    <root-directory>.</root-directory>
      <server-default>
       <jvm-arg>-Xms4096m</jvm-arg>
      <jvm-arg>-Xmx4096m</jvm-arg>
      <jvm-arg>-Xmn1024m</jvm-arg>
      <jvm-arg>-XX:SurvivorRatio=5</jvm-arg>
      <jvm-arg>-XX:PermSize=128m</jvm-arg>
      <jvm-arg>-XX:MaxPermSize=256m</jvm-arg>
      <jvm-arg>-XX:+UseParNewGC</jvm-arg>
      <jvm-arg>-XX:ParallelGCThreads=4</jvm-arg>
      <jvm-arg>-XX:+UseConcMarkSweepGC</jvm-arg>
      <jvm-arg>-verbose:gc</jvm-arg>
      <jvm-arg>-XX:+PrintGCDetails</jvm-arg>
          <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>
      <watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg>
      <watchdog-port>6608</watchdog-port>
      <jvm-arg>-DnumShards=1</jvm-arg> 
      <jvm-arg>-DzkHost=zk1:2181,zk2:2181,zk3:2181</jvm-arg>
      <jvm-arg>-server</jvm-arg>
           <http id=""  address="10.120.45.222" port="9090"/>
    </server-default>


    <server id="solr"  address="127.0.0.1" port="6808" />      
   
  <resin:import path="${resin.home}/conf/app-default.xml"/>  
  
    <host id="" root-directory=".">
      <web-app id="/solr" root-directory="/data/workspace/modelindex/solr">
      

      </web-app>

      
   </host>

</cluster>


<!--   搜尋應用 -->
 
  <cluster id="modelSearch">
    <root-directory>.</root-directory>
     <server-default>
      <jvm-arg>-Xms1536m</jvm-arg>
      <jvm-arg>-Xmx1536m</jvm-arg>
      <jvm-arg>-Xmn384m</jvm-arg>
      <jvm-arg>-XX:SurvivorRatio=5</jvm-arg>
      <jvm-arg>-XX:PermSize=128m</jvm-arg>
      <jvm-arg>-XX:MaxPermSize=256m</jvm-arg>
      <jvm-arg>-XX:+UseParNewGC</jvm-arg>
      <jvm-arg>-XX:ParallelGCThreads=4</jvm-arg>
      <jvm-arg>-XX:+UseConcMarkSweepGC</jvm-arg>
      <jvm-arg>-verbose:gc</jvm-arg>
      <jvm-arg>-XX:+PrintGCDetails</jvm-arg> 
      <jvm-arg>-server</jvm-arg>
          <watchdog-port>6603</watchdog-port>
          <http id=""  address="10.120.45.222" port="8081"/>
   </server-default>

   <server id="modelSearch"   address="127.0.0.1"  port="6805" />
   <resin:import path="${resin.home}/conf/app-default.xml"/> 
   <host id="test.search.com" root-directory=".">
      <web-app id="/IndexByModelSolr"  root-directory="/data/workspace/IndexByModelSolr"/>
    </host>
   
  </cluster>

</resin>