SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
https://www.facebook.com/groups/hkmysqlusergroup/
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication Deep Dive
马楚成 (Ivan Ma)
ivan-cs.ma@oracle.com
2017-06-10
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
22y
Constant improvements of MySQL as
a relational database.
3
JSON Functions
Stored Procedures
Async Replication
Semi-Sync Replication
Group Replication
Foreign Keys
Performance Schema
Multi-Triggers
Partitioning
Sub-queriesDocument Store
Prepared Statements
R-Trees
B-Trees
Row-based Replication
Plugin API
Event Scheduler
Unicode
Full-Text Search
Enterprise Monitor
WorkbenchInnoDB
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 4
Scale-Out
High Performance
Ease-of-Use
Built-in HA
Out-of-Box Solution
Everything Integrated
MySQL
InnoDB
cluster
GA
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL Shell
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL InnoDB Cluster: High Level Architecture
MySQL
InnoDB
cluster MySQL Enterprise Monitor
…
5
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL InnoDB Cluster: Internal Architecture
M
M M
MySQL Connector
Application
MySQL Router
MySQL Connector
Application
MySQL Router
MySQL Shell
HA
Group Replication
6
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
InnoDB Cluster
7
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
“High Availability becomes a core
first class feature of MySQL!”
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL
Group Replication
Natively distributed and highly available replica sets
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Group Replication: What Is It?
• Group Replication library
– Implementation of Replicated Database State Machine
theory
• MySQL GCS is based on our home-grown Paxos implementation
– Provides virtually synchronous replication for MySQL 5.7+
• Guarantees eventual consistency
– Supported on all MySQL platforms
• Linux, Windows, Solaris, OSX, FreeBSD
“Multi-master update anywhere replication plugin for MySQL with
built-in conflict detection and resolution, automatic distributed
recovery, and group membership.”
9
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 10
MySQL Server: Full Stack
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Server: Group Replication Plugin
• The plugin is responsible for
– Maintaining distributed execution context
– Detecting and handling conflicts
– Handling distributed recovery
• Detect membership changes
• Donate state if needed
• Collect state if needed
– Proposing transactions to other members
– Receiving and handling transactions from other
members
– Deciding the ultimate fate of transactions
• commit or rollback
11
GCS API
Replication
Plugin
Plugin API
MySQL
Server
Group Comm.
System (Corosync)
Group Com. Engine
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Server: GCS
• The communication API (and binding) is
responsible for:
– Abstracting the underlying group communication
system implementation from the plugin itself
– Mapping the interface to a specific group
communication system implementation
• The Group Communication System engine:
– Variant of Paxos developed at MySQL
– Building block to provide distributed agreement
between servers
12
GCS API
Replication
Plugin
Plugin API
MySQL
Server
Group Comm.
System (Corosync)
Group Com. Engine
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Router
Transparent application connection routing
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Router
• Transparent client connection routing
– Load balancing
– Application connection failover
• Stateless design offers easy HA client routing
– A local Router becomes part of the application stack
”MySQL Router allows you to easily migrate your standalone MySQL
instances to natively distributed and highly available InnoDB clusters
without affecting existing applications!”
14
Transparent access to HA databases for MySQL Applications
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Router: 2.1
• Native support for InnoDB clusters
– Understands Group Replication topology
– Utilizes metadata schema stored on each member
• Bootstraps itself and sets up client routing for the InnoDB cluster
• Allows for intelligent client routing into the InnoDB cluster
– Supports multi-master and single primary modes
• Core improvements
– Built-in keyring for easy and secure password management
15
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
”MySQL Router 2.1, with the new metadata_cache plugin, provides
transparent client connection routing and failover into your InnoDB clusters!”
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
Single tool for development, setup,
management, orchestration, and monitoring
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
17
A single unified client for all administrative and operations tasks
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
• Multi-Language: JavaScript, Python, and SQL
– Naturally scriptable
• Supports both Document and Relational models
• Exposes full Development and Admin API
”MySQL Shell provides the developer and DBA with a single intuitive,
flexible, and powerful interface for all MySQL related tasks!”
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell: Admin API
• mysql-js> dba.help()
• The global variable 'dba' is used to access the
MySQL AdminAPI
• Perform DBA operations
– Manage MySQL InnoDB clusters
• Create clusters
• Validate MySQL instances
• Configure MySQL instances
• Get cluster info
• Modify clusters
Database Administration Interface
App Servers with
MySQL Router
MySQL Group Replication
MySQL Shell
Setup, Manage,
Orchestrate
18
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Enterprise Monitor
• Native holistic support for Group Replication / InnoDB clusters (GA in 3.4!)
– Topology views
– Detailed metrics and graphs
– Best Practice advice
19
GA
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
More …
Saturday, December 10, 2016
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Demonstration
21
MySQL Shell
MySQL
InnoDB
cluster
Wordpress
MySQL MySQL MySQL
MySQL
Router
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
22
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell – dba.help();
23
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell – dba.help(‘deploySandboxInstance’);
• dba.deploySandboxInstance(‘3310’);
24
mysql-js> dba.deploySandboxInstance(3310);
A new MySQL sandbox instance will be created on this host in
/home/mysql/mysql-sandboxes/3310
Please enter a MySQL root password for the new instance:
Deploying new MySQL instance...
Instance localhost:3310 successfully deployed and started.
Use shell.connect('root@localhost:3310'); to connect to the instance.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Adding more MySQL Instances
• dba.deploySandboxInstance(3310);
• dba.deploySandboxInstance(3320);
• dba.deploySandboxInstance(3330);
25
mysql-js> dba.checkInstanceConfiguration(3310);
Invalid connection options, expected either a URI or a Dictionary (ArgumentError)
mysql-js> dba.checkInstanceConfiguration('localhost:3310');
Please provide the password for 'root@localhost:3310':
Validating instance...
The instance 'localhost:3310' is valid for Cluster usage
{
"status": "ok"
}
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
Creating the MySQL InnoDB Cluster
• Connecting to Live Instance e.g. mysql-js>connect localhost:3310
• Creating the Cluster e.g. mysql-js>var cluster = dba.createCluster(‘mycluster’)
26
mysql-js> c localhost:3310
Creating a Session to 'root@localhost:3310'
Enter password:
Classic Session successfully established. No default schema selected.
mysql-js> var cluster = dba.createCluster('mycluster');
A new InnoDB cluster will be created on instance 'root@localhost:3310'.
Creating InnoDB cluster 'mycluster' on 'root@localhost:3310'...
Adding Seed Instance...
Cluster successfully created. Use Cluster.addInstance() to add MySQL instances.
At least 3 instances are needed for the cluster to be able to withstand up to
one server failure.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
Checking Cluster’s status and adding new members to the Cluster
27
mysql-js> cluster.addInstance('localhost:3320');
A new instance will be added to the InnoDB cluster. Depending on the
amount of
data on the cluster this might take from a few seconds to several hours.
Please provide the password for 'root@localhost:3320':
Adding instance to the cluster ...
The instance 'root@localhost:3320' was successfully added to the
cluster.
mysql-js> cluster.addInstance('localhost:3330');
A new instance will be added to the InnoDB cluster. Depending on the
amount of
data on the cluster this might take from a few seconds to several hours.
Please provide the password for 'root@localhost:3330':
Adding instance to the cluster ...
The instance 'root@localhost:3330' was successfully added to the
cluster.
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 28
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
MySQL Shell
dba.configureLocalInstance(uri)
29
mysql-js> dba.configureLocalInstance('localhost:3310');
Please provide the password for 'root@localhost:3310':
Detected as sandbox instance.
Validating MySQL configuration file at: /home/mysql/mysql-
sandboxes/3310/my.cnf
Validating instance...
The instance 'localhost:3310' is valid for Cluster usage
You can now use it in an InnoDB Cluster.
{
"status": "ok"
}
mysql-js> dba.configureLocalInstance('localhost:3320');
Please provide the password for 'root@localhost:3320':
Detected as sandbox instance.
Validating MySQL configuration file at: /home/mysql/mysql-
sandboxes/3320/my.cnf
Validating instance...
The instance 'localhost:3320' is valid for Cluster usage
You can now use it in an InnoDB Cluster.
{
"status": "ok"
}
mysql-js>
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
SandboxInstances
• E.g. MySQL configuration file : /home/mysql/mysql-sandboxes/3310/my.cnf
• dba.configureLocalInstance(uri)
– [mysql@virtual-41 3310]$ ll my.cnf*
– -rw------- 1 mysql mysql 2376 May 31 17:04 my.cnf
– -rw-rw-r-- 1 mysql mysql 882 May 31 17:04 my.cnf.20170531-170412
30
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
Persist configuration - dba.configureLocalInstance(uri)
31
Copyright © 2017, Oracle and/or its affiliates. All rights reserved. |
https://www.facebook.com/groups/hkmysqlusergroup/
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Questions
Thank You

