비동기적으로 볼륨 복제

이 페이지에서는 Google Distributed Cloud (GDC) 에어 갭 블록 스토리지 볼륨의 비동기 복제를 설정하고 실행하는 방법을 보여줍니다.

비동기 복제는 한 GDC 영역에서 다른 영역으로 데이터를 복제하는 데 사용됩니다. 이 복제된 데이터는 소스 영역의 데이터를 사용할 수 없는 경우 장애 조치 시나리오에서 사용할 수 있습니다. 장애 조치 생성 후에는 원본 볼륨이 동일한 대상 볼륨에 복제되도록 설정할 수 없습니다. 대신 새 복제 관계를 만들어야 합니다.

시작하기 전에

비동기 블록 복제를 사용하려면 인프라 운영자 (IO)가 먼저 복제가 필요한 두 영역 간에 스토리지 인프라를 설정해야 합니다. 구체적으로 각 영역에서 관련 스토리지 클러스터를 먼저 피어링해야 합니다. 그런 다음 블록 스토리지가 프로비저닝된 조직과 연결된 스토리지 가상 머신을 피어링해야 합니다.

그런 다음 VolumeReplicationRelationship 리소스를 관리할 수 있는 volume-replication-admin-global 역할이 있는지 확인합니다. 전역 API를 사용할 수 없는 경우 app-volume-replication-admin 역할을 사용하여 영역 VolumeReplicationRelationshipReplica 리소스를 직접 수정할 수 있습니다.

복제 설정

VolumeReplicationRelationship 커스텀 리소스 (CR)는 비동기 블록 복제 API를 제공합니다. 이 CR은 전역 관리 API에 있습니다. 특정 블록 기기의 복제를 사용 설정하려면 전역 관리 API에서 VolumeReplicationRelationship CR을 만들어야 합니다.

apiVersion: storage.global.gdc.goog/v1
kind: VolumeReplicationRelationship
metadata:
  name: my-pvc-repl
  namespace: my-project
spec:
  source:
    pvc:
      clusterRef: my-pvc-cluster
      pvcRef: my-block-pvc
    zoneRef: xx-xxxx-zone1
 destination:
    pvc:
      clusterRef: my-pvc-cluster
    zoneRef: xx-xxxx-zone2

이 예시에서는 my-org이라는 조직에 my-project이라는 프로젝트가 생성되어 있고 my-block-pvc라는 PVC가 이미 프로비저닝되었다고 가정합니다. clusterRef은 PVC가 있는 클러스터의 이름입니다.

사양의 sourcedestination 필드는 데이터가 각각 에서 복제되는 위치를 나타냅니다. 이 예에서는 데이터가 xx-xxxx-zone1에서 xx-xxxx-zone2로 복제됩니다.

글로벌 API에서 VolumeReplicationRelationship CR을 가져와 복제 관계의 상태를 확인합니다. 다음 예시를 참고하세요. 출력은 간소화를 위해 잘렸습니다.

apiVersion: storage.global.gdc.goog/v1
kind: VolumeReplicationRelationship
metadata:
  name: my-pvc-repl
  namespace: my-project
spec:
  destination:
    pvc:
      clusterRef: my-pvc-cluster
    zoneRef: xx-xxxx-zone2
  source:
    pvc:
      clusterRef: my-pvc-cluster
      pvcRef: my-block-pvc
    zoneRef: xx-xxxx-zone1
status:
  zones:
  - name: xx-xxxx-zone1
    replicaStatus:
      message: SnapMirror relationship has been established. Please check the destination
        zone for relationship state
      replicationID: a096621e-f062-11ef-ad24-00a0b89f23fb
      state: Established
  - name: xx-xxxx-zone2
    replicaStatus:
      exportedSnapshotName: snapmirror.c34f8845-e8c0-11ef-ad24-00a0b89f23fb_2150007868.2025-02-21_150000
      message: SnapMirror relationship has been successfully established
      replicationID: a096621e-f062-11ef-ad24-00a0b89f23fb
      state: Idle

장애 조치 만들기

어떤 이유로든 소스 영역을 사용할 수 없는 경우 조직의 대상 영역 관리 플레인에서 VolumeFailover CR을 만들 수 있습니다. v2 조직의 경우 관리 API 서버입니다. v1 조직의 경우 조직 관리자 클러스터입니다. 예를 들어 xx-xxxx-zone2를 대상 영역으로 지정하는 VolumeReplicationRelationship이 생성되고 PVC가 my-org 조직에 있는 경우 VolumeFailover CR은 xx-xxxx-zone2my-org 관리 평면에 생성됩니다. 이렇게 하면 두 영역 간의 복제 관계가 중단되고 대상 영역의 PVC가 워크로드에 의해 마운트될 수 있습니다.

apiVersion: storage.gdc.goog/v1
kind: VolumeFailover
metadata:
  name: my-pvc-failover
  namespace: my-project
spec:
  volumeReplicationRelationshipRef: my-pvc-repl

그런 다음 성공적인 장애 조치가 CR 상태에 반영됩니다.

apiVersion: storage.gdc.goog/v1
kind: VolumeFailover
metadata:
  name: my-pvc-failover
  namespace: my-project
spec:
  volumeReplicationRelationshipRef: my-pvc-repl
status:
    state: Completed

장애 조치가 생성되면 my-pvc-repl VolumeReplicationRelationship이 Broken Off 상태로 전환됩니다. 이제 xx-xxxx-zone2의 PVC를 마운트할 수 있습니다.

이 시점에서 VolumeReplicationRelationship은 다음 예와 비슷하게 표시됩니다. 이번에도 이 출력은 간단한 설명을 위해 일부 내용만 표시되어 있습니다.

apiVersion: storage.global.gdc.goog/v1
kind: VolumeReplicationRelationship
metadata:
  name: my-pvc-repl
  namespace: my-project
spec:
  destination:
    pvc:
      clusterRef: my-pvc-cluster
    zoneRef: xx-xxxx-zone2
  source:
    pvc:
      clusterRef: my-pvc-cluster
      pvcRef: my-block-pvc
    zoneRef: xx-xxxx-zone1
status:
  zones:
  - name: xx-xxxx-zone1
    replicaStatus:
      message: SnapMirror relationship has been broken off
      replicationID: a096621e-f062-11ef-ad24-00a0b89f23fb
      state: Broken Off
  - name: xx-xxxx-zone2
    replicaStatus:
      exportedSnapshotName: snapmirror.c34f8845-e8c0-11ef-ad24-00a0b89f23fb_2150007868.2025-02-21_150000
      message: SnapMirror relationship has been broken off
      replicationID: a096621e-f062-11ef-ad24-00a0b89f23fb
      state: Broken Off

이제 이 CR에서 실행할 수 있는 유일한 작업이 VolumeReplicationRelationship이므로 이를 삭제해도 됩니다.

볼륨 크기 조절

언제든지 소스 볼륨의 크기가 조절되면 VolumeReplicatioRelationship이 생성될 때 사용자를 대신하여 생성되는 대상 영역의 해당 볼륨도 일치하도록 크기가 조절되어야 합니다.