Prerequisite
- RDS 권한이 필요합니다.
Process
1. RDS Aurora 자동 백업/복원
- 백업
📌 기본적으로 Aurora는 자동 백업이 활성화 되어있으며, 초기 설정된 보존기간 범위로 특정 시점을 복원할 수 있습니다.
</aside>
자동 백업은 1일에서 최대 35일간 보존이 가능하며, 35일 이상 장기간 보존하기 위해 스냅샷을 생성할 수 있습니다.
-
RDS를 생성할 때 백업 보존 기간을 생성할 수 있으며, 기존 RDS 인스턴스를 수정할 수 있습니다.
-
- 복원
📌 RDS 자동 백업은 특정 시점 복원 기능을 통해 보존 기간 내 지정된 시간으로 복원할 수 있습니다.
-
아래 링크를 통해 특정 시점 복원은 콘솔 및 CLI 환경에서 사용 가능합니다.
-
CLI 환경에서 새 인스턴스 생성으로 복원을 진행하는 경우 RDS 인스턴스 설정에 대한 옵션을 지정해야 합니다.
CLI 옵션의 예시의 경우 아래와 같습니다.
## Linux,macOS 예시 aws rds restore-db-instance-to-point-in-time \\ --source-db-instance-identifier mysourcedbinstance \\ --target-db-instance-identifier mytargetdbinstance \\ --restore-time 2017-10-14T23:45:00.000Z \\ --max-allocated-storage 1000
- --source-db-instance-identifier : 복원할 원본 DB 인스턴스 식별자
- --target-db-instance-identifier : 생성할 새 DB 인스턴스 이름
-
RDS CLI 복원 작업 시 옵션 설명 및 방법은 아래와 같습니다.
<RDS 인스턴스 생성 옵션 설명>
Creating an Amazon RDS DB instance
<RDS 특정 시점 복원 옵션>
restore-db-instance-to-point-in-time - AWS CLI 1.25.87 Command Reference
-
2. RDS Aurora 스냅샷 백업/복원
- 백업
📌 RDS 스냅샷 백업은 RDS 콘솔 메뉴에 스냅샷의 형태로 저장되며, 만료되지 않습니다.
장기간 백업이 필요한 경우 S3로 스냅샷을 내보낼 수 있습니다. - 복원
📌 RDS 콘솔 내 Snapshots 메뉴에서 간단하게 스냅샷을 복원할 수 있습니다.-
RDS CLI 복원 작업 시 옵션 설명 및 방법은 아래와 같습니다.
<RDS 인스턴스 생성 옵션 설명>
Creating an Amazon RDS DB instance
<RDS 스냅샷 복원 옵션>
restore-db-instance-from-db-snapshot - AWS CLI 1.25.87 Command Reference
-
- 참고
-
(스냅샷 백업/복원 자습서)
Tutorial: Restore an Amazon Aurora DB cluster from a DB cluster snapshot
-
AWS CLI 작업 자동화 스케쥴링
Crontab 등의 도구를 이용하여 AWS CLI 작업을 예약할 수 있습니다.
Reference
- https://docs.aws.amazon.com/ko_kr/AmazonRDS/latest/UserGuide/USER_PIT.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html#USER_CreateDBInstance.Settings
- https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-to-point-in-time.html
- https://aws.amazon.com/ko/premiumsupport/knowledge-center/rds-automated-snapshot-retain-longer/
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html
- https://docs.aws.amazon.com/ko_kr/AmazonRDS/latest/UserGuide/USER_RestoreFromSnapshot.html
- https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html#USER_CreateDBInstance.Settings
- https://docs.aws.amazon.com/cli/latest/reference/rds/restore-db-instance-from-db-snapshot.html
- https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/tut-restore-cluster.html
- https://anto.online/code/bash-cannot-run-aws-cli-using-cron-linux/
댓글
댓글 0개
댓글을 남기려면 로그인하세요.