Hi Jordi,

Jordi Prats wrote:
Hi
I'm trying to balance connections using mod_jk, but I'm getting this error:

[Wed Jan 09 11:12:55 2008] [31970:3086935744] [info] ajp_service::jk_ajp_common.c (2186): (loadbalancer) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1) [Wed Jan 09 11:12:55 2008] [31970:3086935744] [info] jk_open_socket::jk_connect.c (566): connect to 127.0.0.1:8009 failed (errno=111) [Wed Jan 09 11:12:55 2008] [31970:3086935744] [info] ajp_connect_to_endpoint::jk_ajp_common.c (869): Failed opening socket to (127.0.0.1:8009) (errno=111) [Wed Jan 09 11:12:55 2008] [31970:3086935744] [error] ajp_send_request::jk_ajp_common.c (1359): (loadbalancer) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111) [Wed Jan 09 11:12:55 2008] [31970:3086935744] [info] ajp_service::jk_ajp_common.c (2186): (loadbalancer) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2) [Wed Jan 09 11:12:55 2008] [31970:3086935744] [error] ajp_service::jk_ajp_common.c (2204): (loadbalancer) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port [Wed Jan 09 11:12:55 2008] [31970:3086935744] [info] jk_handler::mod_jk.c (2364): Service error=-3 for worker=loadbalancer

It's trying to connect to 127.0.0.1:8009, but on my workers.properties file I define that tomcat is listening on 8080:

worker.list=loadbalancer,worker1,worker2

worker.loadbalancer.balance_workers=worker1,worker2

worker.worker1.type=ajp13
worker.worker1.host=192.168.11.6
worker.worker1.port=8080
worker.worker1.lbfactor=1

worker.worker2.type=ajp13
worker.worker2.host=192.168.11.2
worker.worker2.port=8080
worker.worker2.lbfactor=1

Anyone could tell me why is trying to connect to 8009 insted of 8080?

As you can see, it is not only using the wrong port, but also the wrong IP. In fact it is trying to use the worker named "loadbalancer" as a normal ajp13 worker instead of as an load-balancing worker. And for ajp workers, default host+port are localhost+8009.

Solution: you forgot worker.loadbalancer.type=lb :)

But: see also the other reply. Port 8080 by convention is used on the backend for an http connector, which will not work with JK. You need to define an AJP connector on the backends and use the port of this connector in workers.properties.


Thank you!

Jordi

Regards,

Rainer

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to