SlideShare a Scribd company logo
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Aurora
Blue Green Deployment
A W S D A T A & A I R O A D S H O W 2 0 2 4
박진현
Solutions Architect
AWS
송정우
Solutions Architect
AWS
이덕현
Database Specialist SA
AWS
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
Agenda
시작시간 종료시간 내용
9:00 9:30 Hands on Lab 환경 구성
9:30 10:00 Aurora MySQL 3 Upgrade 시 주의할 내용
10:00 11:30 Aurora Blue/Green Deployment 실습
11:30 12:00 Aurora 와 R53 을 이용한 사전 테스트 방법
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora Blue Green Deployment
Hands on Lab 환경 구성
3
박진현
Solutions Architect
AWS
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hands on Lab 링크
4
https://bit.ly/3xzP8Tc
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
워크샵 시작 준비
5
Email one-time password (OTP) 선택한 뒤
개인 email로 인증
à 해당 계정으로 72시간 사용 가능
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
워크샵 시작 준비
6
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
워크샵 시작 준비
7
Blue/Green 실습을 진행하기 위해
새로운 Blue/Green 환경 구성 필요
à 10분 이상 소요되는 작업으로
미리 해당 작업 진행
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora MySQL 3 upgrade 주의사항
(temptable , collation)
8
이덕현
Database Specialist SA
AWS
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora Temp table
인스턴스 Memory 의 ¾ 는 InnoDB Buffer 로 사용 , 나머지 ¼ 영역에서 temp 가 같이 사용 됩니다.
-> 너무 큰 숫자로 설정할 경우 OOM 에 의한 Aurora 장애로 연결 될 수 있습니다.
Buffer pool
Reads
OS Heap
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
temptable_max_ram, temptable_max_mmap
10
MySQL 8.0, 내부 임시 테이블에 TempTable 엔진 사용 가능
• 기존 Memory 엔진은 가변 길이 타입 컬럼을 지원하지 않음
• varchar 및 varbinary 컬럼 별 최대 길이 만큼 메모리를 할당하여 비효율적인 면이 있음
• Internal_tmp_mem_storage_engine=TempTable 설정 시
• 내부 임시 테이블을 temptable_max_ram 크기만큼 메모리에서 사용 가능
• temptable_max_mmap 크기만큼 Aurora Local Storage에 메모리 매핑(MMAP) 형식의 디스크
파일 쓰기 가능
• 메모리 상 TempTable 형식의 데이터를 그대로 MMAP 파일로 전환하는 것이 오버헤드가 더 적음
• MMAP 파일 공간 한도 도달 시 Aurora Cluster(Data) Storage에 InnoDB 형식의 디스크 파일 사용
”내부 임시 테이블 사용 쿼리”
Memory
{temptable_max_ram}
Local Storage
{temptable_max_mma
p}
Cluster Storage
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
temptable_max_ram, temptable_max_mmap
Aurora MySQL의 temptable_max_ram, temptable_max_mmap 기본값
temptable_max_mmap, temptable_max_ram 모두 기본 1GiB로 설정됨
메모리가 16GiB 미만인 인스턴스(T타입)에서는 temptable_max_ram 가 기본 16 MiB로 설정됨
내부 임시 테이블 사용 쿼리 실행 중, temptable_max_mmap 크기의 한계에 다다르면 에러 발생
Writer 에서는 temptable_max_mmap 크기 초과 시 Aurora Storage에 InnoDB 형식의 테이블 쓰기 가능
→ 더 큰 임시 테이블 공간 사용 가능
Reader 에서는 Aurora Storage 쓰기가 불가능하여 temptable_max_mmap 크기 초과 시 위 에러 발생
11
ERROR 1114 : The table '/rdsdbdata/tmp/#sqlfd_1586_2' is full
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
temptable_max_mmap , temptable_max_ram
{DBInstanceClassMemory*1/16}
--
24xlarge --768GB
show variables like '%temp%'
-> ;
+-----------------------------------------------+-----------------------+
| Variable_name | Value |
+-----------------------------------------------+-----------------------+
| avoid_temporal_upgrade | OFF |
| innodb_cleanup_temp_tablespaces_in_background | ON |
| innodb_temp_data_file_path | ibtmp1:12M:autoextend |
| innodb_temp_tablespaces_dir | ./ |
| show_old_temporals | OFF |
| temptable_max_mmap | 49846937856 |
| temptable_max_ram | 49846937856 |
| temptable_use_mmap | ON |
+-----------------------------------------------+-----------------------+
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS DATA & AI ROADSHOW 2024
4xlarge - 256GB
MySQL [sysbench]> show variables like '%temp%';
+-----------------------------------------------+-----------------------+
| Variable_name | Value |
+-----------------------------------------------+-----------------------+
| avoid_temporal_upgrade | OFF |
| innodb_cleanup_temp_tablespaces_in_background | ON |
| innodb_temp_data_file_path | ibtmp1:12M:autoextend |
| innodb_temp_tablespaces_dir | ./ |
| show_old_temporals | OFF |
| temptable_max_mmap | 16407041280 |
| temptable_max_ram | 16407041280 |
| temptable_use_mmap | ON |
+-----------------------------------------------+-----------------------+
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 14
Aurora Character Set & Collection
Aurora MySQL 2.11.4 Aurora MySQL 3.04.2
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 15
Aurora Character Set & Collection
Aurora MySQL 2.11.4 Aurora MySQL 3.04.2
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16
Aurora Character Set & Collection
Aurora MySQL 2.11.4 Aurora MySQL 3.04.2
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 17
Aurora Character Set & Collection
Aurora MySQL 2.11.4 Aurora MySQL 3.04.2
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora Blue Green Deployment
Hands on Lab
18
박진현
Solutions Architect
AWS
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RDS Blue/Green 배포 – 시작점
Users /
Applications
DB endpoint
AWS Cloud
Amazon RDS
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RDS Blue/Green 배포 – 시작점
Users /
Applications
DB endpoint
Blue
Primary
Current
Production
AWS Cloud
Amazon RDS
Blue Replicas
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RDS Blue/Green 배포 – 임시 상태
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
• 현재 프로덕션
환경(파란색)의 미러링된
복사본을 그린 환경(향후
프로덕션)으로 생성합니다.
• 파란색 기본과 녹색 기본
간의 논리적 복제 설정
• 전환 전 그린 환경에서 그린
수정, 복제본 추가/제거, 변경
사항 테스트
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
RDS Blue/Green 배포 – 종료 상태
Users /
Applications
DB endpoint
Green
Primary
Final
Production
AWS Cloud
Green Replicas
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Aurora Blue/Green 배포
Region
Availability Zone
3
Availability Zone
1
Availability Zone
2
Aurora storage
RW
Users /
Applications
db cluster
endpoint
RO
Source
mycluster
Aurora MySQL 2.10.2 (5.7)
Aurora storage
RO
RW RO
Target
mycluster-green-x1234
Aurora MySQL 2.10.2 (5.7)
create-blue-green-deployment
RO RO
RO
RO
switchover-blue-green-deployment
delete-blue-green-deployment
AVAILABLE
SWITCHOVER_IN_PROGRESS
SWITCHOVER_COMPLETED
Source
mycluster-old1
Aurora MySQL 2.10.2 (5.7)
customer verification
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Hands on Lab 링크
24
https://bit.ly/3xzP8Tc
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Aurora와 R53을 이용한
사전 테스트 방법
25
송정우
Solutions Architect
AWS
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Contents
26
ü 사전 확인
ü 아키텍처
ü Demo
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
사전 확인
• 만약 Secrets Manager를 사용하여 DB에 접근하고 있다면, Blue/Green Deployment를 적용할 수
없습니다.
• Blue/Green Deployment를 이용하기 위해서는 binlog를 활성화시켜야 합니다.
이외의 부분들은 아래의 문서를 확인하시길 바랍니다.
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments-overview.html#blue-green-deployments-limitations
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1st 아키텍처
28
블루 서비스
타겟 그룹
ALB
태스크
…
그린 서비스
타겟 그룹
ALB
태스크
…
xxx.xxx.com
Blue에서 Green으로
동기화 하는
논리적 복제
블루
프라이머리
그린
프라이머리
Amazon Route 53
🌟 Read-only Traffic!
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 29
블루 서비스
타겟 그룹
ALB
태스크
…
그린 서비스
타겟 그룹
ALB
태스크
…
xxx.xxx.com
Blue에서 Green으로
동기화 하는
논리적 복제
블루
프라이머리
그린
프라이머리
Amazon Route 53
100 0
Route53의
Traffic Policy를 활용
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 30
블루 서비스
타겟 그룹
ALB
태스크
…
그린 서비스
타겟 그룹
ALB
태스크
…
xxx.xxx.com
Blue에서 Green으로
동기화 하는
논리적 복제
블루
프라이머리
그린
프라이머리
Amazon Route 53
90 10
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 31
블루 서비스
타겟 그룹
ALB
태스크
…
그린 서비스
타겟 그룹
ALB
태스크
…
xxx.xxx.com
Blue에서 Green으로
동기화 하는
논리적 복제
블루
프라이머리
그린
프라이머리
Amazon Route 53
50 50
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 32
블루 서비스
타겟 그룹
ALB
태스크
…
그린 서비스
타겟 그룹
ALB
태스크
…
xxx.xxx.com
Blue에서 Green으로
동기화 하는
논리적 복제
블루
프라이머리
그린
프라이머리
Amazon Route 53
10 90
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 33
블루 서비스
타겟 그룹
ALB
태스크
…
그린 서비스
타겟 그룹
ALB
태스크
…
xxx.xxx.com
Blue에서 Green으로
동기화 하는
논리적 복제
블루
프라이머리
그린
프라이머리
Amazon Route 53
0 100
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1st 아키텍처 주의 사항
• Read-Only 트래픽이 아니라면, 쓰기 트래픽이 나누어져 흘러 들어가기 때문에 큰 문제를
발생시킬 수 있습니다.
• DB 뿐만 아니라 Application Layer에 해당 하는 세트를 한 벌 더 띄우기 때문에 비용적인 부분을
고려할 필요가 있습니다.
• Route 53의 Traffic Policy로 인한 추가 비용이 발생할 수 있습니다.
즉, 위의 조건들에 의해 첫 번째 아키텍처는 다음의 상황에서 적절합니다.
• 테스트를 위한 부하 발생 도구들을 활용하고 있을 때
• 테스트 트래픽을 흘려 보내 보고 싶을 때
• 완벽하게 동일한 환경에서 테스트/확인해보고 싶을 때
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2nd Architecture
35
서비스
타겟 그룹
ALB
태스크
…
Blue에서 Green으로
동기화 하는
논리적 복제
Blue
Primary Green
Primary
쓰기 엔드포인트
연결
읽기 엔드포인트
연결
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2nd 아키텍처 주의 사항
즉, 위의 조건들에 의해 두 번째 아키텍처는 다음의 상황에서 적절합니다.
• 사전에 이미 테스트가 진행됐을 때
• 프로덕션 레벨에서 실제 트래픽을 활용한 테스트가 필요할 때
• 애플리케이션 내 CQRS 패턴 적용 혹은 읽기/쓰기 엔드포인트가 사전에 분리되어 있어야 시도할
수 있습니다.
• 만약 문제가 발생했다면, 프로덕션 레벨의 읽기에서 장애가 발생할 수 있습니다.
• 테스트를 위해 애플리케이션 재배포가 필요합니다.
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo
37
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
설문조사
38
더 나은 세션을 위해 설문조사에 참석해주시면 감사하겠습니다 J
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
박진현
Solutions Architect
AWS
송정우 이덕현
Solutions Architect
AWS
Database Specialist SA
AWS
39

