웹서버

아파치 톰캣(java) 세션 클러스터링 설정

타카스 류지 2023. 8. 10. 10:12

Server.xml 에 내용 추가

 <Engine defaultHost="localhost" name="Catalina" jvmRoute="was-com">
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8"> 
    <Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/> 

    <Manager className="org.apache.catalina.ha.session.BackupManager" /> 
    <Channel className="org.apache.catalina.tribes.group.GroupChannel"> 
        <Membership className="org.apache.catalina.tribes.membership.McastService" 
            address="228.0.0.4" 
            port="45564" 
            frequency="500" 
            dropTime="3000"/>
        <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver" 
            address="auto"
            port="4000" 
            autoBind="10" 
            selectorTimeout="5000" 
            maxThreads="6"/> 
        <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter"> 
            <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/> 
        </Sender> 
        <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/> 
        <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/> 
    </Channel> 
    <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/> 
    <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/> 
    <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/> 
</Cluster>
      

web.xml 내용 추가

<distributable/>