세션클러스터링을 이용하기 위해 검색하면 많이 나오는 방법을 사용했지만 리눅스 eth0 설정부터

방화벽등으로 쉽지 않음.

 

WAS끼리 직접 서로 주고 받게 설정.

 

<Engine 설정의 맨 마지막 부분 jvmRoute는 apache에서 mod_jk 명칭으로 변경

 

<Receiver 의 설정은 현재 Was에서 받는 IP 및 Port 를 설정

<Member 의 내용은 세션클러스터링 할 WAS IP 및 PORT 설정을 각자 맞게 넣고 설정하면 됨.

uniqueId 의 내용은 맨 끝의 1번 WAS에서는 2로 설정 2번 WAS에서는 1로 설정

 

1번 WAS 클러스터링

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1">
        <!-- clustering -->
        <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8"  channelStartOptions="3">
                <Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/>
                <Channel className="org.apache.catalina.tribes.group.GroupChannel">
                        <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
                                <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender" />
                        </Sender>
                        <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                        address="127.0.0.1"
                        port="4055"
                        autoBind="0"
                        selectorTimeout="5000"
                        maxThreads="6"/>

                        <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor" staticOnly="true"/>
                        <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector" />
                        <Interceptor className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor">
                        <Member
                                className="org.apache.catalina.tribes.membership.StaticMember"
                                port="4056"
                                host="127.0.0.1"
                                uniqueId="{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2}"
                        />
                        </Interceptor>
                        <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
                </Channel>

                <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;" />
                <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
                <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener" />
        </Cluster>
        <!-- clustering  -->

 

2번 WAS

<Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat2">
        <!-- clustering -->
        <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster" channelSendOptions="8"  channelStartOptions="3">
                <Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/>
                <Channel className="org.apache.catalina.tribes.group.GroupChannel">
                        <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
                                <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender" />
                        </Sender>
                        <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
                        address="127.0.0.1"
                        port="4056"
                        autoBind="0"
                        selectorTimeout="5000"
                        maxThreads="6"/>

                        <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpPingInterceptor" staticOnly="true"/>
                        <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector" />
                        <Interceptor className="org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor">
                        <Member
                                className="org.apache.catalina.tribes.membership.StaticMember"
                                port="4055"
                                host="127.0.0.1"
                                uniqueId="{0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}"
                        />
                        </Interceptor>
                        <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
                </Channel>

                <Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=".*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt;" />
                <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
                <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener" />
        </Cluster>
        <!-- clustering  -->

 

의 설정으로 실행 후 정상적으로 세션클러스터링이 동작함.

물론 iptables에서 각 4055, 4056 포트는 열어줌..

'개발자 > Server' 카테고리의 다른 글

톰켓 운영 옵션  (0) 2019.01.18
톰켓 심볼릭 링크 인식하기  (1) 2019.01.03
PHP CONFIGURE  (0) 2014.05.23
MYSQL CONFIGURE  (0) 2014.05.23
mysql 외부연결  (0) 2014.05.23
Posted by Swamp of hope
,