More Related Content

Similar to [D3T2S01] Amazon Aurora MySQL 메이저 버전 업그레이드 및 Amazon B/G Deployments 실습 (20)

PDF
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
Amazon Web Services Korea
 
PDF
[25D2S09]_Amazon Nova팀이 선택한 Amazon SageMaker HyperPod 활용하기.pdf
Amazon Web Services
 
PPTX
D1T4S2_클라우드를 넘어, 보험사의 미래를 그리다_241104_블로그포스팅용....
Kwangsik Lee
 
PDF
AWS Summit Seoul 2023 | 오픈소스 데이터베이스로 탈 오라클! Why not?
Amazon Web Services Korea
 
PDF
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
Amazon Web Services Korea
 
PDF
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Web Services Korea
 
PPTX
AWS 의 비용 절감 프레임워크와 신규 프로그램을 활용한 전략적 비용절감 :: AWS Travel and Transportation 온라인...
Amazon Web Services Korea
 
PDF
AWS Summit Seoul 2023 | 24x7 운영에서 9x5 혁신으로 - ROSA로 실현하는 제한 없는 혁신 전략
Amazon Web Services Korea
 
PDF
[Games on AWS 2019] AWS 사용자를 위한 만랩 달성 트랙 | Aurora로 게임 데이터베이스 레벨 업! - 김병수 AWS ...
Amazon Web Services Korea
 
