cassandra-topologies.properties 파일
cassandra-topologies.properties 파일
PropertyFileSnitch 스니치 옵션은 cassandra-topologies.properties 구성 파일을 사용해 클러스터 노드가 어떤 datacenters와 racks에 속하는지 결정해요. 다른 스니치를 사용한다면 cassandra-rackdc.properties를 사용해야 해요. 스니치는 네트워크 토폴로지(랙과 데이터센터 기준 근접성)를 결정해서 요청을 효율적으로 라우팅하고 데이터베이스가 레플리카를 고르게 분산하게 해 줘요.
본문
클러스터의 모든 노드를 properties 파일에 포함하고, 키스페이스 정의에서처럼 데이터센터 이름을 정의하세요. 데이터센터와 랙 이름은 대소문자를 구분해요.
cassandra-topologies.properties 파일은 클러스터의 모든 노드에 동일하게 복사되어야 해요.
예시
이 예시는 세 개의 데이터센터를 사용해요.
# datacenter One
175.56.12.105=DC1:RAC1
175.50.13.200=DC1:RAC1
175.54.35.197=DC1:RAC1
120.53.24.101=DC1:RAC2
120.55.16.200=DC1:RAC2
120.57.102.103=DC1:RAC2
# datacenter Two
110.56.12.120=DC2:RAC1
110.50.13.201=DC2:RAC1
110.54.35.184=DC2:RAC1
50.33.23.120=DC2:RAC2
50.45.14.220=DC2:RAC2
50.17.10.203=DC2:RAC2
# datacenter Three
172.106.12.120=DC3:RAC1
172.106.12.121=DC3:RAC1
172.106.12.122=DC3:RAC1
# default for unknown nodes
default =DC3:RAC1