tomcat负载均衡一例
# lb-en
# ------------------------
# lb-en
# ------------------------
# server1
worker.tomcat-en1.port=8409
worker.tomcat-en1.host=172.16.41.30
worker.tomcat-en1.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat1.cachesize
worker.tomcat-en1.cachesize=100
worker.tomcat-en1.cache_timeout=600
worker.tomcat-en1.socket_keepalive=1
worker.tomcat-en1.socket_timeout=300
#
# 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.tomcat-en1.lbfactor=100
worker.tomcat-en1.port=8409
worker.tomcat-en1.host=172.16.41.30
worker.tomcat-en1.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat1.cachesize
worker.tomcat-en1.cachesize=100
worker.tomcat-en1.cache_timeout=600
worker.tomcat-en1.socket_keepalive=1
worker.tomcat-en1.socket_timeout=300
#
# 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.tomcat-en1.lbfactor=100
# server2
worker.tomcat-en2.port=8409
worker.tomcat-en2.host=172.16.41.31
worker.tomcat-en2.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat1.cachesize
worker.tomcat-en2.cachesize=100
worker.tomcat-en2.cache_timeout=600
worker.tomcat-en2.socket_keepalive=1
worker.tomcat-en2.socket_timeout=300
#
# 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.tomcat-en2.lbfactor=100
worker.tomcat-en2.port=8409
worker.tomcat-en2.host=172.16.41.31
worker.tomcat-en2.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat1.cachesize
worker.tomcat-en2.cachesize=100
worker.tomcat-en2.cache_timeout=600
worker.tomcat-en2.socket_keepalive=1
worker.tomcat-en2.socket_timeout=300
#
# 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.tomcat-en2.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.lb-en.type=lb
# 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.lb-en.type=lb
worker.lb-en.balanced_workers=tomcat-en1,tomcat-en2
worker.lb-en.sticky_session=false
worker.lb-en.sticky_session=false
本文转自 jxwpx 51CTO博客,原文链接:http://blog.51cto.com/jxwpx/196835,如需转载请自行联系原作者