resin3.1.8在从jdk1.6升级到jdk1.8后的配置改动

一直还在用resin3.1系列。
最新项目升级,需要升级jdk从1.6到jdk1.8.升级后的resin需要做必要的配置更新。

为了确保万一我对resin做了重新编译(操作前的备份是必要的):
进入到resin安装包目录

./configure --prefix=/usr/local/resin
make
make install

然后将之前的resin中的resin.conf resin-82.conf配置比较了一下没有什么特殊变化,拷贝回来到新的resin/conf下。

将mysql-connector-java-5.1.17-bin.jar拷贝到resin/lib下

service resin start 发现还用的jdk1.6 java启动,需要修改:

vi /etc/init.d/resin
将其中:
JAVA_HOME=/usr/java/jdk1.8 (原来为jdk1.6的目录)

然后可以用新版jdk1.8启动了。
但是启动报错, jvm-default.log日志显示:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=64M; support was removed in 8.0
MaxTenuringThreshold of 20 is invalid; must be between 0 and 15

将之前的resin.conf 中对jvm的优化参数中的PermSize=64M 去掉,MaxTenuringThreshold=20 改为 MaxTenuringThreshold=15

然后启动,ok。

附录:
resin3.1 在jdk1.6下的jvm优化参数:

      <!--
         - The JVM arguments
        -->
      <jvm-arg>-Xmx1024m</jvm-arg>
      <jvm-arg>-Xms1024m</jvm-arg>
      <jvm-arg>-Xss1m</jvm-arg>
      <jvm-arg>-Xmn100M</jvm-arg>                                                                                     
      <jvm-arg>-XX:PermSize=64M</jvm-arg>                                                                             
      <jvm-arg>-XX:SurvivorRatio=8</jvm-arg>                                                                           
      <jvm-arg>-XX:MaxTenuringThreshold=20</jvm-arg>                                                                   
      <jvm-arg>-XX:+UseParNewGC</jvm-arg>                                                                              
      <jvm-arg>-XX:+UseConcMarkSweepGC</jvm-arg>                                                                       
      <jvm-arg>-XX:+UseCMSCompactAtFullCollection</jvm-arg>                                                            
      <jvm-arg>-XX:CMSFullGCsBeforeCompaction=1</jvm-arg>                                                             
      <jvm-arg>-XX:-CMSParallelRemarkEnabled</jvm-arg>                                                                 
      <jvm-arg>-XX:CMSInitiatingOccupancyFraction=50</jvm-arg>                                                         
      <jvm-arg>-Xloggc:/data/logs/resin/gc_resin_88.log</jvm-arg> 
     
      <jvm-arg>-XX:-UseGCOverheadLimit</jvm-arg>
     
      <jvm-arg>-Djava.awt.headless=true</jvm-arg>
      <jvm-arg>-J-server</jvm-arg>
     
      <jvm-arg>-Xdebug</jvm-arg>
      <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>


resin3.1 在jdk1.8下的jvm优化参数:
<!--
         - The JVM arguments
        -->
      <jvm-arg>-Xmx1024m</jvm-arg>
      <jvm-arg>-Xms1024m</jvm-arg>
      <jvm-arg>-Xss1m</jvm-arg>
      <jvm-arg>-Xmn100M</jvm-arg>
      <jvm-arg>-XX:SurvivorRatio=8</jvm-arg>
      <jvm-arg>-XX:MaxTenuringThreshold=15</jvm-arg>
      <jvm-arg>-XX:+UseParNewGC</jvm-arg>
      <jvm-arg>-XX:+UseConcMarkSweepGC</jvm-arg>
      <jvm-arg>-XX:+UseCMSCompactAtFullCollection</jvm-arg>
      <jvm-arg>-XX:CMSFullGCsBeforeCompaction=1</jvm-arg>
      <jvm-arg>-XX:-CMSParallelRemarkEnabled</jvm-arg>
      <jvm-arg>-XX:CMSInitiatingOccupancyFraction=50</jvm-arg>
      <jvm-arg>-Xloggc:/data/logs/resin/gc_resin_88.log</jvm-arg>

      <jvm-arg>-XX:-UseGCOverheadLimit</jvm-arg>

      <jvm-arg>-Djava.awt.headless=true</jvm-arg>
      <jvm-arg>-J-server</jvm-arg>

      <jvm-arg>-Xdebug</jvm-arg>
      <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>

当然这里需要根据自身情况适当调整。

你可能感兴趣的:(jvm,jdk,resin)