11. JServ Glossary
Servlet Zone
– Partitioning mechanism
ex. beta & production, long-running vs quick
– the sandbox where servlets live during their life cycle
– A zone defines the security environment where the
executing servlet is restricted and allows context
separation between different logical groups of
servlets.
Servlet Repository
– a collection of servlets and may either be a directory
or an archive, such as zip or jar file
13. JServ 주요 Parameter (jserv.properties)
Classpath 지정
– wrapper.classpath=/aa/lib/bb.jar
– wrapper.classpath=/aa/lib/cc.jar
JServ Communication 환경 설정
– wrapper.protocol=ajpv12
– port=8007
Servlet Zone 설정
– zone=zone1, zone2
– zone1.properties=/aa/zone1.properties
– zone2.properties=/aa/zone2.properties
Thread 수
– security.maxConnections=50
14. JServ 주요 Parameter (zone.properties) (1)
Classloader 환경 설정
– autoreload.classes=true
– autoreload.file=true
– init.timeout=10000
– destroy.timeout=10000
Session 환경 지정
– session.useCookies=true
– session.timeout=1800000
– session.checkFrequency=30000
15. JServ 주요 Parameter (zone.properties) (2)
Repository 설정
– repository=/aa/servlets
– repository=/aa/servlets/Parallel.jar
OJSP 환경 설정
– servlet.ojsp.code=oracle.jsp.JspServlet
– servlet.ojsp.initArgs=alias_translation=false
Auto Startup, Init Parameter 지정
– servlet.startup=hellp,snoop,org.fool.Dummy
– servlet.hello.code=org.fool.Dummy
– servlet.default.initArgs=common.to.everybody=Hi !
– Servlet.org.fool.Dummy.initArgs=message=dummy
16. JServ Memory 환경 설정
ApJServManual Parameter Setting
– default : off
Automatic JServ Startup Mode (ApjServManual off)
– wrapper.bin.parameters=-ms30M
– wrapper.bin.parameters=-mx200M
User Startup Mode (ApjServManual on)
– java -ms30M -mx200M org.apache.jserv.JServ ...
17. JServ : Scalability
여러 개의 JServ Instances
– Single Instance에 비해 좋은 이유
하나의 JVM에서 몇 천 개의 Threads 실행 문제 해결
중복을 통한 시스템의 안정성 증가
보안 향상
- 서로 다른 Servlet Zone으로
– AJP Protocol의 사용
Socket 기반 Protocol
다양한 구성 가능
- 여러 대의 Machine에 JServ 위치 가능
19. JServ : Session 관리 & Fault Tolerance
httpd
httpd
httpd
JServ1
localhost:9011
JServ2
localhost:9012
1. 첫 번째 Request (Session 이용) :
임의의 JServ 선택 (JServ1)
Shared Memory
2. 두 번째 Request (Session 이용) :
JServ1 선택
1.에서 얻은 Routing 정보 이용
3. 세 번째 Request (Session 이용) :
JServ1에 연결할 수 없는 경우
JServ1의 내부 상태를 Shared File에 기록
JServ2 선택 : 새로운 Session Object 생성
Watchdog Process
10초마다 한번씩 일어나 Shared Memory를 이용해서
Dead JServ Process 연결 시도
SessionID = xxx-JS1
SessionID = xxx-JS2
20. Multiple JServ 실행 환경
Apache 환경
– Apache JServ Configuration File 작성
실행 Script
– nohup $JAVA -Dport=9011 $JAVA_ENV -classpath
$CLASSES org.apache.jserv.JServ
$JSERV_CONF/jserv9011.properties >>
$JSERV_LOG/jserv9011.runtime 2>&1 &
Shutdown
– -s option 추가
22. Apache Parent Process
Watchdog Process
Memory Map File
Apache Child Process
Http requests
AJPV12
mod_jserv
Watch dog periodically pings
“dead” JServ processes and
if one is successfully pinged,
it’s status is changed to “alive”
Marks a JServ process as
“dead” if it fails to send a request
to that JServ process
JServ Process
The old Apache infrastructure
(with JServ)
23. Issues with the Old Apache-JServ
오직 하나의 JServ Process만이 Automatic Mode로
시작, 재시작, 종료가 가능.
여러 개의 JServ의 시작, 재시작, 종료를 위해서는
Manual Mode이어야 함.
Hi-Availability의 제한적 지원
– Death Detection이 가능하지만 자동적인 재시작은
지원하지 않음
Platform Constraints
– Unix에서만 Watchdog 제공
24. During startup,
registers process
info to
mod_oprocmgr
via HTTP
Http requests
AJP12
Watchdog pings “dead”
JServ processes,
starting up replacement
processes if necessary
JServ Process
JServ Wrapper
Current state (alive/dead), port-number
and other info for each server process
Handles topology maintenance messages
Apache Parent Process
Apache Child Process
mod_jserv
mod_oprocmgr
Memory Map File
Process Table
Enhanced
Watchdog
process
Enhanced Apache Infrastructure
25. Enhanced Apache Infrastructure
mod_oprocmgr
– handles topology management (admin) http requests
Server 등록
– Jserv는 HTTP 메시지를 Apache에게 보냄
– 이 메시지는 mod_oprocmgr이 관리
향상된 Watchdog Process
간단해진 구성
모든 JServ Process들이 Automatic Mode로 시작,
종료 가능
자동화된 Death Detection 및 재시작
27. Apache에서의 Oracle JSP 소개
Oracle JSP는 Servlet으로 구현되어 있음
– ApJServAction .jsp /servlets/oracle.jsp.JspServlet
Oracle Jdeveloper에 통합되어 있음
– Source-level debugging on local servlet runner
Runs on any standard servlet engine
– Apache (iAS), JSWDK, Tomcat
– All Oracle servlet engines
Implements useful extensions
– SQLJ in scriptlets, command-line translator ojspc,
custom tag library and data access beans
28. Configuring OracleJSP on iAS
Libraries
– ojsp.jar
– ojsputil.jar
These libraries must be in classpath
– wrapper.classpath=…/ojsp/lib/ojsp.jar
For Jserv/iAS, OracleJSP needs both servlet 2.0
and 2.1[2] libraries in classpath:
– wrapper.classpath=…/jsdk2.0/lib/jsdk.jar
– wrapper.classpath=…/ojsp/lib/servlet.jar
Works with JDK 1.1 and 1.2