1. APP의 WEB-INF/weblogic.xml 설정
weblogic.xml 파일에 아래와 같은 persisent-store-type을 지정합니다.
. . <session-descriptor> <persistent-store-type>coherence-web</persistent-store-type> <timeout-secs>300</timeout-secs> </session-descriptor> . . |
* 참고사항
"persistent-store-type" 의 기본값은 memory 이고, 아래와 같은 파라미터를 통해 설정 할 수 있다.
- memory : persistent session storage 비활성화
- replicated_if_clustered : 웹 응용 프로그램이 클러스터된 서버에 배포된 경우 persistent-store-type 에 복제합니다.
- file : 파일 기반 persistence을 사용합니다.
- jdbc : DB 기반 persistence sessions을 사용합니다.
- cookie : 모든 세션 데이터를 유저 브라우저의 쿠키에 저장합니다.
- coherence-web : Coherence*web 세션 스토리지 활성화
2. Coherence Cluster 생성
2.1. weblogic console의 "Coherence 클러스터" 탭에서 새로 만들기를 클릭한다.
2.2. Coherence Cluster 이름를 정해준다.
2.3. 클러스터링 모드를 정해준다.
클러스터링 모드로는 "유니 캐스트" 와 "멀티 캐스트" 가 존재한다. (기본 포트는 7574)
"유니캐스트" 경우 "포트"만 설정해주면되고
"멀티캐스트" 경우 "포트"와 "수신 IP"를 지정해 주어야한다.
2.4. 타겟을 설정한다.
Coherecne Member가 될 서버를 지정해준다.
Coherecne Member는 Cluster로 묶여 있어야한다.
3. Coherence Server 생성
3.1. 서버 탭에서 weblogic instacne 생성
3.2. weblogic instacne 이름 및 포트 설정
3.3. mwCoh11 Coherence 설정 변경
mwCoh11 서버에 Coherence 관련 설정들을 변경해 줍니다.
"Coherence 웹 로컬 저장 영역이 사용으로 설정됨" 설정인 경우 Coherence Web을 사용하는 설정
"Coherence 웹 통합 저장 영역이 사용으로 설정됨" 설정인 경우 Coherence Grid을 사용하는 설정
4. 확인
테스트 시나리오로는 다음과 같이 진행 할 예정입니다.
Coherence Server 기동 Coherence Member 기동 AP 호출 Coherence Member Shutdown AP 호출 Coherence Member 기동 AP 호출 |
4.1. Coherence Server 기동
4.2. Coherence Member 기동
아래 로그를 통해 JOIN을 확인
. . Group{Address=239.192.0.0, TTL=4} MasterMemberSet( ThisMember=Member(Id=2, Timestamp=2023-01-03 16:39:35.938, Address=10.0.2.15:27807, MachineId=37645, Location=process:20404,member:svr5, Role=mwCohCluster) OldestMember=Member(Id=1, Timestamp=2023-01-03 16:37:50.999, Address=10.0.2.15:35313, MachineId=37645, Location=process:19745,member:mwCoh11, Role=WeblogicServer) ActualMemberSet=MemberSet(Size=2 Member(Id=1, Timestamp=2023-01-03 16:37:50.999, Address=10.0.2.15:35313, MachineId=37645, Location=process:19745,member:mwCoh11, Role=WeblogicServer) Member(Id=2, Timestamp=2023-01-03 16:39:35.938, Address=10.0.2.15:27807, MachineId=37645, Location=process:20404,member:svr5, Role=mwCohCluster) ) MemberId|ServiceJoined|MemberState|Version|Edition 1|2023-01-03 16:37:50.999|JOINED|14.1.1.0.9|GE, 2|2023-01-03 16:39:35.938|JOINED|14.1.1.0.9|GE RecycleMillis=1200000 RecycleSet=MemberSet(Size=0 ) ) . . <2023-01-03 16:39:40.0709 KST> <Info> <com.oracle.coherence> <BEA-000000> <2023-01-03 16:39:40.709/27.679 Oracle Coherence GE 14.1.1.0.9 <Info> (thread=[ACTIVE] ExecuteThread: '38' for queue: 'weblogic.kernel.Default (self-tuning)', member=2): Configured session model "SplitHttpSessionCollection": Clustered Session Cache Name=session-storage Local Session Cache Name=local-session-storage Local Session Attribute Cache Name=local-attribute-storage SessionDistributionController Class Name= AttributeScopeController Class Name=com.tangosol.coherence.servlet.AbstractHttpSessionCollection$GlobalScopeController Maximum Session Inactive Seconds=300 Session ID Character Length=52 . . Session Logger Level=INFO Session Log Invalidation Exceptions=true Configuration Consistency Required=false> 1월 03, 2023 4:39:40 오후 com.tangosol.coherence.servlet.SessionHelper registerMBean 정보: Registering MBean using object name "type=WebLogicHttpSessionManager,cluster=mw-Coh,member=svr5,nodeId=2,appId=coh12cappcoh12capp" |
4.3. AP 호출
4.4. Coherence Member Shutdown
4.5 AP 호출
4.6. Coherence Member 기동
4.7. AP 호출
WebLogic instance를 재기동해도 Coherence Server에 세션이 저장되기 때문에 동일한 세션이 호출되는 내용을 확인 하였습니다.
* 참고사항
cluster member 일 경우 해당 서버의 일관성에 아래와 같이 출력된다.
'Oracle Fusion Middleware > Coherence' 카테고리의 다른 글
Coherence death detection (0) | 2022.05.10 |
---|---|
coherence 12c(client) to coherence 3.7(server) (0) | 2022.02.23 |
Coherence Sample APP 생성 및 WebLogic 배포 (0) | 2022.02.03 |
Coherence Data Grid - First Coherence Application 구축 (0) | 2022.01.26 |