Weitere ähnliche Inhalte

Was ist angesagt?

Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesOracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Sven Sandberg
 

Was ist angesagt? (20)

MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterMySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
 
MySQL for Software-as-a-Service (SaaS)
MySQL for Software-as-a-Service (SaaS)MySQL for Software-as-a-Service (SaaS)
MySQL for Software-as-a-Service (SaaS)
 
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio  in a nutshell - MySQL InnoDB ClusterMySQL Group Replicatio  in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB Cluster
 
MySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The DolphinMySQL Day Paris 2016 - State Of The Dolphin
MySQL Day Paris 2016 - State Of The Dolphin
 
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesOracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group Replication
 
High Availability in MySQL 8 using InnoDB Cluster
High Availability in MySQL 8 using InnoDB ClusterHigh Availability in MySQL 8 using InnoDB Cluster
High Availability in MySQL 8 using InnoDB Cluster
 
replic8 - Replication in MySQL 8
replic8 - Replication in MySQL 8replic8 - Replication in MySQL 8
replic8 - Replication in MySQL 8
 
MySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA ToolMySQL Shell - The Best MySQL DBA Tool
MySQL Shell - The Best MySQL DBA Tool
 
Everything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group ReplicationEverything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group Replication
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an Overview
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
 
Conference slides: MySQL Cluster Performance Tuning
Conference slides: MySQL Cluster Performance TuningConference slides: MySQL Cluster Performance Tuning
Conference slides: MySQL Cluster Performance Tuning
 
MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015MySQL 5.7: What's New, Nov. 2015
MySQL 5.7: What's New, Nov. 2015
 
MySQL Cloud Service Deep Dive
MySQL Cloud Service Deep DiveMySQL Cloud Service Deep Dive
MySQL Cloud Service Deep Dive
 
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
My sql 56_roadmap_april2012
My sql 56_roadmap_april2012My sql 56_roadmap_april2012
My sql 56_roadmap_april2012
 

Andere mochten auch

Capturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLCapturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQL
Ronald Bradford
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
Ronald Bradford
 

Andere mochten auch (20)

淘宝数据库架构演进历程
淘宝数据库架构演进历程淘宝数据库架构演进历程
淘宝数据库架构演进历程
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Capturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQLCapturing, Analyzing and Optimizing MySQL
Capturing, Analyzing and Optimizing MySQL
 
Inno db internals innodb file formats and source code structure
Inno db internals innodb file formats and source code structureInno db internals innodb file formats and source code structure
Inno db internals innodb file formats and source code structure
 
Extensible Data Modeling
Extensible Data ModelingExtensible Data Modeling
Extensible Data Modeling
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
 
MySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD TourMySQL Best Practices - OTN LAD Tour
MySQL Best Practices - OTN LAD Tour
 
Mysql high availability and scalability
Mysql high availability and scalabilityMysql high availability and scalability
Mysql high availability and scalability
 
Мониторинг и отладка MySQL: максимум информации при минимальных потерях
Мониторинг и отладка MySQL: максимум информации при минимальных потеряхМониторинг и отладка MySQL: максимум информации при минимальных потерях
Мониторинг и отладка MySQL: максимум информации при минимальных потерях
 
MySQL Backup and Recovery Essentials
MySQL Backup and Recovery EssentialsMySQL Backup and Recovery Essentials
MySQL Backup and Recovery Essentials
 
Explain
ExplainExplain
Explain
 
Java MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & OptimizationJava MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & Optimization
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
 
MySQL Server Defaults
MySQL Server DefaultsMySQL Server Defaults
MySQL Server Defaults
 
Advanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteAdvanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suite
 
2010丹臣的思考
2010丹臣的思考2010丹臣的思考
2010丹臣的思考
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication SetupsMix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
 
Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1
 
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
MySQL Storage Engines - which do you use? TokuDB? MyRocks? InnoDB?
 

Ähnlich wie MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017

Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
Tarique Saleem
 

Ähnlich wie MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017 (20)

