Migrating from Resin 3.0 to Resin 4.0

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
(prelims and startup)
(unix/linux section)
Line 15: Line 15:
 
  java -jar $RESIN_HOME/lib/resin.jar -conf /etc/resin/resin.xml -root-directory=/var/www -server app-a start
 
  java -jar $RESIN_HOME/lib/resin.jar -conf /etc/resin/resin.xml -root-directory=/var/www -server app-a start
  
==JVM arguments==
+
===JVM arguments===
JVM arguments for the main Resin process are now set within the resin.xml file instead of being passed via a script.  Any JVM arguments on the command line actually go to the Watchdog process.   
+
JVM arguments for the main Resin process are now set within the resin.xml file instead of being passed via a script.  Any JVM arguments on the command line actually go to the Watchdog process.  JVM arguments can be set per server in a cluster, but in general you can set them in a <server-default> tag to apply to all servers.
  
==Linux/Unix==
+
For example, if you wanted to set the maximum heap size of all the Resin processes to 1GB:
  
If you are using Linux, a sample init.d script for Resin is
+
  <server-default>
 +
    ...
 +
    <jvm-arg>-Xmx1g</jvm-arg>
 +
 
 +
===Linux/Unix===
 +
 
 +
If you are using Linux, a sample init.d script for Resin is included with the distribution.  The make install command installs it to /etc/init.d/resin.  Edit the file to set the name of the server, the location of the resin.xml file, the log directory, and the root directory.  Check with your distribution's documentation to see how to add the script to one or more of your runtime levels.  The script may be useful for Unix as well.
 +
 
 +
Unix allows only root to bind to ports below 1024.  If you use Resin as your webserver (recommended) and bind to port 80, you'll need to start Resin as root.  In Resin 4.0, the Resin process can drop privileges as soon as it's bound to all its ports.  You can configure the user that Resin uses in the <server> or <server-default> sections:
 +
 
 +
  <server-default>
 +
    ...
 +
      <resin:if test="${resin.userName == 'root'}">
 +
        <user-name>www-data</user-name>
 +
        <group-name>www-data</group-name>
 +
      </resin:if>
  
Binding to port 80
 
  
 
===Windows===
 
===Windows===
Line 34: Line 48:
 
==Hessian==
 
==Hessian==
 
==Deprecated features==
 
==Deprecated features==
 +
 +
Support for Apache 1.x is deprecated
  
 
=Migrating from Resin 3.1=
 
=Migrating from Resin 3.1=
 
==Starting Resin 4.0==
 
==Starting Resin 4.0==
 
For the most part, Resin 4.0 is started the same way as Resin 3.1.  One exception is if you start Resin attached to the terminal.  In general, you should run a Resin server using the "start" command, but
 
For the most part, Resin 4.0 is started the same way as Resin 3.1.  One exception is if you start Resin attached to the terminal.  In general, you should run a Resin server using the "start" command, but

Revision as of 23:19, 12 November 2009

Contents

Preliminaries

Before installation, there are several changes that you'll need to know in order to migrate to Resin 4.0:

  1. The required JDK version is now Java 1.6. As of this writing, Java 1.5 and earlier have reached the end of service life. Make sure you use the JDK -- the JRE is not sufficient.
  2. The build process for compiling the Resin JNI and installing Resin have changed. Before Resin 4.0, you would install Resin by unpacking the distribution directly in the filesystem. Resin 4.0's configure script now creates makefiles that install all the necessary files in standard locations for Linux/Unix. There is also a .deb package for Ubuntu available. Windows installation is unchanged.
  3. The main configuration file has been renamed from resin.conf to resin.xml.

As a general recommendation for migration, we suggest starting with a clean installation of Resin 4.0, including using the sample configuration. By beginning with the sample configuration and modifying it to match your deployment setup, you'll be much more likely to configure the server correctly. This approach is usually much easier than starting with your existing configuration and modifying to make it compatible with the new version.

Migrating from Resin 3.0

Starting Resin

One of the major changes from Resin 3.0 to Resin 4.0 is the introduction of the Resin Watchdog which changes the way in which Resin is started and managed during runtime. The httpd.sh and httpd.exe executables no longer exist. The Watchdog documentation linked above has in-depth details, but essentially Resin now runs with two Java processes, the main Resin process and the Watchdog. This architecture introduces many advantages for management and reliability, but changes the way that Resin is started and how the Java process is managed.

Example Resin 4.0 command line

java -jar $RESIN_HOME/lib/resin.jar -conf /etc/resin/resin.xml -root-directory=/var/www -server app-a start

JVM arguments

JVM arguments for the main Resin process are now set within the resin.xml file instead of being passed via a script. Any JVM arguments on the command line actually go to the Watchdog process. JVM arguments can be set per server in a cluster, but in general you can set them in a <server-default> tag to apply to all servers.

For example, if you wanted to set the maximum heap size of all the Resin processes to 1GB:

 <server-default>
   ...
   <jvm-arg>-Xmx1g</jvm-arg>

Linux/Unix

If you are using Linux, a sample init.d script for Resin is included with the distribution. The make install command installs it to /etc/init.d/resin. Edit the file to set the name of the server, the location of the resin.xml file, the log directory, and the root directory. Check with your distribution's documentation to see how to add the script to one or more of your runtime levels. The script may be useful for Unix as well.

Unix allows only root to bind to ports below 1024. If you use Resin as your webserver (recommended) and bind to port 80, you'll need to start Resin as root. In Resin 4.0, the Resin process can drop privileges as soon as it's bound to all its ports. You can configure the user that Resin uses in the <server> or <server-default> sections:

 <server-default>
   ...
     <resin:if test="${resin.userName == 'root'}">
       <user-name>www-data</user-name>
       <group-name>www-data</group-name>
     </resin:if>


Windows

Logging

Converting clustered setups

Filters

Rewrite filter

JMS

Hessian

Deprecated features

Support for Apache 1.x is deprecated

Migrating from Resin 3.1

Starting Resin 4.0

For the most part, Resin 4.0 is started the same way as Resin 3.1. One exception is if you start Resin attached to the terminal. In general, you should run a Resin server using the "start" command, but

Personal tools