Apache & Tomcat Balanceamento de carga via problema Mod_jk

1

Espero que isso encontre todos vocês no melhor de sua saúde e espírito. Eu tenho um problema com uma nova configuração onde atualmente tenho 1 APACHE 2.2.15 & Tomcat 6.0.14 no RHEL. Mod_JK versão 1.2.30. Vou adicionar o segundo Tomcat quando isso começar a funcionar.

Então, quando eu tento apontar o meu navegador para apache-host: porta i get IT WORKS, mas se o navegador ponto para hospedar: porta // exemplos / jsp / Eu recebo um 404 .... apache isnt encaminhando solicitações para Tomcat Tomcat funciona bem, eu posso navegar para a página de exemplos JSP e executar coisas. Eu simplesmente não consigo fazer isso através do apache. Qualquer ajuda é muito apreciada ... por favor ajude !!!!!

Aqui estão minhas configurações .... nenhum host virtual configurado ...

HTTPD.CONF 
Include conf/jk/mod_jk.conf 
LoadModule jk_module modules/mod_jk.so 

MOD_JK.CONF 
JkWorkersFile conf/jk/workers.properties 
JkShmFile logs/mod_jk.shm 
JkLogFile logs/mod_jk.log 
JkLogLevel info 
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " 

WORKERS.PROPERTIES 
worker.list=loadbalancer,status 

# Node #1 properties 
worker.worker1.type=ajp13 
worker.worker1.host=localhost 
worker.worker1.port=8009 
worker.worker1.lbfactor=1 

# Node #2 properties(will be configured later when apache and node 1 start working) 
worker.worker2.type=ajp13 
worker.worker2.host=localhost 
worker.worker2.port=001 
worker.worker2.lbfactor=1 

# Load-balancing behaviour 
worker.loadbalancer.type=lb 
worker.loadbalancer.balance_workers=worker1,worker2 

# Status worker for managing load balancer 
worker.status.type=status 

#JkMount /* loadbalancer 
JkMount /examples/jsp lb 
JkMount /examples/jsp/* lb 


tomcat server.xml has this 
<Service name="Catalina"> 
... 
<!-- Define an AJP 1.3 Connector on port 8009 --> 
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> 
... 
</Service>
    
por vikingz 22.02.2013 / 05:37

2 respostas

1

WORKERS.PROPERTIES

# Load-balancing behaviour 
worker.loadbalancer.type=lb 
worker.loadbalancer.balance_workers=worker1,worker2 

#JkMount /* loadbalancer 
JkMount /examples/jsp lb 
JkMount /examples/jsp/* lb

Isso está errado. Mova a diretiva JkMount para o mod_jk.conf , algo assim:

JkWorkersFile conf/jk/workers.properties 
JkShmFile logs/mod_jk.shm 
JkLogFile logs/mod_jk.log 
JkLogLevel info 
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " 

JkMount /examples/jsp loadbalancer
JkMount /examples/jsp/* loadbalancer

Observe que o trabalhador do Tomcat deve ser loadbalancer , conforme definido no workers.properties , em vez de lb .

    
por 22.02.2013 / 06:06
0

Corrigido ambos ... agora eu só recebo uma página em branco .... ele reclama sobre o segundo worker nos logs do mod_jk sobre o host está inativo, mas eu acho que está tudo bem, já que eu não tenho o worker 2 configurado. Deve encaminhar pedidos para o trabalhador 1, certo?

eu recebo isso em logs de acesso quando eu tento host: porta / exemplos / jsp

172.31.118.231 - - [22/Feb/2013:09:27:09 -0600] "GET /examples/jsp HTTP/1.1" 200 -
172.31.118.231 - - [22/Feb/2013:09:27:21 -0600] "GET /examples/jsp HTTP/1.1" 200 -
172.31.118.231 - - [22/Feb/2013:09:27:21 -0600] "GET /favicon.ico HTTP/1.1" 404 209
172.31.118.231 - - [22/Feb/2013:09:28:06 -0600] "GET /examples/jsp HTTP/1.1" 200 -
172.31.118.231 - - [22/Feb/2013:09:28:07 -0600] "GET /favicon.ico HTTP/1.1" 404 209

em registros de erros

[Fri Feb 22 09:26:00 2013] [error] [client 172.31.118.231] File does not exist: /opt/fas/loader/tomproj/apache2.2.15/htdocs/examples

em mod_jklogs

[Fri Feb 22 09:25:27 2013] [5773:47624974852416] [info] init_jk::mod_jk.c (3189): mod_jk/1.2.30 initialized
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [info] jk_open_socket::jk_connect.c (622): connect to 127.0.0.1:1 failed (errno=111)
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [info] ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening socket to (127.0.0.1:1) (errno=111)
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [error] ajp_send_request::jk_ajp_common.c (1585): (worker2) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [info] ajp_service::jk_ajp_common.c (2540): (worker2) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [info] jk_open_socket::jk_connect.c (622): connect to 127.0.0.1:1 failed (errno=111)
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [info] ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening socket to (127.0.0.1:1) (errno=111)
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [error] ajp_send_request::jk_ajp_common.c (1585): (worker2) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [info] ajp_service::jk_ajp_common.c (2540): (worker2) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [error] ajp_service::jk_ajp_common.c (2559): (worker2) connecting to tomcat failed.
[Fri Feb 22 09:26:45 2013] [5777:1119607104] [info] service::jk_lb_worker.c (1388): service failed, worker worker2 is in error state

é o

    
por 22.02.2013 / 16:52