LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, LG 전자│ 문규성, Sr. Database Sales Specialist, WWSO, AWS ::: AWS Data Roadshow 2023

Amazon Web Services Korea
Amazon Web Services KoreaAmazon Web Services Korea
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
문규성
Sr. Database Sales Specialist
AWS WWSO(World Wide Specialist Organization)
Amazon RDS Blue/Green Deployment
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon RDS(Relational Database Service)
2
M A N A G E D R E L A T I O N A L D A T A B A S E S E R V I C E W I T H A C H O I C E O F P O P U L A R D A T A B A S E E N G I N E S
성능 및 확장성
Scale compute and
storage with a few clicks;
minimal downtime for
your application
가용성 및 지속성
Automatic Multi-AZ data
replication; automated
backup, snapshots,
and failover
관리의 용이성
Easily deploy and maintain
hardware, OS, and DB
software; built-in monitoring
보안 및 규정
준수
Data encryption at rest and
in transit; assists customers
with their compliance goals
through tooling
MySQL MariaDB PostgreSQL SQL Server Oracle
MySQL-Compatible
Edition
PostgreSQL-
Compatible Edition
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon RDS : 지속적인 혁신
3
2014
2016 2017 2018 2019 2020
Aurora MySQL-
Compatible preview
IAM authentication
DB Start-Stop
DB Cloning
Aurora PostgreSQL-
Compatible
Aurora Serverless
Backtrack
Performance Insights
Amazon RDS
Recommendations
Parallel Query
Global Database
Data API
DB Activity Streams
Aurora ML
Amazon RDS Proxy
Multi-AZ
Read replicas
Amazon RDS
for Oracle
Amazon RDS for
SQL Server
Provisioned IOPS
Amazon RDS
for MySQL
Replica load balancing;
Lambda integration
S3 integration
Amazon RDS
for PostgreSQL
Export to S3
AD integration
AWS Backup
Amazon RDS Proxy
Amazon RDS on
AWS Outposts
AWS Graviton2
2009 2010 2011 2012 2013
2021
Amazon RDS
Custom
Babelfish
IPV6 Support
AWS DevOps Guru
AWS JDBC Driver
Federated Queries
in Amazon Redshift
2015
Aurora MySQL
Amazon RDS
for MariaDB
AWS DMS
AWS SCT
2022
Aurora Serverless v2;
Amazon RDS
Multi-AZ readable
standbys
Blue/Green Deployments
Optimized Writes
Optimized Reads
Trusted Language
Extensions for
PostgreSQL
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
관리형 데이터베이스로의 혁신 가속화
인프라 관리가 아닌 Innovation과 App 구축에 더 많은 시간을 투자
4
Database
management
Your responsibility
AWS responsibility
Schema
design
Query
optimization
Query
construction
Routine
Maintenance
Advanced
Monitoring
Automated
patching
Scaling
Industry
Compliance
Isolation &
Security
Backup &
Recovery
Automatic
failover
Updates
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
다양한 유형의 Database 변경…
5
Major/Minor
version
upgrades
Schema
changes
Instance
scaling
Engine
parameter
changes
Maintenance
updates
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Databases Upgrade: 전통적인 방식
6
1. In-place database updates
• Simple – 간단한 클릭 몇 번으로 업그레이드
작업 가능
2. Staging environment with cutover
• Safe – 더 높은 수준의 제어 가능
• Fast – 더 빠른 cutover 시간
BUT
• production system의 서비스 다운 타임 발생
• 예측할 수 없는 다운타임 시간
BUT
• 상세화/고도화된 작업 계획 및 컨트롤 필요
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
New – Amazon RDS Blue/Green Deployments
announced in Nov.27 2022
7
• Simple – 클릭 몇 번만으로 완전한 관리
• Safe – guardrails을 통한 높은 수준의 제어
• Fast – 수분안에 빠르게 switchover
* Downtime for workloads with long-running transactions during switchover
and workloads that have large replica lags may take longer
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Deployments – Starting point
8
Users /
Applications
DB endpoint
Blue
Primary
Current
Production
AWS Cloud
Amazon RDS
Blue Replicas
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Deployments – Interim state
9
Users /
Applications
DB endpoint
Logical replication to sync
from ‘blue’ to ‘green’
Blue
Primary
Green
Primary
Future
Production
Current
Production
AWS Cloud
Amazon RDS
Blue Replicas Green Replicas
• 현재 프로덕션 환경(Blue)의
미러링된 복사본을 향후
프로덕션(Green)으로 생성
• Blue primary와 Green
primary간의 logical
replication 설정
• switchover 이전에 향후
프로덕션(Green)의
추가/수정/삭제 및
변경사항의 테스트
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Deployments – End state
10
Users /
Applications
DB endpoint
Green
Primary
Final
Production
AWS Cloud
Green Replicas
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Deployments – SAFE, FAST
11
• 사전 검사 실행 –
transactions인스턴스/ replication
상태 테스트, 장기 실행 트랜잭션
플래그 지정
• Writes 차단 –
Blue/Green의 쓰기를 모두
차단하고 Green이 Sync 될 때까지
기다린 다음 전환
SAFE
• 수분내로 전환
• 설정가능한 RTO –
최소 30초로 설정, 임계값을
초과하면 워크플로우가 종료되고
취소됨
FAST
* Recovery Time Objective – maximum tolerable downtime for the switchover
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Deployments - 호환성
12
• 사용가능한 Version
▪ Amazon Aurora MySQL- Compatible
versions 5.6 and higher(Including ver. 8)
▪ Amazon RDS for MySQL versions 5.7 and
higher
▪ Amazon RDS for MariaDB versions 10.2
and higher
M A K E S A F E R , S I M P L E R , A N D F A S T E R D A T A B A S E U P D A T E S W I T H Z E R O D A T A L O S S A S F A S T A S A M I N U T E O N
A M A Z O N A U R O R A A N D A M A Z O N R D S
* Downtime for workloads with long-running tractions during switchover and
workloads that have large replica lags may take longer
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
이은경
DBA, 책임연구원
LG전자
Amazon Aurora 및 RDS
블루/그린 배포를 이용한
데이터베이스 업그레이드 안정성 확보
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
LG전자와 ThinQ
LG전자는 LG ThinQ 플랫폼의 글로벌 서비스를 안정적이고 확장성 있는 서비스로 구축 운영 중
데이터베이스는 Amazon Aurora 및 MySQL & MariaDB RDS를 중심으로 서비스 목적에 맞게
최신 AWS 데이터베이스 서비스들을 Proactive하게 검토 및 도입
14
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
LG전자와 Amazon RDS Upgrade
Aurora 및 RDS의 EoL(End-of-Life)를 대비하여, DB 버전 업그레이드 계획 수립하여 진행
AWS의 다양한 DB서비스 사용하여 수백 set 이상의 클러스터 운영 중
- 소수의 DB관리자가 안정적인 업그레이드 진행 작업의 리소스 분배에 어려움 존재
15
DBMS Version (old) Version (new) EoL
RDS for MySQL 5.7 8.0 2023-10
RDS for MariaDB 10.3 10.6 2023-10-23
RDS/Aurora for PostgreSQL 11 14 2024-01-31
Aurora for MySQL 2 3 2024-10-31
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
LG전자와 RDS Blue / Green Deployment
▪ RDS Blue/Green Deployments 기능을 기본 작업 방식으로 채택
o 작업 대상 및 일정 계획 수립
o 사전 철저한 테스트 및 검증 실시
o 실제 버전 업그레이드 작업 1주일 전, Green DB Cluster 구성
o 버전 업그레이드 당일에는 Switch-over만 수행 (약 1-2분)
o WAS 재시작과 같은 작업은 별도 진행하지 않음
16
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Deployment 구성 단계
17
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Deployment 구성 단계
18
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Deployment 구성 단계
19
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Blue/Green Switchover 조건 (guardrail)
20
o readiness of the blue and green environments for switchover
- switchover guardrails
o checks on the green environment:
* Replication health
* Replication lag
* Active writes
o checks on the blue environment:
* External replication
* Long-running active writes
* Long-running DDL statements
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RDS Blue/Green Switch-over (서비스 영향도)
21
Time
Blue Cluster
→ old1 postfix 추가
Green Cluster
→ 기존 Blue명으로 rename
서비스 영향
DBID 내역 DBID 내역 Read 가능 Write 가능
14:40:50 Blue Switch over 시작 Green Switch over 시작 O O
14:41:15 Blue read_only=true Green read_only=true O X
14:41:33 old1
Rename 완료 renamed
Green
Rename 완료
접속 가능 상태
O
(순단)
X
14:41:34 old1
기존 세션 보임 renamed
Green
O X
14:41:39 old1
접속 불가
기존 세션 정리 시작
renamed
Green
기존 서비스 세션 재접속
O X
14:41:45 old1
renamed
Green
read_only=false
O O
14:42:35 old1
접속 가능 상태
기존 세션 정리된 상태
renamed
Green
O O
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lessons Learned – Green 생성
22
o 본 작업 1주일 전에 Green 생성 진행
(Green의 DB Storage 최적화, DB Cache Warm-up 작업 위함)
o Aurora MySQL 에서 Green 의 event_scheduler 가 켜져 있을 경우 동기화 에러
(event_scheduler=OFF 상태에서 Green 생성하여 해결)
o Green rename(endpoint 변경)해도 switch over 시에 blue 와 동일하게 변경됨
o Green 은 생성 당시의 blue 와 동일한 상태로 생성됨
(performance insight, tag 를 포함해서 동일 설정으로 생성)
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lessons Learned – Binlog
23
o binlog_format=OFF 일 경우 Blue/Green 구성 안됨
binlog_format 설정 필요
(binlog_format 변경을 위해서는 DB reboot 이 필요함)
o log_bin=ON 일 경우 Blue 에서 Write 성능이 저하될 수 있음
(Blue /Green Deployment 구성 시, 성능 확인 및 Spec 조정 검토 필요)
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lessons Learned – event_scheduler
24
o Aurora 진행 시, Green의 event_scheduler 가 On 이면 동기화 문제 발생
RDS는 Green을 생성하면, read_only="true if replica" 수식에 의해
read_only=true로 생성되므로, event_scheduler 가 On 이어도 영향이 없음
Aurora 는 read_only=true 로 되지 않아, Green에서 스케줄이 수행되면서
데이터를 변경할 수 있어, event_scheduler = OFF 로 Green 생성
o Switch over 이후, Green(New) 에서 event 의 status 확인 필요
SLAVESIDE_DISABLED 상태로 변경된 것이 발생
alter event event_name disable on slave;
alter event event_name enable;
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lessons Learned – External replication
25
o Blue 에 External replication 설정되어 있을 경우,
Switch over 진행 안되므로 External replication 설정을 해제해야 함
Blue에서 Reset 명령어를 통해 Reset 한 후, Switch over 진행 가능함
o Reset 명령어
CALL mysql.rds_reset_external_master
o Blue 의 External replication 유무 확인 방법
(방법1) AWS 콘솔 – Blue 클릭 - Connectivity & security 탭 - Replication 정보
→ Replication state 가 Error 이면, External replication 설정 정보가 남아 있는 것
(방법2) Blue 에 접속 - show slave statusG 실행
→ 동기화 정보 나오면 External replication 설정 정보가 남아 있는 것
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lessons Learned – ETC
26
o Deletion Protection 옵션은 OFF 되므로 다시 켜야함 → 해결됨
o TAG 가 Blue 에서 Green으로 이전되지 않는 문제 → 해결됨
o Green 생성 시 IAM Role 이 이전되지 않는 문제
Green 생성 후, Blue 에 적용된 IAM Role 이 존재하는지 확인 후,
Role 이 있을 경우, Green 에 Role Add 작업은 별도 수행
o 업그레이드 Pre-check 단계에서 최신 버전부터 사용되지 않는 함수 체크 시
string 으로 검색하여 사용되는 함수도 오탐되는 문제 → 철저한 조사
ex) ENCRYPT (없어진 함수), AES_ENCRYPT (사용가능 함수)
AWS DATA ROADSHOW 2023
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
Thank you!
이은경
LG전자
ek.lee@lge.com
1 sur 27