MySQL InnoDB Cluster - Meetup Oracle MySQL / AFUP Paris
MySQL InnoDB Cluster - Meetup Oracle MySQL / AFUP ParisMySQL InnoDB Cluster - Meetup Oracle MySQL / AFUP Paris
MySQL InnoDB Cluster - Meetup Oracle MySQL / AFUP Paris
 
MySQL InnoDB Cluster: High Availability Made Easy!
MySQL InnoDB Cluster: High Availability Made Easy!MySQL InnoDB Cluster: High Availability Made Easy!
MySQL InnoDB Cluster: High Availability Made Easy!
 
20191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv120191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv1
 
20190817 coscup-oracle my sql innodb cluster sharing
20190817 coscup-oracle my sql innodb cluster sharing20190817 coscup-oracle my sql innodb cluster sharing
20190817 coscup-oracle my sql innodb cluster sharing
 
My sql8 innodb_cluster
My sql8 innodb_clusterMy sql8 innodb_cluster
My sql8 innodb_cluster
 
20200613 my sql-ha-deployment
20200613 my sql-ha-deployment20200613 my sql-ha-deployment
20200613 my sql-ha-deployment
 
MySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e Uber
 
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 
Sunshine php my sql 8.0 v2
Sunshine php my sql 8.0 v2Sunshine php my sql 8.0 v2
Sunshine php my sql 8.0 v2
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdl
 
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
 
MySQL HA
MySQL HAMySQL HA
MySQL HA
 
InnoDb Vs NDB Cluster
InnoDb Vs NDB ClusterInnoDb Vs NDB Cluster
InnoDb Vs NDB Cluster
 
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
MySQL in Oracle environment : Quick start guide for Oracle DBA (Part 1)
 
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
MySQL Day Paris 2018 - MySQL InnoDB Cluster; A complete High Availability sol...
 
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
MySQL Shell: the daily tool for devs and admins. By Vittorio Cioe.
 
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
MySQL in oracle_environments(Part 2): MySQL Enterprise Monitor & Oracle Enter...
 
MySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & DemoMySQL InnoDB Cluster HA Overview & Demo
MySQL InnoDB Cluster HA Overview & Demo
 

Mehr von Ivan Ma

01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1
Ivan Ma
 

Mehr von Ivan Ma (13)

Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
 
20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell
 
20190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev220190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev2
 
20180420 hk-the powerofmysql8
20180420 hk-the powerofmysql820180420 hk-the powerofmysql8
20180420 hk-the powerofmysql8
 
20171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v120171104 hk-py con-mysql-documentstore_v1
20171104 hk-py con-mysql-documentstore_v1
 
20161029 py con-mysq-lv3
20161029 py con-mysq-lv320161029 py con-mysq-lv3
20161029 py con-mysq-lv3
 
20160821 coscup-my sql57docstorelab01
20160821 coscup-my sql57docstorelab0120160821 coscup-my sql57docstorelab01
20160821 coscup-my sql57docstorelab01
 
Hkosc group replication-lecture_lab07
Hkosc group replication-lecture_lab07Hkosc group replication-lecture_lab07
Hkosc group replication-lecture_lab07
 
20151010 my sq-landjavav2a
20151010 my sq-landjavav2a20151010 my sq-landjavav2a
20151010 my sq-landjavav2a
 
01 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv101 demystifying mysq-lfororacledbaanddeveloperv1
01 demystifying mysq-lfororacledbaanddeveloperv1
 
Exploring mysql cluster 7.4
Exploring mysql cluster 7.4Exploring mysql cluster 7.4
Exploring mysql cluster 7.4
 
20150110 my sql-performanceschema
20150110 my sql-performanceschema20150110 my sql-performanceschema
20150110 my sql-performanceschema
 
20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx20141011 my sql clusterv01pptx
20141011 my sql clusterv01pptx
 

Kürzlich hochgeladen

Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
amilabibi1
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
raffaeleoman
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 

Kürzlich hochgeladen (18)

AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verifiedSector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
Sector 62, Noida Call girls :8448380779 Noida Escorts | 100% verified
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
Aesthetic Colaba Mumbai Cst Call girls 📞 7738631006 Grant road Call Girls ❤️-...
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 

MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017

  • 1. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | https://www.facebook.com/groups/hkmysqlusergroup/
  • 2. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication Deep Dive 马楚成 (Ivan Ma) ivan-cs.ma@oracle.com 2017-06-10
  • 3. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 22y Constant improvements of MySQL as a relational database. 3 JSON Functions Stored Procedures Async Replication Semi-Sync Replication Group Replication Foreign Keys Performance Schema Multi-Triggers Partitioning Sub-queriesDocument Store Prepared Statements R-Trees B-Trees Row-based Replication Plugin API Event Scheduler Unicode Full-Text Search Enterprise Monitor WorkbenchInnoDB
  • 4. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 4 Scale-Out High Performance Ease-of-Use Built-in HA Out-of-Box Solution Everything Integrated MySQL InnoDB cluster GA
  • 5. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MySQL Shell MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MySQL InnoDB Cluster: High Level Architecture MySQL InnoDB cluster MySQL Enterprise Monitor … 5
  • 6. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL InnoDB Cluster: Internal Architecture M M M MySQL Connector Application MySQL Router MySQL Connector Application MySQL Router MySQL Shell HA Group Replication 6
  • 7. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | InnoDB Cluster 7 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate “High Availability becomes a core first class feature of MySQL!”
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication Natively distributed and highly available replica sets
  • 9. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Group Replication: What Is It? • Group Replication library – Implementation of Replicated Database State Machine theory • MySQL GCS is based on our home-grown Paxos implementation – Provides virtually synchronous replication for MySQL 5.7+ • Guarantees eventual consistency – Supported on all MySQL platforms • Linux, Windows, Solaris, OSX, FreeBSD “Multi-master update anywhere replication plugin for MySQL with built-in conflict detection and resolution, automatic distributed recovery, and group membership.” 9 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate
  • 10. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 10 MySQL Server: Full Stack
  • 11. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Server: Group Replication Plugin • The plugin is responsible for – Maintaining distributed execution context – Detecting and handling conflicts – Handling distributed recovery • Detect membership changes • Donate state if needed • Collect state if needed – Proposing transactions to other members – Receiving and handling transactions from other members – Deciding the ultimate fate of transactions • commit or rollback 11 GCS API Replication Plugin Plugin API MySQL Server Group Comm. System (Corosync) Group Com. Engine
  • 12. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Server: GCS • The communication API (and binding) is responsible for: – Abstracting the underlying group communication system implementation from the plugin itself – Mapping the interface to a specific group communication system implementation • The Group Communication System engine: – Variant of Paxos developed at MySQL – Building block to provide distributed agreement between servers 12 GCS API Replication Plugin Plugin API MySQL Server Group Comm. System (Corosync) Group Com. Engine
  • 13. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Router Transparent application connection routing
  • 14. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Router • Transparent client connection routing – Load balancing – Application connection failover • Stateless design offers easy HA client routing – A local Router becomes part of the application stack ”MySQL Router allows you to easily migrate your standalone MySQL instances to natively distributed and highly available InnoDB clusters without affecting existing applications!” 14 Transparent access to HA databases for MySQL Applications App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate
  • 15. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Router: 2.1 • Native support for InnoDB clusters – Understands Group Replication topology – Utilizes metadata schema stored on each member • Bootstraps itself and sets up client routing for the InnoDB cluster • Allows for intelligent client routing into the InnoDB cluster – Supports multi-master and single primary modes • Core improvements – Built-in keyring for easy and secure password management 15 App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate ”MySQL Router 2.1, with the new metadata_cache plugin, provides transparent client connection routing and failover into your InnoDB clusters!”
  • 16. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | MySQL Shell Single tool for development, setup, management, orchestration, and monitoring
  • 17. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Shell 17 A single unified client for all administrative and operations tasks App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate • Multi-Language: JavaScript, Python, and SQL – Naturally scriptable • Supports both Document and Relational models • Exposes full Development and Admin API ”MySQL Shell provides the developer and DBA with a single intuitive, flexible, and powerful interface for all MySQL related tasks!”
  • 18. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Shell: Admin API • mysql-js> dba.help() • The global variable 'dba' is used to access the MySQL AdminAPI • Perform DBA operations – Manage MySQL InnoDB clusters • Create clusters • Validate MySQL instances • Configure MySQL instances • Get cluster info • Modify clusters Database Administration Interface App Servers with MySQL Router MySQL Group Replication MySQL Shell Setup, Manage, Orchestrate 18
  • 19. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Enterprise Monitor • Native holistic support for Group Replication / InnoDB clusters (GA in 3.4!) – Topology views – Detailed metrics and graphs – Best Practice advice 19 GA
  • 20. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | More … Saturday, December 10, 2016
  • 21. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Demonstration 21 MySQL Shell MySQL InnoDB cluster Wordpress MySQL MySQL MySQL MySQL Router
  • 22. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Shell 22
  • 23. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Shell – dba.help(); 23
  • 24. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Shell – dba.help(‘deploySandboxInstance’); • dba.deploySandboxInstance(‘3310’); 24 mysql-js> dba.deploySandboxInstance(3310); A new MySQL sandbox instance will be created on this host in /home/mysql/mysql-sandboxes/3310 Please enter a MySQL root password for the new instance: Deploying new MySQL instance... Instance localhost:3310 successfully deployed and started. Use shell.connect('root@localhost:3310'); to connect to the instance.
  • 25. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Adding more MySQL Instances • dba.deploySandboxInstance(3310); • dba.deploySandboxInstance(3320); • dba.deploySandboxInstance(3330); 25 mysql-js> dba.checkInstanceConfiguration(3310); Invalid connection options, expected either a URI or a Dictionary (ArgumentError) mysql-js> dba.checkInstanceConfiguration('localhost:3310'); Please provide the password for 'root@localhost:3310': Validating instance... The instance 'localhost:3310' is valid for Cluster usage { "status": "ok" }
  • 26. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Shell Creating the MySQL InnoDB Cluster • Connecting to Live Instance e.g. mysql-js>connect localhost:3310 • Creating the Cluster e.g. mysql-js>var cluster = dba.createCluster(‘mycluster’) 26 mysql-js> c localhost:3310 Creating a Session to 'root@localhost:3310' Enter password: Classic Session successfully established. No default schema selected. mysql-js> var cluster = dba.createCluster('mycluster'); A new InnoDB cluster will be created on instance 'root@localhost:3310'. Creating InnoDB cluster 'mycluster' on 'root@localhost:3310'... Adding Seed Instance... Cluster successfully created. Use Cluster.addInstance() to add MySQL instances. At least 3 instances are needed for the cluster to be able to withstand up to one server failure.
  • 27. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Shell Checking Cluster’s status and adding new members to the Cluster 27 mysql-js> cluster.addInstance('localhost:3320'); A new instance will be added to the InnoDB cluster. Depending on the amount of data on the cluster this might take from a few seconds to several hours. Please provide the password for 'root@localhost:3320': Adding instance to the cluster ... The instance 'root@localhost:3320' was successfully added to the cluster. mysql-js> cluster.addInstance('localhost:3330'); A new instance will be added to the InnoDB cluster. Depending on the amount of data on the cluster this might take from a few seconds to several hours. Please provide the password for 'root@localhost:3330': Adding instance to the cluster ... The instance 'root@localhost:3330' was successfully added to the cluster.
  • 28. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | 28
  • 29. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | MySQL Shell dba.configureLocalInstance(uri) 29 mysql-js> dba.configureLocalInstance('localhost:3310'); Please provide the password for 'root@localhost:3310': Detected as sandbox instance. Validating MySQL configuration file at: /home/mysql/mysql- sandboxes/3310/my.cnf Validating instance... The instance 'localhost:3310' is valid for Cluster usage You can now use it in an InnoDB Cluster. { "status": "ok" } mysql-js> dba.configureLocalInstance('localhost:3320'); Please provide the password for 'root@localhost:3320': Detected as sandbox instance. Validating MySQL configuration file at: /home/mysql/mysql- sandboxes/3320/my.cnf Validating instance... The instance 'localhost:3320' is valid for Cluster usage You can now use it in an InnoDB Cluster. { "status": "ok" } mysql-js>
  • 30. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | SandboxInstances • E.g. MySQL configuration file : /home/mysql/mysql-sandboxes/3310/my.cnf • dba.configureLocalInstance(uri) – [mysql@virtual-41 3310]$ ll my.cnf* – -rw------- 1 mysql mysql 2376 May 31 17:04 my.cnf – -rw-rw-r-- 1 mysql mysql 882 May 31 17:04 my.cnf.20170531-170412 30
  • 31. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | Persist configuration - dba.configureLocalInstance(uri) 31
  • 32. Copyright © 2017, Oracle and/or its affiliates. All rights reserved. | https://www.facebook.com/groups/hkmysqlusergroup/
  • 33. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Questions Thank You