22.7. Apache mod_jk HTTP Connector
Apache mod_jk 는 호환성을 위해 필요한 고객을 위해 제공되는 HTTP 커넥터입니다.
JBoss EAP는 Apache HTTP 프록시 서버의 워크로드를 허용할 수 있습니다. 프록시 서버는 웹 프런트 엔드의 클라이언트 요청을 수락하고 작업을 참여 JBoss EAP 서버로 전달합니다. 고정 세션을 활성화하면 서버를 사용할 수 없는 경우가 아니면 동일한 클라이언트 요청이 항상 동일한 JBoss EAP 서버로 이동합니다.
mod_jk는 Cryostat 1.3 프로토콜을 통해 통신합니다. 다른 프로토콜은 mod_cluster 또는 mod_proxy 와 함께 사용할 수 있습니다. 자세한 내용은 HTTP Connectors 개요 를 참조하십시오.
mod_cluster 는 mod_jk보다 고급 로드 밸런서 장치이며 권장되는 HTTP 커넥터입니다. mod_cluster는 mod_jk의 모든 기능과 추가 기능을 제공합니다. JBoss EAP mod_cluster HTTP 커넥터와 달리 Apache mod_jk HTTP 커넥터는 서버 또는 서버 그룹에 대한 배포 상태를 알 수 없으며 그에 따라 작업을 보내는 위치를 조정할 수 없습니다.
자세한 내용은 Apache mod_jk 설명서 를 참조하십시오.
22.7.1. Apache HTTP Server에서 mod_jk 구성
JBoss Core Services Apache HTTP Server를 설치하거나 JBoss Web Server를 사용할 때 mod_jk 모듈(mod_jk.so
)이 이미 포함되어 있지만 기본적으로 로드되지 않습니다.
Apache HTTP Server는 더 이상 JBoss Web Server 버전 3.1.0과 함께 배포되지 않습니다.
다음 단계를 사용하여 Apache HTTP Server에서 mod_jk를 로드하고 구성합니다. 이 단계에서는 이미 플랫폼에 따라 다른 Apache HTTP Server의 httpd/
디렉터리로 이동했다고 가정합니다. 자세한 내용은 JBoss Core Services Apache HTTP Server 설치 가이드에서 플랫폼에 대한 설치 지침을 참조하십시오.
Red Hat 고객은 Red Hat 고객 포털에서 로드 밸런서 구성 툴 을 사용하여 mod_jk 및 기타 커넥터에 대한 최적의 구성 템플릿을 빠르게 생성할 수 있습니다. 이 도구에 액세스하려면 로그인해야 합니다.
mod_jk 모듈을 구성합니다.
참고샘플 mod_jk 구성 파일은
conf.d/mod_jk.conf.sample
에 제공됩니다. 필요에 따라.sample
확장자를 제거하고 해당 내용을 수정하여 자체 파일을 생성하는 대신 이 샘플을 사용할 수 있습니다.conf.d/mod_jk.conf
라는 새 파일을 생성합니다. 파일에 다음 구성을 추가하여 필요한 제품군에 콘텐츠를 수정해야 합니다.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Load mod_jk module Specify the filename of the mod_jk lib Where to find workers.properties Where to put jk logs Set the jk log level [debug/error/info] Select the log format JkOptions indicates to send SSK KEY SIZE JkRequestLogFormat Mount your applications Add shared memory. This directive is present with 1.2.10 and later versions of mod_jk, and is needed for for load balancing to work properly Add jkstatus for managing runtime data
# Load mod_jk module # Specify the filename of the mod_jk lib LoadModule jk_module modules/mod_jk.so # Where to find workers.properties JkWorkersFile conf.d/workers.properties # Where to put jk logs JkLogFile logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # JkOptions indicates to send SSK KEY SIZE JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat JkRequestLogFormat "%w %V %T" # Mount your applications JkMount /application/* loadbalancer # Add shared memory. # This directive is present with 1.2.10 and # later versions of mod_jk, and is needed for # for load balancing to work properly JkShmFile logs/jk.shm # Add jkstatus for managing runtime data <Location /jkstatus/> JkMount status Require ip 127.0.0.1 </Location>
참고JkMount 지시문은 Apache HTTP Server가 mod_jk 모듈로 전달해야 하는 URL을 지정합니다. 지시문의 구성에 따라 mod_jk는 수신된 URL을 올바른 작업자로 보냅니다. 정적 콘텐츠를 직접 제공하고 Java 애플리케이션에 대한 로드 밸런서만 사용하려면 URL 경로는
/application/*
이어야 합니다. mod_jk를 로드 밸런서 장치로 사용하려면/*
값을 사용하여 모든 URL을 mod_jk로 전달합니다.이 파일은 일반적인 mod_jk 구성 외에도
mod_jk.so
모듈을 로드하도록 지정하고workers.properties
파일을 찾을 위치를 정의합니다.mod_jk 작업자 노드를 구성합니다.
참고샘플 작업자 구성 파일은
conf.d/workers.properties.sample
에서 제공됩니다. 필요에 따라.sample
확장자를 제거하고 해당 내용을 수정하여 자체 파일을 생성하는 대신 이 샘플을 사용할 수 있습니다.conf.d/workers.properties
라는 새 파일을 만듭니다. 파일에 다음 구성을 추가하여 필요한 제품군에 콘텐츠를 수정해야 합니다.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Define list of workers that will be used for mapping requests Define Node1 modify the host as your host IP or DNS name. Define Node2 modify the host as your host IP or DNS name. Load-balancing behavior Status worker for managing load balancer
# Define list of workers that will be used # for mapping requests worker.list=loadbalancer,status # Define Node1 # modify the host as your host IP or DNS name. worker.node1.port=8009 worker.node1.host=node1.mydomain.com worker.node1.type=ajp13 worker.node1.ping_mode=A worker.node1.lbfactor=1 # Define Node2 # modify the host as your host IP or DNS name. worker.node2.port=8009 worker.node2.host=node2.mydomain.com worker.node2.type=ajp13 worker.node2.ping_mode=A worker.node2.lbfactor=1 # Load-balancing behavior worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=node1,node2 worker.loadbalancer.sticky_session=1 # Status worker for managing load balancer worker.status.type=status
mod_jk
workers.properties
파일 및 기타 고급 구성 옵션의 구문에 대한 자세한 내용은 mod_jk Worker Properties 를 참조하십시오.필요한 경우 JKMountFile 지시문을 지정합니다.
mod-jk.conf
의 JKMount 지시문 외에도 mod_jk로 전달할 여러 URL 패턴이 포함된 파일을 지정할 수 있습니다.uriworkermap.properties
파일을 생성합니다.참고샘플 URI 작업자 맵 구성 파일은
conf.d/uriworkermap.properties.sample
에 제공됩니다. 필요에 따라.sample
확장자를 제거하고 해당 내용을 수정하여 자체 파일을 생성하는 대신 이 샘플을 사용할 수 있습니다.conf.d/uriworkermap.properties
라는 새 파일을 생성합니다. 일치시킬 각 URL 패턴에 대한 행을 추가합니다. 예를 들면 다음과 같습니다.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Simple worker configuration file
# Simple worker configuration file /*=loadbalancer
uriworkermap.properties
파일을 가리키도록 구성을 업데이트합니다.conf.d/mod_jk.conf
에 다음을 추가합니다.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use external file for mount points. It will be checked for updates each 60 seconds. The format of the file is: /url=worker /examples/*=loadbalancer
# Use external file for mount points. # It will be checked for updates each 60 seconds. # The format of the file is: /url=worker # /examples/*=loadbalancer JkMountFile conf.d/uriworkermap.properties
mod_jk 구성에 대한 자세한 내용은 JBoss Web Server HTTP Connectors 및 Load Balancing Guide의 mod_jk로 Apache HTTP Server 구성 섹션을 참조하십시오.
22.7.2. mod_jk를 사용하여 결합하도록 JBoss EAP 구성
JBoss EAP undertow
하위 시스템은 요청을 수락하고 외부 웹 서버로 응답을 다시 전송하기 위해 리스너를 지정해야 합니다. mod_jk에서는 Cryostat 프로토콜을 사용하므로 Cryostat 리스너를 구성해야 합니다.
기본 고가용성 구성(ha 또는 full-ha) 중 하나를 사용하는 경우 Cryostat 리스너가 이미 구성되어 있습니다.
자세한 내용은 외부 웹 서버에서 요청 수락을 참조하십시오.