코히어런스
[요약] Coherence 클러스터 멤버 기동/종료 하기
투칼론
2023. 3. 11. 16:18
반응형
1. 캐시 서버 시작
캐시 서버(com.tangsol.net.DefaultCacheServer)는 캐시된 데이터 저장을 담당하는 클러스터 구성원입니다. 명령어 또는 프로그래밍 방식으로 기동할 수 있습니다.
Java -cp옵션을 사용하여 coherence.jar 보다 먼저 클래스 패스를 설정함으로서 COHERENCE_HOME/config에 있는 tangosol-coherence-override.xml과 coherence-cache-config.xml 파일을 오버라이딩 할 수 있도록 합니다.
java -server -Xms512m -Xmx512m -cp COHERENCE_HOME\config;COHERENCE_HOME\lib\coherence.jar com.tangosol.net.DefaultCacheServer
맨 뒤의 옵션에 Grid ARchive (GAR)와 <autostart> 옵션 (기본값:5초)을 재설정할 수 있습니다.
기본 로그 내용은 아래와 같습니다.
D:\sw\coherence12\coherence\bin>cache-server.cmd
java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)
2023-03-11 16:24:07.178/0.842 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/D:/sw/coherence12/coherence/lib/coherence.jar!/tangosol-coherence.xml"
2023-03-11 16:24:07.202/0.867 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/D:/sw/coherence12/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
2023-03-11 16:24:07.203/0.868 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
2023-03-11 16:24:07.206/0.871 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Optional configuration override "cache-factory-config.xml" is not specified
2023-03-11 16:24:07.206/0.871 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Optional configuration override "cache-factory-builder-config.xml" is not specified
2023-03-11 16:24:07.206/0.871 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
Oracle Coherence Version 12.2.1.4.0 Build 74888
Grid Edition: Development mode
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2023-03-11 16:24:07.390/1.055 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=n/a): Loaded cache configuration from "jar:file:/D:/sw/coherence12/coherence/lib/coherence.jar!/coherence-cache-config.xml"
2023-03-11 16:24:08.260/1.925 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=n/a): The cluster name has not been configured, a value of "youngiki's cluster" has been automatically generated
2023-03-11 16:24:08.491/2.156 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=n/a): Created cache factory com.tangosol.net.ExtensibleConfigurableCacheFactory
2023-03-11 16:24:10.288/3.952 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=n/a): TCMP bound to /10.8.120.64:57362 using SystemDatagramSocketProvider
2023-03-11 16:24:10.671/4.336 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Cluster, member=n/a): Member(Id=1, Timestamp=2023-03-10 17:53:18.093, Address=10.8.120.64:64265, MachineId=26690, Location=process:14212, Role=CoherenceServer) joined Cluster with senior member 1
2023-03-11 16:24:10.678/4.343 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Cluster, member=n/a): This Member(Id=2, Timestamp=2023-03-11 16:24:10.439, Address=10.8.120.64:57362, MachineId=26690, Location=process:11828, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=8, SocketCount=8) joined cluster "youngiki's cluster" with senior Member(Id=1, Timestamp=2023-03-10 17:53:18.093, Address=10.8.120.64:64265, MachineId=26690, Location=process:14212, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=8, SocketCount=8)
2023-03-11 16:24:10.822/4.487 Oracle Coherence GE 12.2.1.4.0 <D5> (thread=Transport:TransportService, member=n/a): Service TransportService is bound to tmb://10.8.120.64:57362.64301
2023-03-11 16:24:10.871/4.536 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Transport:TransportService, member=n/a): Service TransportService joined the cluster with senior service member 1
2023-03-11 16:24:11.131/4.795 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=SelectionService(channels=13, selector=MultiplexedSelector(sun.nio.ch.WindowsSelectorImpl@4c2bb6e0), id=1046665075), member=n/a): Connection established with tmb://10.8.120.64:64265.53985
2023-03-11 16:24:11.134/4.798 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=n/a): Started cluster Name=youngiki's cluster, ClusterPort=7574
Group{Address=239.192.0.0, TTL=4}
MasterMemberSet(
ThisMember=Member(Id=2, Timestamp=2023-03-11 16:24:10.439, Address=10.8.120.64:57362, MachineId=26690, Location=process:11828, Role=CoherenceServer)
OldestMember=Member(Id=1, Timestamp=2023-03-10 17:53:18.093, Address=10.8.120.64:64265, MachineId=26690, Location=process:14212, Role=CoherenceServer)
ActualMemberSet=MemberSet(Size=2
Member(Id=1, Timestamp=2023-03-10 17:53:18.093, Address=10.8.120.64:64265, MachineId=26690, Location=process:14212, Role=CoherenceServer)
Member(Id=2, Timestamp=2023-03-11 16:24:10.439, Address=10.8.120.64:57362, MachineId=26690, Location=process:11828, Role=CoherenceServer)
)
MemberId|ServiceJoined|MemberState|Version
1|2023-03-10 17:53:18.093|JOINED|12.2.1.4.0,
2|2023-03-11 16:24:10.439|JOINED|12.2.1.4.0
RecycleMillis=1200000
RecycleSet=MemberSet(Size=0
)
)
TcpRing{Connections=[1]}
IpMonitor{Addresses=0, Timeout=15s}
2023-03-11 16:24:11.148/4.813 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Invocation:Management, member=2): Service Management joined the cluster with senior service member 1
2023-03-11 16:24:11.168/4.833 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=2): Loaded Reporter configuration from "jar:file:/D:/sw/coherence12/coherence/lib/coherence.jar!/reports/report-group.xml"
2023-03-11 16:24:11.397/5.062 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=DistributedCache:PartitionedCache, member=2): Service PartitionedCache joined the cluster with senior service member 1
2023-03-11 16:24:12.686/6.351 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Proxy:TcpAcceptor, member=2): TcpAcceptor now listening for connections on YOUNGIKI-X40-J:57362.59443
2023-03-11 16:24:12.778/6.442 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=DistributedCache:PartitionedCache, member=2): Asking member 1 for primary ownership of PartitionSet{0..127}
2023-03-11 16:24:12.833/6.498 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Proxy, member=2): Service Proxy joined the cluster with senior service member 1
2023-03-11 16:24:12.837/6.501 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Proxy, member=2): Member 1 joined Service Proxy with senior member 1
2023-03-11 16:24:12.842/6.507 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=2):
Services
(
ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, OldestMemberId=1}
TransportService{Name=TransportService, State=(SERVICE_STARTED), Id=1, OldestMemberId=1}
InvocationService{Name=Management, State=(SERVICE_STARTED), Id=2, OldestMemberId=1}
PartitionedCache{Name=PartitionedCache, State=(SERVICE_STARTED), Id=3, OldestMemberId=1, LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=0, BackupPartitions=129, CoordinatorId=1}
ProxyService{Name=Proxy, State=(SERVICE_STARTED), Id=4, OldestMemberId=1}
)
Started DefaultCacheServer...
2023-03-11 16:24:12.906/6.570 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=DistributedCache:PartitionedCache, member=2): Asking member 1 for primary ownership of PartitionSet{0..127}
2023-03-11 16:24:13.042/6.707 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=DistributedCache:PartitionedCache, member=2): Partition ownership has stabilized with 2 nodes
2. 캐시 클라이언트 시작
캐시 클라이언트(com.tangosol.net.CacheFactory)는 클러스터의 서비스와 상호 작용하기 위해 클러스터에 참여하는 클러스터 구성원입니다.
java -cp COHERENCE_HOME\config;COHERENCE_HOME\lib\coherence.jar -Dcoherence.distributed.localstorage=false com.tangosol.net.CacheFactory
기본 로그 내용은 아래와 같습니다.
D:\sw\coherence12\coherence\bin>coherence.cmd
java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)
2023-03-11 16:27:10.893/0.341 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/D:/sw/coherence12/coherence/lib/coherence.jar!/tangosol-coherence.xml"
2023-03-11 16:27:10.926/0.374 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/D:/sw/coherence12/coherence/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
2023-03-11 16:27:10.927/0.375 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
2023-03-11 16:27:10.929/0.377 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Optional configuration override "cache-factory-config.xml" is not specified
2023-03-11 16:27:10.929/0.378 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Optional configuration override "cache-factory-builder-config.xml" is not specified
2023-03-11 16:27:10.930/0.378 Oracle Coherence 12.2.1.4.0 <Info> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
Oracle Coherence Version 12.2.1.4.0 Build 74888
Grid Edition: Development mode
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2023-03-11 16:27:11.339/0.789 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=n/a): The cluster name has not been configured, a value of "youngiki's cluster" has been automatically generated
2023-03-11 16:27:13.184/2.632 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=n/a): TCMP bound to /10.8.120.64:57421 using SystemDatagramSocketProvider
2023-03-11 16:27:13.546/2.994 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Cluster, member=n/a): Member(Id=1, Timestamp=2023-03-10 17:53:18.093, Address=10.8.120.64:64265, MachineId=26690, Location=process:14212, Role=CoherenceServer) joined Cluster with senior member 1
2023-03-11 16:27:13.554/3.002 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Cluster, member=n/a): This Member(Id=3, Timestamp=2023-03-11 16:27:13.331, Address=10.8.120.64:57421, MachineId=26690, Location=process:7680, Role=CoherenceConsole, Edition=Grid Edition, Mode=Development, CpuCount=8, SocketCount=8) joined cluster "youngiki's cluster" with senior Member(Id=1, Timestamp=2023-03-10 17:53:18.093, Address=10.8.120.64:64265, MachineId=26690, Location=process:14212, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=8, SocketCount=8)
2023-03-11 16:27:13.762/3.211 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Cluster, member=n/a): Member(Id=2, Timestamp=2023-03-11 16:24:10.439, Address=10.8.120.64:57362, MachineId=26690, Location=process:11828, Role=CoherenceServer) joined Cluster with senior member 1
2023-03-11 16:27:13.888/3.336 Oracle Coherence GE 12.2.1.4.0 <D5> (thread=Transport:TransportService, member=n/a): Service TransportService is bound to tmb://10.8.120.64:57421.50240
2023-03-11 16:27:13.901/3.349 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Transport:TransportService, member=n/a): Service TransportService joined the cluster with senior service member 1
2023-03-11 16:27:14.406/3.855 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=SelectionService(channels=9, selector=MultiplexedSelector(sun.nio.ch.WindowsSelectorImpl@13fd2ccd), id=194707680), member=n/a): Connection established with tmb://10.8.120.64:57362.64301
2023-03-11 16:27:14.407/3.856 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=SelectionService(channels=9, selector=MultiplexedSelector(sun.nio.ch.WindowsSelectorImpl@13fd2ccd), id=194707680), member=n/a): Connection established with tmb://10.8.120.64:64265.53985
2023-03-11 16:27:14.409/3.857 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=n/a): Started cluster Name=youngiki's cluster, ClusterPort=7574
Group{Address=239.192.0.0, TTL=4}
MasterMemberSet(
ThisMember=Member(Id=3, Timestamp=2023-03-11 16:27:13.331, Address=10.8.120.64:57421, MachineId=26690, Location=process:7680, Role=CoherenceConsole)
OldestMember=Member(Id=1, Timestamp=2023-03-10 17:53:18.093, Address=10.8.120.64:64265, MachineId=26690, Location=process:14212, Role=CoherenceServer)
ActualMemberSet=MemberSet(Size=3
Member(Id=1, Timestamp=2023-03-10 17:53:18.093, Address=10.8.120.64:64265, MachineId=26690, Location=process:14212, Role=CoherenceServer)
Member(Id=2, Timestamp=2023-03-11 16:24:10.439, Address=10.8.120.64:57362, MachineId=26690, Location=process:11828, Role=CoherenceServer)
Member(Id=3, Timestamp=2023-03-11 16:27:13.331, Address=10.8.120.64:57421, MachineId=26690, Location=process:7680, Role=CoherenceConsole)
)
MemberId|ServiceJoined|MemberState|Version
1|2023-03-10 17:53:18.093|JOINED|12.2.1.4.0,
2|2023-03-11 16:24:10.439|JOINED|12.2.1.4.0,
3|2023-03-11 16:27:13.331|JOINED|12.2.1.4.0
RecycleMillis=1200000
RecycleSet=MemberSet(Size=0
)
)
TcpRing{Connections=[2]}
IpMonitor{Addresses=0, Timeout=15s}
2023-03-11 16:27:14.422/3.871 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=Invocation:Management, member=3): Service Management joined the cluster with senior service member 1
2023-03-11 16:27:14.442/3.891 Oracle Coherence GE 12.2.1.4.0 <Info> (thread=main, member=3): Loaded Reporter configuration from "jar:file:/D:/sw/coherence12/coherence/lib/coherence.jar!/reports/report-group.xml"
Map (?):
3. 클러스터 구성원 중지
명령줄에서 또는 프로그래밍 방식으로 클러스터 구성원을 중지할 수 있습니다. 보통 kill 명령어(UNIX계열)와 Ctrl+c(윈도우계열)로 중지를 합니다.
4. 롤링 다시 시작 수행
롤링 다시 시작은 다시 시작하는 동안 데이터가 손실되지 않도록 클러스터에서 캐시 서버를 다시 시작하는 기술입니다.