Contenu connexe

Tendances(20)

20170621 aws-black belt-ads-sms20170621 aws-black belt-ads-sms
20170621 aws-black belt-ads-sms
Amazon Web Services Japan61.8K vues

Similaire à LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, LG 전자│ 문규성, Sr. Database Sales Specialist, WWSO, AWS ::: AWS Data Roadshow 2023(20)

AWS Modern Infra with Storage Roadshow 2023 - Day 2AWS Modern Infra with Storage Roadshow 2023 - Day 2
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea169 vues

Plus de Amazon Web Services Korea(13)

AWS Modern Infra with Storage Roadshow 2023 - Day 1AWS Modern Infra with Storage Roadshow 2023 - Day 1
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea102 vues

LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, LG 전자│ 문규성, Sr. Database Sales Specialist, WWSO, AWS ::: AWS Data Roadshow 2023

  • 1. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 문규성 Sr. Database Sales Specialist AWS WWSO(World Wide Specialist Organization) Amazon RDS Blue/Green Deployment
  • 2. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon RDS(Relational Database Service) 2 M A N A G E D R E L A T I O N A L D A T A B A S E S E R V I C E W I T H A C H O I C E O F P O P U L A R D A T A B A S E E N G I N E S 성능 및 확장성 Scale compute and storage with a few clicks; minimal downtime for your application 가용성 및 지속성 Automatic Multi-AZ data replication; automated backup, snapshots, and failover 관리의 용이성 Easily deploy and maintain hardware, OS, and DB software; built-in monitoring 보안 및 규정 준수 Data encryption at rest and in transit; assists customers with their compliance goals through tooling MySQL MariaDB PostgreSQL SQL Server Oracle MySQL-Compatible Edition PostgreSQL- Compatible Edition
  • 3. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon RDS : 지속적인 혁신 3 2014 2016 2017 2018 2019 2020 Aurora MySQL- Compatible preview IAM authentication DB Start-Stop DB Cloning Aurora PostgreSQL- Compatible Aurora Serverless Backtrack Performance Insights Amazon RDS Recommendations Parallel Query Global Database Data API DB Activity Streams Aurora ML Amazon RDS Proxy Multi-AZ Read replicas Amazon RDS for Oracle Amazon RDS for SQL Server Provisioned IOPS Amazon RDS for MySQL Replica load balancing; Lambda integration S3 integration Amazon RDS for PostgreSQL Export to S3 AD integration AWS Backup Amazon RDS Proxy Amazon RDS on AWS Outposts AWS Graviton2 2009 2010 2011 2012 2013 2021 Amazon RDS Custom Babelfish IPV6 Support AWS DevOps Guru AWS JDBC Driver Federated Queries in Amazon Redshift 2015 Aurora MySQL Amazon RDS for MariaDB AWS DMS AWS SCT 2022 Aurora Serverless v2; Amazon RDS Multi-AZ readable standbys Blue/Green Deployments Optimized Writes Optimized Reads Trusted Language Extensions for PostgreSQL
  • 4. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 관리형 데이터베이스로의 혁신 가속화 인프라 관리가 아닌 Innovation과 App 구축에 더 많은 시간을 투자 4 Database management Your responsibility AWS responsibility Schema design Query optimization Query construction Routine Maintenance Advanced Monitoring Automated patching Scaling Industry Compliance Isolation & Security Backup & Recovery Automatic failover Updates
  • 5. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 다양한 유형의 Database 변경… 5 Major/Minor version upgrades Schema changes Instance scaling Engine parameter changes Maintenance updates
  • 6. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Databases Upgrade: 전통적인 방식 6 1. In-place database updates • Simple – 간단한 클릭 몇 번으로 업그레이드 작업 가능 2. Staging environment with cutover • Safe – 더 높은 수준의 제어 가능 • Fast – 더 빠른 cutover 시간 BUT • production system의 서비스 다운 타임 발생 • 예측할 수 없는 다운타임 시간 BUT • 상세화/고도화된 작업 계획 및 컨트롤 필요
  • 7. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. New – Amazon RDS Blue/Green Deployments announced in Nov.27 2022 7 • Simple – 클릭 몇 번만으로 완전한 관리 • Safe – guardrails을 통한 높은 수준의 제어 • Fast – 수분안에 빠르게 switchover * Downtime for workloads with long-running transactions during switchover and workloads that have large replica lags may take longer
  • 8. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Deployments – Starting point 8 Users / Applications DB endpoint Blue Primary Current Production AWS Cloud Amazon RDS Blue Replicas
  • 9. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Deployments – Interim state 9 Users / Applications DB endpoint Logical replication to sync from ‘blue’ to ‘green’ Blue Primary Green Primary Future Production Current Production AWS Cloud Amazon RDS Blue Replicas Green Replicas • 현재 프로덕션 환경(Blue)의 미러링된 복사본을 향후 프로덕션(Green)으로 생성 • Blue primary와 Green primary간의 logical replication 설정 • switchover 이전에 향후 프로덕션(Green)의 추가/수정/삭제 및 변경사항의 테스트
  • 10. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Deployments – End state 10 Users / Applications DB endpoint Green Primary Final Production AWS Cloud Green Replicas
  • 11. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Deployments – SAFE, FAST 11 • 사전 검사 실행 – transactions인스턴스/ replication 상태 테스트, 장기 실행 트랜잭션 플래그 지정 • Writes 차단 – Blue/Green의 쓰기를 모두 차단하고 Green이 Sync 될 때까지 기다린 다음 전환 SAFE • 수분내로 전환 • 설정가능한 RTO – 최소 30초로 설정, 임계값을 초과하면 워크플로우가 종료되고 취소됨 FAST * Recovery Time Objective – maximum tolerable downtime for the switchover
  • 12. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Deployments - 호환성 12 • 사용가능한 Version ▪ Amazon Aurora MySQL- Compatible versions 5.6 and higher(Including ver. 8) ▪ Amazon RDS for MySQL versions 5.7 and higher ▪ Amazon RDS for MariaDB versions 10.2 and higher M A K E S A F E R , S I M P L E R , A N D F A S T E R D A T A B A S E U P D A T E S W I T H Z E R O D A T A L O S S A S F A S T A S A M I N U T E O N A M A Z O N A U R O R A A N D A M A Z O N R D S * Downtime for workloads with long-running tractions during switchover and workloads that have large replica lags may take longer
  • 13. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. 이은경 DBA, 책임연구원 LG전자 Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보
  • 14. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. LG전자와 ThinQ LG전자는 LG ThinQ 플랫폼의 글로벌 서비스를 안정적이고 확장성 있는 서비스로 구축 운영 중 데이터베이스는 Amazon Aurora 및 MySQL & MariaDB RDS를 중심으로 서비스 목적에 맞게 최신 AWS 데이터베이스 서비스들을 Proactive하게 검토 및 도입 14
  • 15. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. LG전자와 Amazon RDS Upgrade Aurora 및 RDS의 EoL(End-of-Life)를 대비하여, DB 버전 업그레이드 계획 수립하여 진행 AWS의 다양한 DB서비스 사용하여 수백 set 이상의 클러스터 운영 중 - 소수의 DB관리자가 안정적인 업그레이드 진행 작업의 리소스 분배에 어려움 존재 15 DBMS Version (old) Version (new) EoL RDS for MySQL 5.7 8.0 2023-10 RDS for MariaDB 10.3 10.6 2023-10-23 RDS/Aurora for PostgreSQL 11 14 2024-01-31 Aurora for MySQL 2 3 2024-10-31
  • 16. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. LG전자와 RDS Blue / Green Deployment ▪ RDS Blue/Green Deployments 기능을 기본 작업 방식으로 채택 o 작업 대상 및 일정 계획 수립 o 사전 철저한 테스트 및 검증 실시 o 실제 버전 업그레이드 작업 1주일 전, Green DB Cluster 구성 o 버전 업그레이드 당일에는 Switch-over만 수행 (약 1-2분) o WAS 재시작과 같은 작업은 별도 진행하지 않음 16
  • 17. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Deployment 구성 단계 17
  • 18. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Deployment 구성 단계 18
  • 19. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Deployment 구성 단계 19
  • 20. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Blue/Green Switchover 조건 (guardrail) 20 o readiness of the blue and green environments for switchover - switchover guardrails o checks on the green environment: * Replication health * Replication lag * Active writes o checks on the blue environment: * External replication * Long-running active writes * Long-running DDL statements
  • 21. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. RDS Blue/Green Switch-over (서비스 영향도) 21 Time Blue Cluster → old1 postfix 추가 Green Cluster → 기존 Blue명으로 rename 서비스 영향 DBID 내역 DBID 내역 Read 가능 Write 가능 14:40:50 Blue Switch over 시작 Green Switch over 시작 O O 14:41:15 Blue read_only=true Green read_only=true O X 14:41:33 old1 Rename 완료 renamed Green Rename 완료 접속 가능 상태 O (순단) X 14:41:34 old1 기존 세션 보임 renamed Green O X 14:41:39 old1 접속 불가 기존 세션 정리 시작 renamed Green 기존 서비스 세션 재접속 O X 14:41:45 old1 renamed Green read_only=false O O 14:42:35 old1 접속 가능 상태 기존 세션 정리된 상태 renamed Green O O
  • 22. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lessons Learned – Green 생성 22 o 본 작업 1주일 전에 Green 생성 진행 (Green의 DB Storage 최적화, DB Cache Warm-up 작업 위함) o Aurora MySQL 에서 Green 의 event_scheduler 가 켜져 있을 경우 동기화 에러 (event_scheduler=OFF 상태에서 Green 생성하여 해결) o Green rename(endpoint 변경)해도 switch over 시에 blue 와 동일하게 변경됨 o Green 은 생성 당시의 blue 와 동일한 상태로 생성됨 (performance insight, tag 를 포함해서 동일 설정으로 생성)
  • 23. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lessons Learned – Binlog 23 o binlog_format=OFF 일 경우 Blue/Green 구성 안됨 binlog_format 설정 필요 (binlog_format 변경을 위해서는 DB reboot 이 필요함) o log_bin=ON 일 경우 Blue 에서 Write 성능이 저하될 수 있음 (Blue /Green Deployment 구성 시, 성능 확인 및 Spec 조정 검토 필요)
  • 24. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lessons Learned – event_scheduler 24 o Aurora 진행 시, Green의 event_scheduler 가 On 이면 동기화 문제 발생 RDS는 Green을 생성하면, read_only="true if replica" 수식에 의해 read_only=true로 생성되므로, event_scheduler 가 On 이어도 영향이 없음 Aurora 는 read_only=true 로 되지 않아, Green에서 스케줄이 수행되면서 데이터를 변경할 수 있어, event_scheduler = OFF 로 Green 생성 o Switch over 이후, Green(New) 에서 event 의 status 확인 필요 SLAVESIDE_DISABLED 상태로 변경된 것이 발생 alter event event_name disable on slave; alter event event_name enable;
  • 25. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lessons Learned – External replication 25 o Blue 에 External replication 설정되어 있을 경우, Switch over 진행 안되므로 External replication 설정을 해제해야 함 Blue에서 Reset 명령어를 통해 Reset 한 후, Switch over 진행 가능함 o Reset 명령어 CALL mysql.rds_reset_external_master o Blue 의 External replication 유무 확인 방법 (방법1) AWS 콘솔 – Blue 클릭 - Connectivity & security 탭 - Replication 정보 → Replication state 가 Error 이면, External replication 설정 정보가 남아 있는 것 (방법2) Blue 에 접속 - show slave statusG 실행 → 동기화 정보 나오면 External replication 설정 정보가 남아 있는 것
  • 26. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lessons Learned – ETC 26 o Deletion Protection 옵션은 OFF 되므로 다시 켜야함 → 해결됨 o TAG 가 Blue 에서 Green으로 이전되지 않는 문제 → 해결됨 o Green 생성 시 IAM Role 이 이전되지 않는 문제 Green 생성 후, Blue 에 적용된 IAM Role 이 존재하는지 확인 후, Role 이 있을 경우, Green 에 Role Add 작업은 별도 수행 o 업그레이드 Pre-check 단계에서 최신 버전부터 사용되지 않는 함수 체크 시 string 으로 검색하여 사용되는 함수도 오탐되는 문제 → 철저한 조사 ex) ENCRYPT (없어진 함수), AES_ENCRYPT (사용가능 함수)
  • 27. AWS DATA ROADSHOW 2023 © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. © 2023, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark. Thank you! 이은경 LG전자 ek.lee@lge.com