SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
CUSTOM NON-RDS MULTI-AZ
MYSQL REPLICATION
Cloudpack Night #6
5/17/2013
ABOUT ME (@IJIN)
• Michael H. Oshita
• Japanese American
• In Japan since 2002
• Software/Infra/Cloud Engineer
• http://ijin.github.io
CERTIFIEDTODAY!
COMPONENTS
• AWSVPC (Routing-Based HA Pattern)
• MySQL Master-Slave Replication
• MHA (Master HA Manager for MySQL)
• no RDS!!
MHA
Master
Slave
Slave
Manager
Manager detects failure on master
Master
Master
Slave
Manager
MHA
Slave is promoted to master after binlogs are applied
binlog
binlog
binlog
"Starting master failover."
"* Phase 1: Configuration Check Phase..n"
"* Phase 2: Dead Master Shutdown Phase..n"
==> Delete routing table (master_ip_failover)
"* Phase 3: Master Recovery Phase..n"
"* Phase 3.1: Getting Latest Slaves Phase..n"
"* Phase 3.2: Saving Dead Master's Binlog Phase..n"
"* Phase 3.3: Determining New Master Phase..n"
==> Change routing table (master_ip_failover)
"* Phase 4: Slaves Recovery Phase..n"
MHA
FAILOVER SEQUENCE
“SHARE A PRIVATE IP ACROSS AVAILABILITY ZONES”
http://d.hatena.ne.jp/c9katayama/20111225/1324837509
#ヤマン ++
• Storage engines & distributions
• Instance types
• Fast
• Efficient
WHY NOT RDS?
→ FLEXIBILITY!!
• Percona Server (XtraDB)
• MariaDB
• TokuDB
• Mroonga
STORAGE ENGINES &
DISTRIBUTIONS
• hi1.xlarge
• m3.xlarge
• c1.xlarge
• etc.
INSTANCETYPES
• RoutingTable changes pretty quickly
• Total failover in roughly <20s (RDS takes 3-6m)
• Non-DNS based
• Apps can be configured with a single IP
• no need to worry about internal DNS problems
FAST FAILOVER
• Minimum of 2 (web+db) servers
• Warm up (replication booster)
• Fine tuning
• Server Logs
EFFECIENT
DEMO
CONSIDERATIONS
• Backups → Xtrabackup, copy binlogs to s3
• Point inTime Recovery → Automate with Chef
• Provisioning Replicas → Automate with Chef
• Some learning curve
• API backplane a SPoF
THANKYOU!

Contenu connexe

Tendances

Tendances (20)

Ansible intro
Ansible introAnsible intro
Ansible intro
 
Ansible basics workshop
Ansible basics workshopAnsible basics workshop
Ansible basics workshop
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
 
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
 
Using Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud EnvironmentsUsing Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud Environments
 
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Network Automation with Ansible
Network Automation with AnsibleNetwork Automation with Ansible
Network Automation with Ansible
 
Ansible for beginners ...?
Ansible for beginners ...?Ansible for beginners ...?
Ansible for beginners ...?
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
 
Cyansible
CyansibleCyansible
Cyansible
 
Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)Automate with Ansible basic (2/e, English)
Automate with Ansible basic (2/e, English)
 

En vedette

Aws lambda-beware-of-escapes
Aws lambda-beware-of-escapesAws lambda-beware-of-escapes
Aws lambda-beware-of-escapes
Michael H. Oshita
 
JAWS-UG函館 S3とCloudFrontを利用してWebサイトの性能向上
JAWS-UG函館 S3とCloudFrontを利用してWebサイトの性能向上JAWS-UG函館 S3とCloudFrontを利用してWebサイトの性能向上
JAWS-UG函館 S3とCloudFrontを利用してWebサイトの性能向上
Hiroshi Koyama
 
EC2でkeepalived+LVS(DSR)
EC2でkeepalived+LVS(DSR)EC2でkeepalived+LVS(DSR)
EC2でkeepalived+LVS(DSR)
Sugawara Genki
 
VietRees_Newsletter_51_Tuan1_Thang10
VietRees_Newsletter_51_Tuan1_Thang10VietRees_Newsletter_51_Tuan1_Thang10
VietRees_Newsletter_51_Tuan1_Thang10
internationalvr
 
Jardines 16908
Jardines 16908Jardines 16908
Jardines 16908
Marinesita
 
Diktatoren, Twitteraccounts und SOLIDes Design
Diktatoren, Twitteraccounts und SOLIDes DesignDiktatoren, Twitteraccounts und SOLIDes Design
Diktatoren, Twitteraccounts und SOLIDes Design
Bernd Schiffer
 

En vedette (20)

Aws lambda-beware-of-escapes
Aws lambda-beware-of-escapesAws lambda-beware-of-escapes
Aws lambda-beware-of-escapes
 
MHA, Murakumo & Me
MHA, Murakumo & MeMHA, Murakumo & Me
MHA, Murakumo & Me
 
JAWS-UG函館 S3とCloudFrontを利用してWebサイトの性能向上
JAWS-UG函館 S3とCloudFrontを利用してWebサイトの性能向上JAWS-UG函館 S3とCloudFrontを利用してWebサイトの性能向上
JAWS-UG函館 S3とCloudFrontを利用してWebサイトの性能向上
 
Jaws ug青森 第1回勉強会 「awsと野菜と私」
Jaws ug青森 第1回勉強会 「awsと野菜と私」Jaws ug青森 第1回勉強会 「awsと野菜と私」
Jaws ug青森 第1回勉強会 「awsと野菜と私」
 
