Rainer Jung wrote:
Hi Tim,
Tim Alberts schrieb:
I have 3 physical servers, all 3 running tomcat6 and the 2 web
applications (one for local, one for www) just fine. Two of these
have apache web servers (local and www), both configured and running
static content by themselves just fine.
Ideally, I want the 3 tomcat6 instances to be a lb cluster for the
two web servers. For reasons I don't understand, it isn't working. The
By cluster here we mean a farm (i.e. multiple nodes carrying the same
apps) but not session replication?
Well I use the setting for 'sticky_session' in the load balancer. As I
understand, it doesn't 'replicate' sessions on multiple servers, but
checks the request URL to send a request from the same client to the
same server throughout the session.
What I remember when I researched my initial setup of the servers is,
there was no 'session replication' so multiple tomcat servers know about
every session simultaneously so request can go to any server without
loosing the session. Has this changed, or am I just confused again?
'local' web server will mount the lb cluster when I only have one
tomcat6 instance listed in the cluster. The 'www' web server won't
mount the cluster if it's 3 or 1 tomcat6 instance. It will mount a
tomcat6 instance without the cluster.
I seem to be lacking some understanding. Can multiple web servers
connect to tomcat6 with mod_jk at the same time, or do I need to
configure additional connectors for each connection?
No, what you are trying to achieve is very normal. The below config
tells us, that the URLs configured in JkMount are send to a load
balancing woker lb, and although you defined three ajp13 workers, the
lb only knows about one of them, "cartman". So lb should send all
requests to cartman.
I wasn't clear enough in my original post. The below configuration
works for the www server. When I add the other 2 nodes to the lb
(worker.lb.balance_workers=cartman,stan,kyle) I get internal server
error (if I remember correctly).
If you can reproduce your problem with single requests, then you can
set your JkLogLevel to debug, restart the web server and send a single
request. The log file will tell you, what mod_jk configured during
startup, if it found a worker it will send the request to, and what it
got back from the worker. I assume, that you already checked, if you
have error messages in the JK log file?
I am only at 'info' log level so I haven't seen anything in the log file
that helped. I will up the setting and re-test.
If you add the other two members to the list of members of lb, can you
see them in the status worker?
My first answer was yes, but now that you ask I don't remember, I'll
have to retest that.
Just in case one of the two web servers uses an even more recent
version of mod_jk: we made our vhost handling more strict. JkMounts
now have to be inside the VirtualHost (if you use them) or you must
use JkMountCopy to inherit mounts from the global server to a vhost.
All mod_jk are the same version.
Regards,
Rainer
Servers are Apache2.2.3 Tomcat6.0.14
mod_jk-1.2.23-apache-2.2.x-linux-x86_64.so
# workers.properties
#
# List workers
worker.list=lb,jkstatus
#
# Define cartman
worker.cartman.port=8009
worker.cartman.host=cartman.inside.msi
worker.cartman.type=ajp13
worker.cartman.socket_timeout=300
worker.cartman.lbfactor=1
#
# Define stan
worker.stan.port=8009
worker.stan.host=stan.inside.msi
worker.stan.type=ajp13
worker.stan.socket_timeout=300
worker.stan.lbfactor=1
#
# Define kyle
worker.kyle.port=8009
worker.kyle.host=kyle.inside.msi
worker.kyle.type=ajp13
worker.kyle.socket_timeout=300
worker.kyle.lbfactor=1
#
#
# Define lb
worker.lb.type=lb
worker.lb.sticky_session=True
worker.lb.sticky_session_force=False
worker.lb.balance_workers=cartman
#
# Define a 'jkstatus' worker using status
worker.jkstatus.type=status
Apache config file mounts the local applications like:
JkMount /localapp lb
JkMount /localapp/* lb
Apache config file mounts the www applications like:
JkMount /wwwapp lb
JkMount /wwwapp/* lb
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]