Skip to content

[deploy/#292] MySQL/Elasticsearch 자동 백업 시스템 구축#293

Merged
Dimo-2562 merged 5 commits intodevelopfrom
deploy/#292
Mar 3, 2026
Merged

[deploy/#292] MySQL/Elasticsearch 자동 백업 시스템 구축#293
Dimo-2562 merged 5 commits intodevelopfrom
deploy/#292

Conversation

@Dimo-2562
Copy link
Contributor

❤️ 기능 설명

Terraform

  • OCI Object Storage 버킷 생성 및 Instance Principal 인증 구성
  • Dynamic Group / IAM Policy로 서버가 자격증명 없이 버킷에 접근 가능하도록 설정

백업 스크립트

  • MySQL: docker exec + mysqldump --single-transaction → gzip 압축 → OCI 업로드
  • Elasticsearch: Snapshot API(wait_for_completion=true) → tar.gz 압축 → OCI 업로드
  • 백업 완료 후 7일 초과 파일 자동 삭제 (OCI API 기준 time-created)

GitHub Actions

  • 매일 02:00 KST 스케줄 자동 실행 (workflow_dispatch로 수동 실행도 가능)
  • 실패 시 Discord Webhook 알림

Docker Compose

  • Elasticsearch path.repo 환경변수 및 스냅샷 디렉토리 바인드 마운트 추가

배포 순서

  1. cd infra/oracle && terraform apply
  2. 서버에서 bash ~/deploy/docker/backup/setup-cron.sh 실행
  3. Elasticsearch 재시작: docker compose -f docker/docker-compose.infra.yml restart elasticsearch
  4. GitHub Actions에서 수동 실행으로 테스트

연결된 issue

연결된 issue를 자동으로 닫기 위해 아래 {이슈넘버}를 입력해주세요.

close #292



✅ 체크리스트

  • PR 제목 규칙 잘 지켰는가?
  • 추가/수정사항을 설명하였는가?
  • 테스트 결과 사진을 넣었는가?
  • 이슈넘버를 적었는가?

@Dimo-2562 Dimo-2562 self-assigned this Mar 3, 2026
@Dimo-2562 Dimo-2562 added 🚀 DEPLOY 배포 🌐 infra 인프라/배포 labels Mar 3, 2026
@Dimo-2562 Dimo-2562 merged commit d85df59 into develop Mar 3, 2026
1 check passed
@Dimo-2562 Dimo-2562 deleted the deploy/#292 branch March 3, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚀 DEPLOY 배포 🌐 infra 인프라/배포

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DEPLOY] MySQL/Elasticsearch 자동 백업 시스템 구축

1 participant