PDF
[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...
AWS Korea 금융산업팀
 
PDF
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
Amazon Web Services Korea
 
PDF
AWS Summit Seoul 2023 | AWS 마이그레이션을 통한 엔카닷컴의 DT 전략
Amazon Web Services Korea
 
PPTX
글로벌 고객 사례를 통하여 소개하는 혁신적인 데이터 웨어하우스 - 김형일 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
PDF
AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기
Amazon Web Services Korea
 
PDF
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Web Services Korea
 
PDF
SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...
Amazon Web Services Korea
 
PDF
AWS Summit Seoul 2023 | SK와 함께하는 AWS Migration Journey & App Modernization 전략
Amazon Web Services Korea
 
PDF
[D3T1S01] Gen AI를 위한 Amazon Aurora 활용 사례 방법
Amazon Web Services Korea
 
PDF
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea
 
LG전자 - Amazon Aurora 및 RDS 블루/그린 배포를 이용한 데이터베이스 업그레이드 안정성 확보 - 발표자: 이은경 책임, L...
Amazon Web Services Korea
 
[25D2S09]_Amazon Nova팀이 선택한 Amazon SageMaker HyperPod 활용하기.pdf
Amazon Web Services
 
D1T4S2_클라우드를 넘어, 보험사의 미래를 그리다_241104_블로그포스팅용....
Kwangsik Lee
 
AWS Summit Seoul 2023 | 오픈소스 데이터베이스로 탈 오라클! Why not?
Amazon Web Services Korea
 
실전! AWS 기반 데이터베이스 마이그레이션::최홍식::AWS Summit Seoul 2018
Amazon Web Services Korea
 
KB국민카드 - 클라우드 기반 분석 플랫폼 혁신 여정 - 발표자: 박창용 과장, 데이터전략본부, AI혁신부, KB카드│강병억, Soluti...
Amazon Web Services Korea
 
Amazon Redshift Deep Dive - Serverless, Streaming, ML, Auto Copy (New feature...
Amazon Web Services Korea
 
AWS 의 비용 절감 프레임워크와 신규 프로그램을 활용한 전략적 비용절감 :: AWS Travel and Transportation 온라인...
Amazon Web Services Korea
 
AWS Summit Seoul 2023 | 24x7 운영에서 9x5 혁신으로 - ROSA로 실현하는 제한 없는 혁신 전략
Amazon Web Services Korea
 
[Games on AWS 2019] AWS 사용자를 위한 만랩 달성 트랙 | Aurora로 게임 데이터베이스 레벨 업! - 김병수 AWS ...
Amazon Web Services Korea
 
[금융고객을 위한 Resiliency in the Cloud] AWS를 활용한 금융사 Resiliency 구성...
AWS Korea 금융산업팀
 
[Keynote] 슬기로운 AWS 데이터베이스 선택하기 - 발표자: 강민석, Korea Database SA Manager, WWSO, A...
Amazon Web Services Korea
 
AWS Summit Seoul 2023 | AWS 마이그레이션을 통한 엔카닷컴의 DT 전략
Amazon Web Services Korea
 
글로벌 고객 사례를 통하여 소개하는 혁신적인 데이터 웨어하우스 - 김형일 (AWS 솔루션즈 아키텍트)
Amazon Web Services Korea
 
AWS Summit Seoul 2023 | Amazon Neptune 및 Elastic을 이용한 추천 서비스 및 검색 플랫폼 구축하기
Amazon Web Services Korea
 
Amazon Aurora 신규 서비스 알아보기::최유정::AWS Summit Seoul 2018
Amazon Web Services Korea
 
SK Telecom - 망관리 프로젝트 TANGO의 오픈소스 데이터베이스 전환 여정 - 발표자 : 박승전, Project Manager, ...
Amazon Web Services Korea
 
AWS Summit Seoul 2023 | SK와 함께하는 AWS Migration Journey & App Modernization 전략
Amazon Web Services Korea
 
[D3T1S01] Gen AI를 위한 Amazon Aurora 활용 사례 방법
Amazon Web Services Korea
 
AWS Modern Infra with Storage Roadshow 2023 - Day 2
Amazon Web Services Korea
 

More from Amazon Web Services Korea (20)

PDF
[D3T1S06] Neptune Analytics with Vector Similarity Search
Amazon Web Services Korea
 
PDF
[D3T1S03] Amazon DynamoDB design puzzlers
Amazon Web Services Korea
 
PDF
[D3T1S04] Aurora PostgreSQL performance monitoring and troubleshooting by use...
Amazon Web Services Korea
 
PDF
[D3T1S07] AWS S3 - 클라우드 환경에서 데이터베이스 보호하기
Amazon Web Services Korea
 
PDF
[D3T1S05] Aurora 혼합 구성 아키텍처를 사용하여 예상치 못한 트래픽 급증 대응하기
Amazon Web Services Korea
 
PDF
[D3T1S02] Aurora Limitless Database Introduction
Amazon Web Services Korea
 
PDF
[D3T2S03] Data&AI Roadshow 2024 - Amazon DocumentDB 실습
Amazon Web Services Korea
 
PDF
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea
 
PDF
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon Web Services Korea
 
PDF
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
 
PDF
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Amazon Web Services Korea
 
PDF
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon Web Services Korea
 
PDF
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon Web Services Korea
 
PDF
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Amazon Web Services Korea
 
PDF
From Insights to Action, How to build and maintain a Data Driven Organization...
Amazon Web Services Korea
 
PDF
[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...
Amazon Web Services Korea
 
PDF
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon Web Services Korea
 
PDF
코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...
Amazon Web Services Korea
 
PDF
LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...
Amazon Web Services Korea
 
PDF
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
Amazon Web Services Korea
 
[D3T1S06] Neptune Analytics with Vector Similarity Search
Amazon Web Services Korea
 
[D3T1S03] Amazon DynamoDB design puzzlers
Amazon Web Services Korea
 
[D3T1S04] Aurora PostgreSQL performance monitoring and troubleshooting by use...
Amazon Web Services Korea
 
[D3T1S07] AWS S3 - 클라우드 환경에서 데이터베이스 보호하기
Amazon Web Services Korea
 
[D3T1S05] Aurora 혼합 구성 아키텍처를 사용하여 예상치 못한 트래픽 급증 대응하기
Amazon Web Services Korea
 
[D3T1S02] Aurora Limitless Database Introduction
Amazon Web Services Korea
 
[D3T2S03] Data&AI Roadshow 2024 - Amazon DocumentDB 실습
Amazon Web Services Korea
 
AWS Modern Infra with Storage Roadshow 2023 - Day 1
Amazon Web Services Korea
 
Amazon DocumentDB - Architecture 및 Best Practice (Level 200) - 발표자: 장동훈, Sr. ...
Amazon Web Services Korea
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Amazon Web Services Korea
 
Demystify Streaming on AWS - 발표자: 이종혁, Sr Analytics Specialist, WWSO, AWS :::...
Amazon Web Services Korea
 
Amazon EMR - Enhancements on Cost/Performance, Serverless - 발표자: 김기영, Sr Anal...
Amazon Web Services Korea
 
Amazon OpenSearch - Use Cases, Security/Observability, Serverless and Enhance...
Amazon Web Services Korea
 
Enabling Agility with Data Governance - 발표자: 김성연, Analytics Specialist, WWSO,...
Amazon Web Services Korea
 
From Insights to Action, How to build and maintain a Data Driven Organization...
Amazon Web Services Korea
 
[Keynote] Accelerating Business Outcomes with AWS Data - 발표자: Saeed Gharadagh...
Amazon Web Services Korea
 
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon Web Services Korea
 
코리안리 - 데이터 분석 플랫폼 구축 여정, 그 시작과 과제 - 발표자: 김석기 그룹장, 데이터비즈니스센터, 메가존클라우드 ::: AWS ...
Amazon Web Services Korea
 
LG 이노텍 - Amazon Redshift Serverless를 활용한 데이터 분석 플랫폼 혁신 과정 - 발표자: 유재상 선임, LG이노...
Amazon Web Services Korea
 
[Keynote] Data Driven Organizations with AWS Data - 발표자: Agnes Panosian, Head...
Amazon Web Services Korea
 
Ad

[D3T2S01] Amazon Aurora MySQL 메이저 버전 업그레이드 및 Amazon B/G Deployments 실습

  • 1. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Aurora Blue Green Deployment A W S D A T A & A I R O A D S H O W 2 0 2 4 박진현 Solutions Architect AWS 송정우 Solutions Architect AWS 이덕현 Database Specialist SA AWS
  • 2. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 Agenda 시작시간 종료시간 내용 9:00 9:30 Hands on Lab 환경 구성 9:30 10:00 Aurora MySQL 3 Upgrade 시 주의할 내용 10:00 11:30 Aurora Blue/Green Deployment 실습 11:30 12:00 Aurora 와 R53 을 이용한 사전 테스트 방법
  • 3. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora Blue Green Deployment Hands on Lab 환경 구성 3 박진현 Solutions Architect AWS
  • 4. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hands on Lab 링크 4 https://bit.ly/3xzP8Tc
  • 5. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 워크샵 시작 준비 5 Email one-time password (OTP) 선택한 뒤 개인 email로 인증 à 해당 계정으로 72시간 사용 가능
  • 6. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 워크샵 시작 준비 6
  • 7. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 워크샵 시작 준비 7 Blue/Green 실습을 진행하기 위해 새로운 Blue/Green 환경 구성 필요 à 10분 이상 소요되는 작업으로 미리 해당 작업 진행
  • 8. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora MySQL 3 upgrade 주의사항 (temptable , collation) 8 이덕현 Database Specialist SA AWS
  • 9. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora Temp table 인스턴스 Memory 의 ¾ 는 InnoDB Buffer 로 사용 , 나머지 ¼ 영역에서 temp 가 같이 사용 됩니다. -> 너무 큰 숫자로 설정할 경우 OOM 에 의한 Aurora 장애로 연결 될 수 있습니다. Buffer pool Reads OS Heap
  • 10. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. temptable_max_ram, temptable_max_mmap 10 MySQL 8.0, 내부 임시 테이블에 TempTable 엔진 사용 가능 • 기존 Memory 엔진은 가변 길이 타입 컬럼을 지원하지 않음 • varchar 및 varbinary 컬럼 별 최대 길이 만큼 메모리를 할당하여 비효율적인 면이 있음 • Internal_tmp_mem_storage_engine=TempTable 설정 시 • 내부 임시 테이블을 temptable_max_ram 크기만큼 메모리에서 사용 가능 • temptable_max_mmap 크기만큼 Aurora Local Storage에 메모리 매핑(MMAP) 형식의 디스크 파일 쓰기 가능 • 메모리 상 TempTable 형식의 데이터를 그대로 MMAP 파일로 전환하는 것이 오버헤드가 더 적음 • MMAP 파일 공간 한도 도달 시 Aurora Cluster(Data) Storage에 InnoDB 형식의 디스크 파일 사용 ”내부 임시 테이블 사용 쿼리” Memory {temptable_max_ram} Local Storage {temptable_max_mma p} Cluster Storage
  • 11. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. temptable_max_ram, temptable_max_mmap Aurora MySQL의 temptable_max_ram, temptable_max_mmap 기본값 temptable_max_mmap, temptable_max_ram 모두 기본 1GiB로 설정됨 메모리가 16GiB 미만인 인스턴스(T타입)에서는 temptable_max_ram 가 기본 16 MiB로 설정됨 내부 임시 테이블 사용 쿼리 실행 중, temptable_max_mmap 크기의 한계에 다다르면 에러 발생 Writer 에서는 temptable_max_mmap 크기 초과 시 Aurora Storage에 InnoDB 형식의 테이블 쓰기 가능 → 더 큰 임시 테이블 공간 사용 가능 Reader 에서는 Aurora Storage 쓰기가 불가능하여 temptable_max_mmap 크기 초과 시 위 에러 발생 11 ERROR 1114 : The table '/rdsdbdata/tmp/#sqlfd_1586_2' is full
  • 12. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 temptable_max_mmap , temptable_max_ram {DBInstanceClassMemory*1/16} -- 24xlarge --768GB show variables like '%temp%' -> ; +-----------------------------------------------+-----------------------+ | Variable_name | Value | +-----------------------------------------------+-----------------------+ | avoid_temporal_upgrade | OFF | | innodb_cleanup_temp_tablespaces_in_background | ON | | innodb_temp_data_file_path | ibtmp1:12M:autoextend | | innodb_temp_tablespaces_dir | ./ | | show_old_temporals | OFF | | temptable_max_mmap | 49846937856 | | temptable_max_ram | 49846937856 | | temptable_use_mmap | ON | +-----------------------------------------------+-----------------------+
  • 13. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS DATA & AI ROADSHOW 2024 4xlarge - 256GB MySQL [sysbench]> show variables like '%temp%'; +-----------------------------------------------+-----------------------+ | Variable_name | Value | +-----------------------------------------------+-----------------------+ | avoid_temporal_upgrade | OFF | | innodb_cleanup_temp_tablespaces_in_background | ON | | innodb_temp_data_file_path | ibtmp1:12M:autoextend | | innodb_temp_tablespaces_dir | ./ | | show_old_temporals | OFF | | temptable_max_mmap | 16407041280 | | temptable_max_ram | 16407041280 | | temptable_use_mmap | ON | +-----------------------------------------------+-----------------------+
  • 14. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 14 Aurora Character Set & Collection Aurora MySQL 2.11.4 Aurora MySQL 3.04.2
  • 15. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 15 Aurora Character Set & Collection Aurora MySQL 2.11.4 Aurora MySQL 3.04.2
  • 16. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 16 Aurora Character Set & Collection Aurora MySQL 2.11.4 Aurora MySQL 3.04.2
  • 17. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 17 Aurora Character Set & Collection Aurora MySQL 2.11.4 Aurora MySQL 3.04.2
  • 18. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora Blue Green Deployment Hands on Lab 18 박진현 Solutions Architect AWS
  • 19. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. RDS Blue/Green 배포 – 시작점 Users / Applications DB endpoint AWS Cloud Amazon RDS
  • 20. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. RDS Blue/Green 배포 – 시작점 Users / Applications DB endpoint Blue Primary Current Production AWS Cloud Amazon RDS Blue Replicas
  • 21. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. RDS Blue/Green 배포 – 임시 상태 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 • 현재 프로덕션 환경(파란색)의 미러링된 복사본을 그린 환경(향후 프로덕션)으로 생성합니다. • 파란색 기본과 녹색 기본 간의 논리적 복제 설정 • 전환 전 그린 환경에서 그린 수정, 복제본 추가/제거, 변경 사항 테스트
  • 22. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. RDS Blue/Green 배포 – 종료 상태 Users / Applications DB endpoint Green Primary Final Production AWS Cloud Green Replicas
  • 23. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Aurora Blue/Green 배포 Region Availability Zone 3 Availability Zone 1 Availability Zone 2 Aurora storage RW Users / Applications db cluster endpoint RO Source mycluster Aurora MySQL 2.10.2 (5.7) Aurora storage RO RW RO Target mycluster-green-x1234 Aurora MySQL 2.10.2 (5.7) create-blue-green-deployment RO RO RO RO switchover-blue-green-deployment delete-blue-green-deployment AVAILABLE SWITCHOVER_IN_PROGRESS SWITCHOVER_COMPLETED Source mycluster-old1 Aurora MySQL 2.10.2 (5.7) customer verification
  • 24. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Hands on Lab 링크 24 https://bit.ly/3xzP8Tc
  • 25. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Aurora와 R53을 이용한 사전 테스트 방법 25 송정우 Solutions Architect AWS
  • 26. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Contents 26 ü 사전 확인 ü 아키텍처 ü Demo
  • 27. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 사전 확인 • 만약 Secrets Manager를 사용하여 DB에 접근하고 있다면, Blue/Green Deployment를 적용할 수 없습니다. • Blue/Green Deployment를 이용하기 위해서는 binlog를 활성화시켜야 합니다. 이외의 부분들은 아래의 문서를 확인하시길 바랍니다. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/blue-green-deployments-overview.html#blue-green-deployments-limitations
  • 28. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1st 아키텍처 28 블루 서비스 타겟 그룹 ALB 태스크 … 그린 서비스 타겟 그룹 ALB 태스크 … xxx.xxx.com Blue에서 Green으로 동기화 하는 논리적 복제 블루 프라이머리 그린 프라이머리 Amazon Route 53 🌟 Read-only Traffic!
  • 29. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 29 블루 서비스 타겟 그룹 ALB 태스크 … 그린 서비스 타겟 그룹 ALB 태스크 … xxx.xxx.com Blue에서 Green으로 동기화 하는 논리적 복제 블루 프라이머리 그린 프라이머리 Amazon Route 53 100 0 Route53의 Traffic Policy를 활용
  • 30. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 30 블루 서비스 타겟 그룹 ALB 태스크 … 그린 서비스 타겟 그룹 ALB 태스크 … xxx.xxx.com Blue에서 Green으로 동기화 하는 논리적 복제 블루 프라이머리 그린 프라이머리 Amazon Route 53 90 10
  • 31. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 31 블루 서비스 타겟 그룹 ALB 태스크 … 그린 서비스 타겟 그룹 ALB 태스크 … xxx.xxx.com Blue에서 Green으로 동기화 하는 논리적 복제 블루 프라이머리 그린 프라이머리 Amazon Route 53 50 50
  • 32. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 32 블루 서비스 타겟 그룹 ALB 태스크 … 그린 서비스 타겟 그룹 ALB 태스크 … xxx.xxx.com Blue에서 Green으로 동기화 하는 논리적 복제 블루 프라이머리 그린 프라이머리 Amazon Route 53 10 90
  • 33. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 33 블루 서비스 타겟 그룹 ALB 태스크 … 그린 서비스 타겟 그룹 ALB 태스크 … xxx.xxx.com Blue에서 Green으로 동기화 하는 논리적 복제 블루 프라이머리 그린 프라이머리 Amazon Route 53 0 100
  • 34. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1st 아키텍처 주의 사항 • Read-Only 트래픽이 아니라면, 쓰기 트래픽이 나누어져 흘러 들어가기 때문에 큰 문제를 발생시킬 수 있습니다. • DB 뿐만 아니라 Application Layer에 해당 하는 세트를 한 벌 더 띄우기 때문에 비용적인 부분을 고려할 필요가 있습니다. • Route 53의 Traffic Policy로 인한 추가 비용이 발생할 수 있습니다. 즉, 위의 조건들에 의해 첫 번째 아키텍처는 다음의 상황에서 적절합니다. • 테스트를 위한 부하 발생 도구들을 활용하고 있을 때 • 테스트 트래픽을 흘려 보내 보고 싶을 때 • 완벽하게 동일한 환경에서 테스트/확인해보고 싶을 때
  • 35. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2nd Architecture 35 서비스 타겟 그룹 ALB 태스크 … Blue에서 Green으로 동기화 하는 논리적 복제 Blue Primary Green Primary 쓰기 엔드포인트 연결 읽기 엔드포인트 연결
  • 36. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2nd 아키텍처 주의 사항 즉, 위의 조건들에 의해 두 번째 아키텍처는 다음의 상황에서 적절합니다. • 사전에 이미 테스트가 진행됐을 때 • 프로덕션 레벨에서 실제 트래픽을 활용한 테스트가 필요할 때 • 애플리케이션 내 CQRS 패턴 적용 혹은 읽기/쓰기 엔드포인트가 사전에 분리되어 있어야 시도할 수 있습니다. • 만약 문제가 발생했다면, 프로덕션 레벨의 읽기에서 장애가 발생할 수 있습니다. • 테스트를 위해 애플리케이션 재배포가 필요합니다.
  • 37. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo 37
  • 38. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. 설문조사 38 더 나은 세션을 위해 설문조사에 참석해주시면 감사하겠습니다 J
  • 39. © 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! 박진현 Solutions Architect AWS 송정우 이덕현 Solutions Architect AWS Database Specialist SA AWS 39