
[英]Docker tomcat behind apache httpd port 8009 not connecting
[英]can i change ajp connector in place of default port 8009 in apache tomcat for load balancing?
我正在使用mod_jk-1.2.31-httpd-2.2.x.so与Apcahe 2.2.15和RHEL6 LINUX OS上的apache tomcat 6的多个实例进行负载平衡。 我创建了worker.properties
worker.list=stat,balancer
worker.worker1.port=8019
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1
worker.worker2.port=8029
worker.worker2.host=localhost
worker.worker2.type=ajp13
worker.worker2.lbfactor=1
worker.balancer.type=lb
worker.stat.type=status
worker.balancer.balance_workers=worker1,worker2
worker.balancer.method=B
worker.balancer.sticky_session=True
在httpd.conf中
LoadModule jk_module modules/mod_jk-1.2.31-httpd-2.2.x.so
# Load workers files from the config directory "/etc/httpd/conf".
JkWorkersFile /etc/httpd/conf/workers.properties
## Path to jk logs
JkLogFile logs/mod_jk.log
JkShmFile run/mod_jk.shm
# Jk log level [debug/error/info]
JkLogLevel info
# Jk log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions for forwarding
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"
JkMount /status stat
JkMount /Oa balancer
JkMount /Oa/* balancer
如果调用Mount Webproject Oa,则在日志mod_jk.log中
[Thu Dec 03 12:54:41 2015] [22380:140534825461728] [info]
init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized
[Thu Dec 03 12:54:41 2015] [22381:140534825461728] [info]
init_jk::mod_jk.c (3198): mod_jk/1.2.31 (1026297) initialized
[Thu Dec 03 12:54:48 2015] stat newoag.iitk.ac.in 0.000353 [Thu Dec
03 12:55:52 2015] [22385:140534825461728] [info]
jk_open_socket::jk_connect.c (626): connect to 127.0.0.1:8019 failed
(errno=13)
[Thu Dec 03 12:55:52 2015] [22385:140534825461728] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening
socket to (127.0.0.1:8019) (errno=13)
[Thu Dec 03 12:55:52 2015] [22385:140534825461728] [error]
ajp_send_request::jk_ajp_common.c (1578): (worker1) connecting to
backend failed. Tomcat is probably not started or is listening on
the wrong port (errno=13)
[Thu Dec 03 12:55:52 2015] [22385:140534825461728] [info]
ajp_service::jk_ajp_common.c (2543): (worker1) sending request to
tomcat failed (recoverable), because of error during request sending
(attempt=1)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
jk_open_socket::jk_connect.c (626): connect to 127.0.0.1:8019 failed
(errno=13)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening
socket to (127.0.0.1:8019) (errno=13)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [error]
ajp_send_request::jk_ajp_common.c (1578): (worker1) connecting to
backend failed. Tomcat is probably not started or is listening on
the wrong port (errno=13)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
ajp_service::jk_ajp_common.c (2543): (worker1) sending request to
tomcat failed (recoverable), because of error during request sending
(attempt=2)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [error]
ajp_service::jk_ajp_common.c (2562): (worker1) connecting to tomcat
failed.
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
service::jk_lb_worker.c (1388): service failed, worker worker1 is in
error state
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
jk_open_socket::jk_connect.c (626): connect to 127.0.0.1:8029 failed
(errno=13)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening
socket to (127.0.0.1:8029) (errno=13)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [error]
ajp_send_request::jk_ajp_common.c (1578): (worker2) connecting to
backend failed. Tomcat is probably not started or is listening on
the wrong port (errno=13)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
ajp_service::jk_ajp_common.c (2543): (worker2) sending request to
tomcat failed (recoverable), because of error during request sending
(attempt=1)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
jk_open_socket::jk_connect.c (626): connect to 127.0.0.1:8029 failed
(errno=13)
[Thu Dec 03 12:55:53 2015] [22385:140534825461728] [info]
ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening
socket to (127.0.0.1:8029) (errno=13)
请建议我,我可以使用ajp连接器8019,8029 ..代替默认端口8009吗? 运作方式如何? 如果有的话,请发送文档以在一个系统中平衡多个tomcat实例。
在RHEL6中,SELinux是默认的强制模式,对于访问端口设置模式,对于SELinux是许可的
setenforce 0
您可以查看SELinux的模式
getenforce
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.