Thanks Guru.. Below is the log entry from mod_jk.log
[Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1806): worker tomcat1 contact is '192.168.10.30:8009' [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1895): setting socket keepalive to 1 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1934): setting socket timeout to -1 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1938): setting socket buffer size to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1942): setting connection recycle timeout to 180 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1946): setting cache timeout to 180 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1950): setting connect timeout to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1954): setting reply timeout to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1958): setting prepost timeout to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1962): setting recovery opts to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1966): setting number of retries to 3 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1843): setting connection cache size to 20 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_worker.c (141): about to create instance tomcat2 of ajp13 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_worker.c (154): about to validate and init tomcat2 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1806): worker tomcat2 contact is '192.168.10.50:9009' [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1895): setting socket keepalive to 1 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1934): setting socket timeout to -1 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1938): setting socket buffer size to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1942): setting connection recycle timeout to 180 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1946): setting cache timeout to 180 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1950): setting connect timeout to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1954): setting reply timeout to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1958): setting prepost timeout to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1962): setting recovery opts to 0 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1966): setting number of retries to 3 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_ajp_common.c (1843): setting connection cache size to 20 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_lb_worker.c (833): Balanced worker 0 has name tomcat1 in domain [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_lb_worker.c (833): Balanced worker 1 has name tomcat2 in domain [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_worker.c (248): removing old loadbalancer worker [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_shm.c (72): Shared memory is already opened [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] jk_shm.c (105): Attached shared memory [1] size=65536 free=64696 addr=0x7cb5c8 [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] mod_jk.c (2306): Attached shm:memory [Mon Jun 18 21:27:32 2007] [2292:2296] [debug] mod_jk.c (2316): Initialized mod_jk/1.2.14 [Mon Jun 18 21:54:41 2007] [2292:2296] [debug] mod_jk.c (1747): Shmem cleanup [Mon Jun 18 21:54:41 2007] [2292:2296] [debug] mod_jk.c (1747): Shmem cleanup [Mon Jun 18 21:54:41 2007] [2300:1396] [debug] mod_jk.c (1747): Shmem cleanup Can u pls give the tested code for tomcatapplication, serve.xml, workers.properties, mod_jk.conf,mod_jk_cluster.conf. and how to run a application.. Bcoz i tried with many times i cant get session replication.. Thanks On 6/20/07, Phi-Long LE <[EMAIL PROTECTED]> wrote:
did you try to add the address attribute within <connector> tag ? something looks strange in your worker.properties i.e. worker.tomcat1.lbfactor=1 worker.tomcat2.lbfactor=100 this two directive mean something like you will use 100 times tomcat2 for 1 time tomcat1... if you want to use the two tomcat at the same load you should specify the same number can we have your mod_jk.log at the apache startup ?? you should as well start tomcat first Le 20/06/2007 11:10, shiva sha a écrit : > Hi I follwoed the below URLs... > > http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html > http://tomcat.apache.org/connectors-doc/reference/workers.html > http://tomcat.apache.org/connectors-doc/generic_howto/workers.html > > But no luck.. Session is not get replicated.. > This is my configuraion > > Apache Version : 2.2.4 > Tomcat Version : 5.5.17 > JDK : 1.6.0_01 > Win 2000 > > workers.properties > > worker.list=tomcat1,tomcat2,loadbalancer > > # First tomcat server > > worker.tomcat1.type=ajp13 > worker.tomcat1.host=192.168.10.30 > worker.tomcat1.port=8009 > worker.tomcat1.lbfactor=1 > worker.tomcat1.connection_pool_timeout=600 > worker.tomcat1.socket_keepalive=1 > worker.tomcat1.socket_timeout=60 > worker.tomcat1.cachesize=20 > worker.tomcat1.cache_timeout=180 > worker.tomcat1.recycle_timeout=180 > > # Second tomcat server > > worker.tomcat2.type=ajp13 > worker.tomcat2.host=192.168.10.50 > worker.tomcat2.port=9009 > worker.tomcat2.lbfactor=1 > worker.tomcat2.connection_pool_timeout=600 > worker.tomcat2.socket_keepalive=1 > worker.tomcat2.socket_timeout=60 > worker.tomcat2.cachesize=20 > worker.tomcat2.cache_timeout=180 > worker.tomcat2.recycle_timeout=180 > > worker.tomcat2.lbfactor=100 > worker.loadbalancer.type=lb > worker.loadbalancer.sticky_session=True > worker.loadbalancer.balance_workers=tomcat1,tomcat2 > > Below is the Tomcat1 server.xml. > > > <Server port="8005" shutdown="SHUTDOWN"> > > <Listener className="org.apache.catalina.core.AprLifecycleListener" /> > <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener " > /> > <Listener className=" > org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> > <Listener className=" > org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/> > > > <GlobalNamingResources> > > > <Environment name="simpleValue" type="java.lang.Integer" value="30"/> > > <Resource name="UserDatabase" auth="Container" > type="org.apache.catalina.UserDatabase" > description="User database that can be updated and saved" > factory="org.apache.catalina.users.MemoryUserDatabaseFactory" > pathname="conf/tomcat-users.xml" /> > > </GlobalNamingResources> > > <Service name="Catalina"> > > <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --> > <Connector port="8081" maxHttpHeaderSize="8192" > maxThreads="150" minSpareThreads="25" maxSpareThreads="75" > enableLookups="false" redirectPort="8443" acceptCount="100" > connectionTimeout="20000" disableUploadTimeout="true" /> > > <!-- Define an AJP 1.3 Connector on port 8009 --> > <Connector port="8009" > enableLookups="false" redirectPort="8443" > protocol="AJP/1.3" > /> > > <!-- Define the top level container in our container hierarchy --> > <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"> > > <Realm className="org.apache.catalina.realm.UserDatabaseRealm" > resourceName="UserDatabase"/> > > <!-- Define the default virtual host > Note: XML Schema validation will not work with Xerces 2.2. > --> > <Host name="localhost" appBase="webapps" > unpackWARs="true" autoDeploy="true" > xmlValidation="false" xmlNamespaceAware="false"> > > > <Cluster > className="org.apache.catalina.cluster.tcp.SimpleTcpCluster > " > managerClassName=" > org.apache.catalina.cluster.session.DeltaManager" > expireSessionsOnShutdown="false" > useDirtyFlag="true" > notifyListenersOnReplication="true"> > > <Membership > className="org.apache.catalina.cluster.mcast.McastService " > mcastAddr="228.0.0.4" > mcastBindAddress="192.168.10.30" > mcastPort="45564" > mcastFrequency="500" > mcastDropTime="3000"/> > > <Receiver > className=" > org.apache.catalina.cluster.tcp.ReplicationListener" > tcpListenAddress="auto" > tcpListenPort="4001" > tcpSelectorTimeout="100" > tcpThreadCount="6"/> > > <Sender > className=" > org.apache.catalina.cluster.tcp.ReplicationTransmitter" > replicationMode="pooled" > ackTimeout="15000" > waitForAck="true"/> > > <Valve className=" > org.apache.catalina.cluster.tcp.ReplicationValve" > > filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;"/> > > > <Deployer className=" > org.apache.catalina.cluster.deploy.FarmWarDeployer" > tempDir="/tmp/war-temp/" > deployDir="/tmp/war-deploy/" > watchDir="/tmp/war-listen/" > watchEnabled="false"/> > > <ClusterListener className=" > org.apache.catalina.cluster.session.ClusterSessionListener"/> > </Cluster> > > > </Host> > > </Engine> > > </Service> > > </Server> > > For Tomcat2 i had changed the below elements only.. > > <Server port="9005" shutdown="SHUTDOWN"> > <Connector port="9081" maxHttpHeaderSize="8192" > maxThreads="150" minSpareThreads="25" maxSpareThreads="75" > enableLookups="false" redirectPort="8443" acceptCount="100" > connectionTimeout="20000" disableUploadTimeout="true" /> > > <!-- Define an AJP 1.3 Connector on port 8009 --> > <Connector port="9009" > enableLookups="false" redirectPort="8443" > protocol="AJP/1.3" > /> > <Membership > className="org.apache.catalina.cluster.mcast.McastService " > mcastAddr="228.0.0.4" > mcastBindAddress="192.168.10.50" > mcastPort="45564" > mcastFrequency="500" > mcastDropTime="3000"/> > > Program code.. > > I had designed a bean and servlet like this.. > > import java.io.*; > import javax.servlet.*; > import javax.servlet.http.*; > import java.util.*; > import com.bean.SessionCart; > > public class SessionStoreServlet extends HttpServlet > { > > > public synchronized void init (ServletConfig config) throws > ServletException > > { > super.init(); > > } > > > public void doPost (HttpServletRequest req, HttpServletResponse res) > throws ServletException, IOException > { > > StringBuffer HTML = new StringBuffer(); > res.setContentType("text/html"); > PrintWriter out = res.getWriter(); > SessionCart sc; > HttpSession session = req.getSession(true); > > > sc= new SessionCart(); > session.putValue("Cart",sc); > > String userName=req.getParameter("loginid"); > > > ((SessionCart)session.getValue("Cart")).setName(userName); > > out.println("Your account number is " + > ((SessionCart)session.getValue("Cart")).getName()); > } > > } > and Bean is like this.. > > package com.bean; > > public class SimpleBean implements java.io.Serializable { > > > private String name = null; > private int age = 0; > > > public SimpleBean() {} > > public String getName() { > return name; > } > > public void setName(String s) { > name = s; > } > > } > > HTML like this > > <form method="POST" action="servlet/SessionStoreServlet"> > <input type="text" name="loginid" size="20"></p> > <input type="password" name="password" size="20"></td> > <td width="50%"><input type="submit" value="Submit" name="B1"></td> > <td width="50%"><input type="reset" value="Reset" name="B2"></td> > > I had paste the mod_jk.dll in conf/modules.. > > What i m trying is > First i started the Apache and then Tomcat1,Tomcat2.. > I run the html file in Tomcat1 and the given value is stored in > session and > displays the same. > Then stop the Tomcat1.. > If i run the same HTML i want to show the session value which is > stored in > Tomcat instance1.. > But i can not get the old session value..It will start new session only.. > Session is not get replicated across Tomcat instances... > > Is there is any wrong in my steps? > > Replication memebers are added sucessfully in both tomcat instances.. > i.e, > replication member messages > > are shown in Tomcats but session is not get replicated.. > > Pls help.. > If possible give tested code and server.xml, workers.properties .. > Bcoz no one document is clear abor mod_jk.. > I m confused .. > Thanks > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]