20130519 JAWS-UG青森 美人CDP/CDP男子「も」2.0へ
20130519 JAWS-UG青森 美人CDP/CDP男子「も」2.0へ20130519 JAWS-UG青森 美人CDP/CDP男子「も」2.0へ
20130519 JAWS-UG青森 美人CDP/CDP男子「も」2.0へ
 
20130520 実例で見るAWSの特徴と活用方法@JAWS-UG青森 第1回勉強会
20130520 実例で見るAWSの特徴と活用方法@JAWS-UG青森 第1回勉強会20130520 実例で見るAWSの特徴と活用方法@JAWS-UG青森 第1回勉強会
20130520 実例で見るAWSの特徴と活用方法@JAWS-UG青森 第1回勉強会
 
Puppet on AWS
Puppet on AWSPuppet on AWS
Puppet on AWS
 
クラウドで管理する手作り育苗ハウスのつくり方
クラウドで管理する手作り育苗ハウスのつくり方クラウドで管理する手作り育苗ハウスのつくり方
クラウドで管理する手作り育苗ハウスのつくり方
 
EC2でkeepalived+LVS(DSR)
EC2でkeepalived+LVS(DSR)EC2でkeepalived+LVS(DSR)
EC2でkeepalived+LVS(DSR)
 
VietRees_Newsletter_51_Tuan1_Thang10
VietRees_Newsletter_51_Tuan1_Thang10VietRees_Newsletter_51_Tuan1_Thang10
VietRees_Newsletter_51_Tuan1_Thang10
 
HAProxyでMySQL HA on Amazon EC2
HAProxyでMySQL HA on Amazon EC2HAProxyでMySQL HA on Amazon EC2
HAProxyでMySQL HA on Amazon EC2
 
Jardines 16908
Jardines 16908Jardines 16908
Jardines 16908
 
Diktatoren, Twitteraccounts und SOLIDes Design
Diktatoren, Twitteraccounts und SOLIDes DesignDiktatoren, Twitteraccounts und SOLIDes Design
Diktatoren, Twitteraccounts und SOLIDes Design
 
Tetalab
TetalabTetalab
Tetalab
 
How to Piss Off Your Pair at LAST Conference 2015
How to Piss Off Your Pair at LAST Conference 2015How to Piss Off Your Pair at LAST Conference 2015
How to Piss Off Your Pair at LAST Conference 2015
 
REST化的工作流
REST化的工作流REST化的工作流
REST化的工作流
 
Scrummaster Needed Desperately at 2016 Scrum Australia
Scrummaster Needed Desperately at 2016 Scrum AustraliaScrummaster Needed Desperately at 2016 Scrum Australia
Scrummaster Needed Desperately at 2016 Scrum Australia
 
Concrete Experimentation in Agile Environments at Agile Australia 2015
Concrete Experimentation in Agile Environments at Agile Australia 2015Concrete Experimentation in Agile Environments at Agile Australia 2015
Concrete Experimentation in Agile Environments at Agile Australia 2015
 
Always Run A Changing System
Always Run A Changing SystemAlways Run A Changing System
Always Run A Changing System
 
004
004004
004
 

Similaire à Custom Non-RDS Multi-AZ Mysql Replication

MHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirksMHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirks
Colin Charles
 
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Lenz Grimmer
 
Infrastructure review - Shining a light on the Black Box
Infrastructure review - Shining a light on the Black BoxInfrastructure review - Shining a light on the Black Box
Infrastructure review - Shining a light on the Black Box
Miklos Szel
 
N:1 Replication meets MHA
N:1 Replication meets MHAN:1 Replication meets MHA
N:1 Replication meets MHA
do_aki
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
Lenz Grimmer
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
Louis liu
 

Similaire à Custom Non-RDS Multi-AZ Mysql Replication (20)

OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...
OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...
OSDC 2014: Colin Charles - Automated MySQL failover with MHA: getting started...
 
Has MySQL grown up?
Has MySQL grown up?Has MySQL grown up?
Has MySQL grown up?
 
Mysql replication @ gnugroup
Mysql replication @ gnugroupMysql replication @ gnugroup
Mysql replication @ gnugroup
 
MHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirksMHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirks
 
MySQL Spider Architecture
MySQL Spider ArchitectureMySQL Spider Architecture
MySQL Spider Architecture
 
Spider Setup with AWS/sandbox
Spider Setup with AWS/sandboxSpider Setup with AWS/sandbox
Spider Setup with AWS/sandbox
 
OSDC 2017 | Lessons from database failures by Colin Charles
OSDC 2017 | Lessons from database failures by Colin CharlesOSDC 2017 | Lessons from database failures by Colin Charles
OSDC 2017 | Lessons from database failures by Colin Charles
 
Replatforming Legacy Packaged Applications: Block-by-Block with Minecraft
Replatforming Legacy Packaged Applications: Block-by-Block with MinecraftReplatforming Legacy Packaged Applications: Block-by-Block with Minecraft
Replatforming Legacy Packaged Applications: Block-by-Block with Minecraft
 
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
 
视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)
 
Lessons from database failures
Lessons from database failures Lessons from database failures
Lessons from database failures
 
Automated MySQL failover with MHA: Getting started & moving past its quirks
Automated MySQL failover with MHA: Getting started & moving past its quirksAutomated MySQL failover with MHA: Getting started & moving past its quirks
Automated MySQL failover with MHA: Getting started & moving past its quirks
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Infrastructure review - Shining a light on the Black Box
Infrastructure review - Shining a light on the Black BoxInfrastructure review - Shining a light on the Black Box
Infrastructure review - Shining a light on the Black Box
 
N:1 Replication meets MHA
N:1 Replication meets MHAN:1 Replication meets MHA
N:1 Replication meets MHA
 
Galera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replicationGalera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replication
 
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's ToolchestMaking MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Custom Non-RDS Multi-AZ Mysql Replication