Re: Apache2+Tomcat5.5+mod_jk loadbalancing: Sticky sessions not working

2005-05-12 Thread Kumbarÿffffffffffffffffe7e
 wide
--

!--
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
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/

Valve
className=org.apache.catalina.cluster.tcp.ReplicationValve
  
filter=.*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;/
   
Deployer
className=org.apache.catalina.cluster.deploy.FarmWarDeployer
  tempDir=/tmp/war-temp/
  deployDir=/tmp/war-deploy/
  watchDir=/tmp/war-listen/
  watchEnabled=false/
/Cluster
--



!-- Normally, users must authenticate
themselves to each web app
 individually.  Uncomment the following
entry if you would like
 a user to be authenticated the first time
they encounter a
 resource protected by a security
constraint, and then have that
 user identity maintained across *all* web
applications contained
 in this virtual host. --
!--
Valve
className=org.apache.catalina.authenticator.SingleSignOn
/
--

!-- Access log processes all requests for
this virtual host.  By
 default, log files are created in the
logs directory relative to
 $CATALINA_HOME.  If you wish, you can
specify a different
 directory with the directory attribute.
 Specify either a relative
 (to $CATALINA_HOME) or absolute path to
the desired directory.
--
!--
Valve
className=org.apache.catalina.valves.AccessLogValve
 directory=logs 
prefix=localhost_access_log. suffix=.txt
 pattern=common
resolveHosts=false/
--

!-- Access log processes all requests for
this virtual host.  By
 default, log files are created in the
logs directory relative to
 $CATALINA_HOME.  If you wish, you can
specify a different
 directory with the directory attribute.
 Specify either a relative
 (to $CATALINA_HOME) or absolute path to
the desired directory.
 This access log implementation is
optimized for maximum performance,
 but is hardcoded to support only the
common and combined patterns.
--
!--
Valve
className=org.apache.catalina.valves.FastCommonAccessLogValve
 directory=logs 
prefix=localhost_access_log. suffix=.txt
 pattern=common
resolveHosts=false/
--

  /Host

/Engine

  /Service

/Server

Thanks!
Edlira
--- Mladen Turk [EMAIL PROTECTED] wrote:
 
 Hi,
 
 What is your session timeout on tomcat?
 It might be that the session simply times out,
 so the next tomcat is elected from the load
 balancer.
 
 
 Regards,
 Mladen.
 
 
 Edlira Kumbarÿe7e wrote:
  Hello,
  It
  doesn't seem to work. Each time I refresh the
 page, it
  get served from the same tomcat a couple of times,
  then it gets served from the other tomcat, stays
 on
  that tomcat a couple of refresh hits and then
 swiches
  again. I can't see a pattern or figure out why
 this is
  happening.
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 



__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache2+Tomcat5.5+mod_jk loadbalancing: Sticky sessions not working

2005-05-12 Thread Kumbarÿffffffffffffffffe7e
I'm using the binary version of mod_jk.
Apache v2.0.54
Tomcat v5.5
JK v1.2.12

Thank you,
Edlira
--- Mladen Turk [EMAIL PROTECTED] wrote:
 Edlira Kumbarÿe7e wrote:
  I don't think it's the session timeout on tomcat
  because, as I said in my previous message,I don't
 see
  a pattern in the time pages are served from the
 same
  tomcat. In other words, a page gets served from
  tomcat1 maybe 4 times (each page refresh), then 2
  times from tomcat2, then 3 times from tomcat1,
 without
  a specific pattern.
 
 Really have no idea.
 What version of mod_jk you are using?
 
 Regards,
 Mladen.
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Apache2+Tomcat5.5+mod_jk loadbalancing: Sticky sessions not working

2005-05-11 Thread Kumbarÿffffffffffffffffe7e
Hello,
I have been trying for weeks now to get this to work.
Maybe someone can help me.
I have Apache2 installed and configured in machine A,
using mod_jk to connect to two tomcat servers. Tomcat1
is in machine B and Tomcat2 in machine A. I have
created a workers.properties file, which I have put in
the apache conf. This file specifies workers timcat1
and tomcat2, as well as worker loadbalancer, which is
supposed to balance the load between the two tomcats.
Everything works fine, except for the sticky sessions,
or session affinity. When a page is requested, I need
it to be served from one of the available tomcat
servers, and then each time the page is requested
subsequently from the same machine, it should be
served from the same tomcat server as before. It
doesn't seem to work. Each time I refresh the page, it
get served from the same tomcat a couple of times,
then it gets served from the other tomcat, stays on
that tomcat a couple of refresh hits and then swiches
again. I can't see a pattern or figure out why this is
happening.
Here's my workers.properties file:
#
# workers.properties 
#

# In Windows, we use backward slashes:
ps=\

# list the workers by name

worker.list=loadbalancer

# 
# First tomcat server
# 
worker.tomcat1.port=8009
worker.tomcat1.host=machine B's IP
worker.tomcat1.type=ajp13

# Specify the size of the open connection cache.
#worker.tomcat1.cachesize

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#   lbfactor must be  0
#   Low lbfactor means less work done by the
worker.
worker.tomcat1.lbfactor=100


# 
# Second tomcat server
# 
worker.tomcat2.port=8009
worker.tomcat2.host=machine A's IP
worker.tomcat2.type=ajp13

# Specify the size of the open connection cache.
#worker.tomcat2.cachesize

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#   lbfactor must be  0
#   Low lbfactor means less work done by the
worker.
worker.tomcat2.lbfactor=100

# 
# Load Balancer worker
# 

#
# The loadbalancer (type lb) worker performs weighted
round-robin
# load balancing with sticky sessions.
# Note:
#   If a worker dies, the load balancer will
check its state
#once in a while. Until then all work is
redirected to peer
#worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1,tomcat2
worker.loadbalancer.sticky_session=True

#
# END workers.properties
#


In httpd.conf, I have added:
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug

some JkMount lines

LoadModule jk_module modules/mod_jk.so

In server.xml, I've set jvmRoute=tomcat1 (tomcat2 on
the other tomcat's server.xml)

I can't think of any other infomation that you may
find helpful.
If anyone has any idea, or any question, I really need
help on this.
Anything would be much appreciated.
Thanks,
Edlira

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]