Enterprise Server를 Sun GlassFish Web Stack과 함께 사용할 수 있습니다. Sun GlassFish Web Stack은 Apache HTTP Server, PHP, Ruby 등의 구성 요소를 사전에 통합하여 번들로 제공합니다. Sun GlassFish Web Stack에 대한 자세한 내용은 http://www.sun.com/software/webstack/index.xml을 참조하십시오.
Enterprise Server는 Sun Java System Web Server, Apache Web Server 및 Microsoft IIS에서 프론트 엔드로 구현된 로드 밸런서 플러그인을 사용하여 로드 균형 조정에 대한 지원을 제공합니다. Enterprise Server를 프론트 엔드로 구현하기 위한 또 다른 기술은 mod_jk 커넥터와 함께 Apache httpd를 사용하는 것입니다.
Enterprise Server 클러스터를 만듭니다.
다음 JVM 옵션을 다음과 같이 정의합니다.
asadmin create-jvm-options --target cluster_name "-DjvmRoute=\${AJP_INSTANCE_NAME
asadmin create-jvm-options --target cluster_name "-Dcom.sun.enterprise.web.connector.enableJK=\${AJP_PORT}
다음 명령어를 사용하여 클러스터의 각 인스턴스에 대해 JVM 옵션(AJP_PORT 및 AJP_INSTANCE_NAME)을 구성합니다.
asadmin create-system-properties --target instance_name AJP_INSTANCE_NAME=instance_name
asadmin create-system-properties --target instance_name AJP_PORT=port-number
클러스터를 다시 시작합니다.
Apache httpd를 설치합니다.
Apache httpd는 http://httpd.apache.org/download.cgi에서 사용할 수 있습니다.
mod_jk를 설치합니다.
mod_jk 커넥터는 http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/에서 사용할 수 있습니다.
mof_jk.so 파일에 다음 줄을 추가합니다.
LoadModule jk_module path_to_mod_jk.so JkWorkersFile /etc/apache2/worker.properties # Where to put jk logs JkLogFile /var/log/httpd/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel debug # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " # JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T" # Send all jsp requests to GlassFish JkMount /*.jsp loadbalancer. |
새로운 파일(/etc/apache2/worker.properties)을 만들고 다음 줄을 추가합니다.
# Define 1 real worker using ajp13 worker.list=loadbalancer # Set properties for instance1 worker.instance1.type=ajp13 worker.instance1.host=localhost worker.instance1.port=9090 worker.instance1.lbfactor=50 worker.instance1.cachesize=10 worker.instance1.cache_timeout=600 worker.instance1.socket_keepalive=1 worker.instance1.socket_timeout=300 # Set properties for instance2 worker.instance2.type=ajp13 worker.instance2.host=localhost worker.instance2.port=9091 worker.instance2.lbfactor=50 worker.instance2.cachesize=10 worker.instance2.cache_timeout=600 worker.instance2.socket_keepalive=1 worker.instance2.socket_timeout=300 # Set properties for instance3 worker.instance3.type=ajp13 worker.instance3.host=localhost worker.instance3.port=9092 worker.instance3.lbfactor=50 worker.instance3.cachesize=10 worker.instance3.cache_timeout=600 worker.instance3.socket_keepalive=1 worker.instance3.socket_timeout=300 worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=instance1,instance2,instance3 |
tomcat-ajp.jar 파일을 Apache 5.5.x 설치에서 Enterprise Server lib 디렉토리로 복사합니다.
commons-logging.jar(버전 1.1.1) 및 commons-modeler.jar(버전 2.0.1) 파일을 Jakarta Commons 웹 사이트(http://commons.apache.org)에서 복사합니다.
클러스터를 다시 시작하고 httpd를 시작합니다.