2019/11/28

톰켓 로드발란싱

로드 발란싱
/etc/apache2/workers.properties

cat worker.properties
workers.tomcat_home=/usr/share/apache-tomcat-6.0.35
workers.java_home=/usr/lib/jvm/java-6-sun
ps=/

worker.list=loadbalancer,status
worker.worker1.port=8009
worker.worker1.host=worker1
worker.worker1.type=ajp13
worker.worker1.lbfactor=1

#setup node2
worker.worker2.port=8009
worker.worker2.host=worker2
worker.worker2.type=ajp13
worker.worker2.lbfactor=1

#setup the load-balancer
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=worker1,worker 2
worker.loadbalancer.sticky_session=True
#worker.loadbalancer.sticky_session_force=True

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

mod_proxy_ajp 사용해 구성할 수 있음.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

<Location />
    ProxyPass balancer://tomcat/ stickysession=JSESSIONID
</Location>

<Proxy balancer://tomcat>
   BalancerMember ajp://server1:9050 route=managed1 smax=5 max=20 ttl=120 retry=300
   BalancerMember ajp://server2:9050 route=managed2 smax=5 max=20 ttl=120 retry=300
   BalancerMember ajp://server3:9050 route=managed3 smax=5 max=20 ttl=120 retry=300
</Proxy>

댓글 없음:

댓글 쓰기