22.2. 정적 Cryostat를 사용하여 HA 활성화
22.2.1. 개요
22.2.2. 서비스 WSDL 파일의 복제본 세부 정보 인코딩
서비스 WSDL 파일에서 클러스터의 복제본 세부 정보를 인코딩해야 합니다. 예 22.1. “정적 Cryostat를 사용하여 HA 활성화: WSDL 파일” 3개의 복제본의 서비스 클러스터를 정의하는 WSDL 파일 추출을 표시합니다.
예 22.1. 정적 Cryostat를 사용하여 HA 활성화: WSDL 파일
<wsdl:service name="ClusteredService">
<wsdl:port binding="tns:Greeter_SOAPBinding" name="Replica1">
<soap:address location="http://localhost:9001/SoapContext/Replica1"/>
</wsdl:port>
<wsdl:port binding="tns:Greeter_SOAPBinding" name="Replica2">
<soap:address location="http://localhost:9002/SoapContext/Replica2"/>
</wsdl:port>
<wsdl:port binding="tns:Greeter_SOAPBinding" name="Replica3">
<soap:address location="http://localhost:9003/SoapContext/Replica3"/>
</wsdl:port>
</wsdl:service>예 22.1. “정적 Cryostat를 사용하여 HA 활성화: WSDL 파일” 에 표시된 WSDL 추출은 다음과 같이 설명할 수 있습니다.
세 포트에 노출된 ClusterService 서비스를 정의합니다.
-
Replica1 -
Replica2 -
Replica3
Replica1 을 정의하여 포트 9001 에서 HTTP 끝점을 통해 ClusterService 를 Syslog로 노출합니다.
포트 9002 에서 HTTP 끝점을 통해 ClusterService 를 Syslog로 노출하는 Replica2 를 정의합니다.
포트 9003 에서 HTTP 끝점을 통해 ClusterService 를 Syslog로 노출하도록 Replica3 을 정의합니다.
22.2.3. 클라이언트 구성에 클러스터링 기능 추가
클라이언트 구성 파일에서 예 22.2. “정적 Cryostat를 사용하여 HA 활성화: 클라이언트 구성” 에 표시된 대로 클러스터링 기능을 추가합니다.
예 22.2. 정적 Cryostat를 사용하여 HA 활성화: 클라이언트 구성
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:clustering="http://cxf.apache.org/clustering"
xsi:schemaLocation="http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<jaxws:client name="{http://apache.org/hello_world_soap_http}Replica1"
createdFromAPI="true">
<jaxws:features>
<clustering:failover/>
</jaxws:features>
</jaxws:client>
<jaxws:client name="{http://apache.org/hello_world_soap_http}Replica2"
createdFromAPI="true">
<jaxws:features>
<clustering:failover/>
</jaxws:features>
</jaxws:client>
<jaxws:client name="{http://apache.org/hello_world_soap_http}Replica3"
createdFromAPI="true">
<jaxws:features>
<clustering:failover/>
</jaxws:features>
</jaxws:client>
</beans>