Kubernetes Operator가 MongoDB 사용자 지정 리소스를 사용하여 관리하는 MongoDB 데이터베이스에 대한 연속적이고 자동화된 백업을 구성할 수 있습니다.
참고
MongoDB database 리소스 배포서버 중에 MongoDB 리소스에 대한 백업을 이미 구성한 경우 다음 절차를 완료할 필요가 없습니다.
고려 사항
MongoDB 리소스에 대한 백업을 구성하기 전에 다음 고려 사항을 참조하세요.
Kubernetes Operator를 사용하여 할당 레이블을 설정하는 경우 Kubernetes 설정 파일에서 설정한 할당 레이블 값이 Ops Manager UI에 정의된 값을 재정의합니다. Kubernetes Operator를 사용하여 설정하지 않은 할당 레이블은 Ops Manager UI에 설정된 값을 계속 사용합니다.
If you set a snapshot schedule field using the Kubernetes Operator, the value that you set in the Kubernetes configuration file for that field overrides the value defined in the Ops Manager UI. Snapshot schedule fields that you don't set using the Kubernetes Operator continue to use the value set in the Ops Manager UI.
예시
Kubernetes 연산자에서
backup.snapshotSchedule.snapshotIntervalHours=6을(를) 설정합니다.UI에서 다음 값을 설정합니다.
Snapshot Inverval: 10
스냅샷 보존 일수: 5일
Ops Manager uses the following values for your deployment:
Snapshot Inverval: 6
스냅샷 보존 일수: 5일
If you enable backups for your MongoDB database deployment using the Kubernetes Operator, but you don't set a snapshot schedule using the Kubernetes Operator, Ops Manager uses the snapshot schedule you set in the Ops Manager UI.
MongoDB deployment의 백업을 활성화했지만 스냅샷 일정을 전혀 설정하지 않은 경우 Ops Manager는 기본 스냅샷 일정을 사용합니다.
전제 조건
MongoDB 리소스에 대한 연속 백업을 구성하기 전에 다음 작업을 완료하세요.
Ops Manager 리소스의 백업을 구성합니다. 링크된 절차에서 백업을 구성하는 단계를 참조하세요. MongoDB 데이터베이스를 연속 백업을 하려면 Ops Manager 리소스 사양에서
spec.backup.enabled값을true(으)로 설정해야 합니다.
절차
MongoDB 데이터베이스 배포를 위한 백업을 활성화합니다.
데이터베이스 배포의 구성 파일에 spec.backup.mode 설정을 추가하고 다음 복제본 세트 예와 같이 해당 값을 enabled(으)로 설정합니다.
1 2 apiVersion: mongodb.com/v1 3 kind: MongoDB 4 metadata: 5 name: <my-replica-set> 6 spec: 7 members: 3 8 version: "8.0.0" 9 type: ReplicaSet 10 opsManager: 11 configMapRef: 12 name: <my-project> 13 credentials: <my-credentials> 14 backup: 15 # Sets labels for the Backup Daemon. 16 assignmentLabels: ["test1", "test2"] 17 mode: enabled
구성 파일을 생성하거나 편집하는 방법에 대해 자세히 알아보려면 복제본 세트 배포 또는 샤딩된 클러스터 배포를 참조하세요.
선택사항: 스냅샷 일정을 설정합니다.
Add any of the following snapshot schedule settings to the specification file for the deployment. To learn how Ops Manager determines the snapshot schedule if you don't set a snapshot schedule field using the Kubernetes Operator,] see the considerations.
선택 사항: 백업 할당 레이블을 설정합니다.
Add one or more spec.backup.assignmentLabels to the specification file for the deployment. Use assignment labels to identify that specific backup stores are associated with particular projects. Setting labels in Kubernetes Operator overrides labels that you set in Ops Manager. To learn more, see considerations.
이 절차 앞부분의 할당 레이블이 있는 사양 파일의 예를 참조하세요.