BLOG ARTICLE JBoss Apache | 1 ARTICLE FOUND

  1. 2008/09/29 Clustered JBoss에 대한 Apache 설정 및 애플리케이션 주의 사항.

먼저 각각 구동시킨 JBoss 인스턴스 의 JvmRoute 와 UseJK를 true로 설정해야 합니다.

각 인스턴스의 해당 파일들을 수정합니다.
(*) ...../jboss-web.deploy/server.xml 에서
    <Engine name="jboss.web" defaultHost="localhost" jvmRoute="host1" >
     jvmRoute 는 각 인스턴스 마다 고유의 이름으로 설정합니다.
(*)...../jboss-web.deploy/META-INF/jboss-service.xml
  <attribute name="UseJK">true</attribute>  를 true로설정

BindingManager 를 사용하시었다면  AJP port를 확인하도록 합니다.

Apache에서 다음의 httpd.conf 및 workers.properties 파일을 아래와 비교하여 점검합니다.


httpd.conf 추가사항

# Load mod_jk module
# Update this path to match your modules location
#LoadModule jk_module          modules/mod_jk-1.2.26-httpd-2.2.6.so
LoadModule jk_module          modules/mod_jk.so

# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile conf/workers.properties

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile     logs/mod_jk.log

# Set the jk log level [debug/error/info]
#JkLogLevel    debug
JkLogLevel    info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# JkOptions indicate to send SSL KEY SIZE,
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories +ForwardURICompatUnparsed

# JkRequestLogFormat set the request format
JkRequestLogFormat     "%w %V %T"

# Send everything for context /examples to worker named worker1 (ajp13)

JkMount  /hello/* loadbalancer
JkMount  /jkstatus* jkstatus

workers.properties 신규 목록

# Define load balancer worker using ajp13
worker.list=loadbalancer, sso, node1, node2, jkstatus

# Set properties for node1 (ajp13)
worker.node1.type=ajp13
worker.node1.maintain=60
worker.node1.host=10.64.160.179
worker.node1.port=8109
worker.node1.lbfactor=1
worker.node1.cachesize=50
worker.node1.cache_timeout=60000
worker.node1.socket_timeout=60
worker.node1.socket_keepalive=true
worker.node1.connect_timeout=10000  // AJPConnector의 connectionTimeout과 동일한 시간으로 설정하세요
worker.node1.recycle_timeout=3000
worker.node1.recovery_options=7
worker.node1.redirect=node2

# Set properties for node2 (ajp13)
worker.node2.type=ajp13
worker.node2.maintain=60
worker.node2.host=10.64.160.179
worker.node2.port=8209
worker.node2.lbfactor=1
worker.node2.cachesize=50
worker.node2.cache_timeout=60000
worker.node2.socket_timeout=60
worker.node2.socket_keepalive=true
worker.node2.connect_timeout=10000  // AJPConnector의 connectionTimeout과 동일한 시간으로 설정하세요
worker.node2.recycle_timeout=3000
worker.node2.recovery_options=7
worker.node2.redirect=node1

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1, node2
worker.loadbalancer.method=Session
worker.loadbalancer.sticky_session=True
#worker.loadbalancer.sticky_session_force=True

worker.jkstatus.type=status

(*) ...../jboss-web.deploy/server.xml 에서
<!-- A AJP 1.3 Connector on port 8009 -->
      <Connector port="8009" address="${jboss.bind.address}"
         maxThreads="250" connectionTimeout="20000" emptySessionPath="true"
EnableLookups="false" redirectPort="8443"
         protocol="AJP/1.3"/> 을 설정

주의 사항은 다음과 같습니다.
maxThreads값은 Apache의 MaxClients값보다 커야 함.
maxThreads는 성능 테스트 후 최대 성능 지점으로 잡고, Apache의 MaxClients는 이 값보다 작게 설정하는 방식으로 진행
특히 몇 대의 JBoss로 두고 Apache에서 로드 밸런싱할 경우에는 20% 정도 더 maxThreads를 크게 해서 여유를 둬야 함.

더더욱 주의 사항
HTTP Session replication을 위해서는 한 가지 더 web application의 web.xml파일에 아래의 같이 distributable 태그가 포함되어야 세션 설정이 됩니다.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "
http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>JBoss Sample Web Application</display-name>
  <distributable/>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>



 

크리에이티브 커먼즈 라이센스
Creative Commons License
2008/09/29 15:44 2008/09/29 15:44