You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Pitre, Russell" <RP...@shawmut.com> on 2003/12/16 19:37:56 UTC

Tomcat 5 Clustering

Hello All:

 

Please excuse my ignorance, I'm trying to achieve clustering with Tomcat
5....I've read the following in the Tomcat 5 documentation:

========================================================================
=====

To run session replication in your Tomcat 5 container, the following
steps should be completed:
    -->All your session attributes must implement java.io.Serializable 

========================================================================
=======

 

Okay. I've completed all the other steps (uncomment the <Cluster>
element along with the <valve>, and added the <distributable/> in
web.xml)........I'm trying to code a simple object that implements
java.io.Serializable to store in a session and here it is.....

 

package com.shawmut.session;

import java.io.Serializable;

 

public class SerializeSession implements Serializable {

            

            public static String testString  = "";

 

            public void setString(String stringValue){

                        this.testString = stringValue;

            }

            public String getString(){

                        return this.testString;

            }

}

 

ok.....Now I want to put this in the session.....

 

<%

            if(session.getAttribute("ss")== null){

                        SerializeSession ss = new SerializeSession();

                        ss.setString("Booooooooooooooo! And I created my
session on Tomcat 1 Node");

                        session.setAttribute("ss", ss);

            }

%>

 

 

 

 

Whats going on here?.....I unplug the patch cord ( docs says it's a bad
idea) from one of the boxes and hit a jsp on the working node that does
the following......and the session doesn't carry over to the working
node....

 

<%

if(session.getAttribute("ss")!= null){

            SerializeSession ss2 =
(SerializeSession)session.getAttribute("ss");

%>

SESSION:<%=ss2.getString()%>

 

<%

}           

%>

 

 

 

Basically what I'm looking for is an example of serializing session
attributes as noted above.... Any Help here will be greatly
appreciated......

 

 

Russ

 

 

 


Re: Tomcat 5 Clustering

Posted by Filip Hanik <de...@hanik.com>.
download a load balancer

balance.sourceforge.net or a perl balancer called "pen" (google)

the shut down one tomcat, after initial access, the system will fail over.

pulling the network cable without any other failure has not yet been handled
as a failure scenario

Filip

----- Original Message -----
From: "Pitre, Russell" <RP...@shawmut.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, December 16, 2003 10:37 AM
Subject: Tomcat 5 Clustering


Hello All:



Please excuse my ignorance, I'm trying to achieve clustering with Tomcat
5....I've read the following in the Tomcat 5 documentation:

========================================================================
=====

To run session replication in your Tomcat 5 container, the following
steps should be completed:
    -->All your session attributes must implement java.io.Serializable

========================================================================
=======



Okay. I've completed all the other steps (uncomment the <Cluster>
element along with the <valve>, and added the <distributable/> in
web.xml)........I'm trying to code a simple object that implements
java.io.Serializable to store in a session and here it is.....



package com.shawmut.session;

import java.io.Serializable;



public class SerializeSession implements Serializable {



            public static String testString  = "";



            public void setString(String stringValue){

                        this.testString = stringValue;

            }

            public String getString(){

                        return this.testString;

            }

}



ok.....Now I want to put this in the session.....



<%

            if(session.getAttribute("ss")== null){

                        SerializeSession ss = new SerializeSession();

                        ss.setString("Booooooooooooooo! And I created my
session on Tomcat 1 Node");

                        session.setAttribute("ss", ss);

            }

%>









Whats going on here?.....I unplug the patch cord ( docs says it's a bad
idea) from one of the boxes and hit a jsp on the working node that does
the following......and the session doesn't carry over to the working
node....



<%

if(session.getAttribute("ss")!= null){

            SerializeSession ss2 =
(SerializeSession)session.getAttribute("ss");

%>

SESSION:<%=ss2.getString()%>



<%

}

%>







Basically what I'm looking for is an example of serializing session
attributes as noted above.... Any Help here will be greatly
appreciated......





Russ









---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org