WAS/JBOSS_WILDFLY
14. 클러스터링
coldplayer83
2025. 7. 3. 15:35
728x90
반응형
[각 xml 설정 파일의 차이점]
standalone.xml
java EE 웹 프로파일, RESTFul 웹 서비스, EJB3 원격 호출 지원
standalone-full.xml
클러스터링 없이 Java EE 전체 프로파일 및 모든 서버 기능 지원
standalone-ha.xml
클러스터링 기능이 있는 기본 프로파일
standalone-full-ha.xml
클러스터링 기능이 있는 full 프로파일
1. 어플리케이션 WEB-INF 경로에 다음과 같이 파일 작성
jboss-web.xml
<jboss-web>
<context-root>/</context-root>
<replication-config>
<replication-trigger>SET</replication-trigger>
<replication-granularity>SESSION</replication-granularity>
</replication-config>
</jboss-web>
위와 같이 Context-root 셋팅과 session 공유 범위를 선택하는 replication-config를 설정
replication-trigger
SET : SET이 발생하였을 때 SESSION 정보를 Backup Server로 Copy하겠다는 의미
replication-granularity
복제 세분화 범위는 SESSION에 한정
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<session-config>
<session-timeout>30</session-timeout>
<!--tracking-mode>URL</tracking-mode-->
</session-config>
<distributable/>
</web-app>
<distributable/> 태그 추가
2. standalone-ha.xml 파일 수정
tcp 프로토콜을 사용하도록 수정
3. 세션 페일오버 테스트
728x90
반응형