Caucho Technology
  • resin 4.0
  • dynamic servers


    Resin includes the ability to add servers to clusters dynamically. These dynamic servers are able to use distributed sessions and the distributed object cache. The triad also updates these servers with applications that are deployed via the remote deployment server. The Resin load balancer is also able to dispatch requests to them as with any static server.

    Overview

    Adding a dynamic server to a cluster is a simple two-step process:

    1. Register the dynamic server with a triad server via JMX.
    2. Start the new dynamic server using the registration in the previous step.

    Preliminaries

    Before adding a dynamic server, you must:

    • Set up and start a cluster with a triad, e.g.
      Example: conf/resin.xml
      <resin xmlns="http://caucho.com/ns/resin">
      
      <cluster id="app-tier">
        ...
        <server id="triad-a" address="234.56.78.90" port="6800"/>
        <server id="triad-b" address="34.56.78.90" port="6800"/>
        <server id="triad-c" address="45.67.89.12" port="6800"/>
      
    • Install at least one admin password, usually in admin-users.xml
    • Enable the RemoteAdminService for the cluster, e.g.
      <resin xmlns="http://caucho.com/ns/resin">
      
      <cluster id="app-tier">
        ...
        <admin:RemoteAdminService xmlns:admin="urn:java:com.caucho.admin"/>
        ...
      
    • Enable the dynamic servers for the cluster, e.g.
      <resin xmlns="http://caucho.com/ns/resin">
      
      <cluster id="app-tier">
        ...
        <dynamic-server-enable>true</dynamic-server-enable>
        ...
      

    Check the main Clustering section for more information on this topic.

    Registering a dynamic server

    For the first step of registration, you can use a JMX tool like jconsole or simply use the Resin administration web console. We'll show how to do the latter method here. For registration, you'll specify three values:

    web-app deployment options
    NAMEDESCRIPTION
    Server idSymbolic identifier of the new dynamic server. This is also specified when starting the new server.
    IPThe IP address of the new dynamic server. May also be host name.
    PortThe server port of the new dynamic server. Usually 6800.

    With these three values, browse to the Resin administration application's "cluster" tab. If you have enabled dynamic servers for your cluster, you should see a form allowing you to register the server in the "Cluster Overview" table.

    Once you have entered the values and added the server, it should show up in the table as a dead server because we haven't started it yet. The dynamic server's registration will be propagated to all the servers in the cluster.

    Starting a dynamic server

    Now that we've registered the dynamic server, we can start it and have it join the cluster. In order for the new server to be recognized and accepted by the triad, it needs to start with the same resin.xml that the triad is using, the name of the cluster it is joining, and the values entered in the registration step. These can all be specified on the command line when starting the server:

    dynamic-server> java -jar $RESIN_HOME/lib/resin.jar -conf /etc/resin/resin.xml \
                         -dynamic-server app-tier:123.45.67.89:6800 start
    

    Specifying the configuration file allows the new server to configure itself using the <server-default> options, to find the triad servers of the cluster it is joining, and to authenticate using the administration logins. This command starts the server, which immediately contacts the triad to join the cluster. Once it has successfully joined, the "Cluster" tab of the administration application should look like this:


    Copyright © 1998-2009 Caucho Technology, Inc. All rights reserved.
    Resin ® is a registered trademark, and Quercustm, Ambertm, and Hessiantm are trademarks of Caucho Technology.