Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
MySQL User Camp : MySQL-Router
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
MySQL Router
Prasad Vasudevan
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 3
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole discretion of Oracle.
Program
Agenda
Introduction to MySQL Router
Connection Routing
InnoDB Cluster
Metadata cache Routing
Demo
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 4
Program
Agenda
Introduction to MySQL Router
Connection Routing
InnoDB Cluster
Metadata cache Routing
Demo
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 5
MySQL Router: Need ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 6
•High availability
– On server failure, the application should connect to proper server
– Not desirable for the application to handle this
• Load balancing
– In a HA system, efficiency is increased using more resources
– Helps to handle traffic properly
MySQL Router: Key Features
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 7
•Provides transparent routing between application and
backend MySQL servers
•Pluggable Architecture
– Allows MySQL developers to easily extend the product with
additional features
– Allows users to create their own custom plugins
•Provides High availability and Load balancing
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 8
Program
Agenda
Introduction to MySQL Router
Connection Routing
InnoDB Cluster
Metadata cache Routing
Demo
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 9
Connection Routing
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 10
• Forwards MySQL packets to backend server without
inspecting or modifying them
• Achieved with routing plugin
• Routing strategy :
– First available
– Round robin
Connection Routing : Example
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 11
Connection Routing : Configuration
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 12
Connection Routing : Start Routing
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 13
Program
Agenda
Introduction to MySQL Router
Connection Routing
InnoDB Cluster
Metadata cache Routing
Demo
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 14
InnoDB Cluster : Introduction
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15
• Provides complete HA solution for MySQL
• MySQL Shell enables to easily configure and administer MySQL
server instances to function as an InnoDB Cluster
• Servers run MySQL Group Replication :
– Replicate data
– Built-in failover
InnoDB Cluster : How to ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 16
• MySQL Shell includes Admin API which is accessed through the
dba global variable and its associated methods
• The methods allow to deploy, configure and administer InnoDB
clusters
• Shell provides two scripting language modes, JavaScript and
Python, in addition to SQL mode
– Default mode : JavaScript
– Switch modes issuing js , py, sql
InnoDB Cluster : How to ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 17
InnoDB Cluster : How to ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 18
InnoDB Cluster : Overview
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
Program
Agenda
Introduction to MySQL Router
Connection Routing
InnoDB Cluster
Metadata cache Routing
Demo
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 20
Metadata cache Routing : Introduction
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 21
• Provides transparent client routing, load balancing and failover
to InnoDB clusters
• Achieved with metadata_cache plugin
• Router uses metadata_cache plugin to retrieve InnoDB cluster’s
metadata periodically
•In the event of server failure, cluster adjusts the topology and
Router detects this change
Metadata cache Routing : How to ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 22
• Using --bootstrap option, Router retrieves the InnoDB cluster
metadata and automatically creates a configuration file
• Generated Router configuration by default creates TCP ports which
can be used to connect to cluster
• Additionally, sockets to connect, can be created using
--conf-use-sockets option while bootstrapping
• Ports, Sockets for both MySQL Protocol and X Protocol created
Metadata cache Routing : Configuration
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 23
• Bootstrap example :
•Configuration file generated is automatically generated at
/home/prasad/dir/mysqlrouter.conf
Metadata cache Routing : Configuration
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 24
Metadata cache Routing : Configuration
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 25
Metadata cache Routing : Configuration
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 26
Metadata cache Routing : Start Routing
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 27
Metadata cache Routing : Key Features
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 28
• User doesn’t need to be aware of the topology information and
details of all servers
• Routing will be proper :
– In the event of failover
– When new servers get added to the cluster
Program
Agenda
Introduction to MySQL Router
Connection Routing
InnoDB Cluster
Metadata cache Routing
Demo
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 29
THANK YOU!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 30
MySQL User Camp : MySQL-Router

More Related Content

MySQL User Camp : MySQL-Router

  • 2. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | MySQL Router Prasad Vasudevan Copyright © 2016, Oracle and/or its affiliates. All rights reserved.
  • 3. Safe Harbor Statement Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 3 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. Program Agenda Introduction to MySQL Router Connection Routing InnoDB Cluster Metadata cache Routing Demo 1 2 3 4 5 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 4
  • 5. Program Agenda Introduction to MySQL Router Connection Routing InnoDB Cluster Metadata cache Routing Demo 1 2 3 4 5 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 5
  • 6. MySQL Router: Need ? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 6 •High availability – On server failure, the application should connect to proper server – Not desirable for the application to handle this • Load balancing – In a HA system, efficiency is increased using more resources – Helps to handle traffic properly
  • 7. MySQL Router: Key Features Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 7 •Provides transparent routing between application and backend MySQL servers •Pluggable Architecture – Allows MySQL developers to easily extend the product with additional features – Allows users to create their own custom plugins •Provides High availability and Load balancing
  • 8. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 8
  • 9. Program Agenda Introduction to MySQL Router Connection Routing InnoDB Cluster Metadata cache Routing Demo 1 2 3 4 5 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 9
  • 10. Connection Routing Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 10 • Forwards MySQL packets to backend server without inspecting or modifying them • Achieved with routing plugin • Routing strategy : – First available – Round robin
  • 11. Connection Routing : Example Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 11
  • 12. Connection Routing : Configuration Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 12
  • 13. Connection Routing : Start Routing Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 13
  • 14. Program Agenda Introduction to MySQL Router Connection Routing InnoDB Cluster Metadata cache Routing Demo 1 2 3 4 5 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 14
  • 15. InnoDB Cluster : Introduction Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15 • Provides complete HA solution for MySQL • MySQL Shell enables to easily configure and administer MySQL server instances to function as an InnoDB Cluster • Servers run MySQL Group Replication : – Replicate data – Built-in failover
  • 16. InnoDB Cluster : How to ? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 16 • MySQL Shell includes Admin API which is accessed through the dba global variable and its associated methods • The methods allow to deploy, configure and administer InnoDB clusters • Shell provides two scripting language modes, JavaScript and Python, in addition to SQL mode – Default mode : JavaScript – Switch modes issuing js , py, sql
  • 17. InnoDB Cluster : How to ? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 17
  • 18. InnoDB Cluster : How to ? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 18
  • 19. InnoDB Cluster : Overview Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
  • 20. Program Agenda Introduction to MySQL Router Connection Routing InnoDB Cluster Metadata cache Routing Demo 1 2 3 4 5 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 20
  • 21. Metadata cache Routing : Introduction Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 21 • Provides transparent client routing, load balancing and failover to InnoDB clusters • Achieved with metadata_cache plugin • Router uses metadata_cache plugin to retrieve InnoDB cluster’s metadata periodically •In the event of server failure, cluster adjusts the topology and Router detects this change
  • 22. Metadata cache Routing : How to ? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 22 • Using --bootstrap option, Router retrieves the InnoDB cluster metadata and automatically creates a configuration file • Generated Router configuration by default creates TCP ports which can be used to connect to cluster • Additionally, sockets to connect, can be created using --conf-use-sockets option while bootstrapping • Ports, Sockets for both MySQL Protocol and X Protocol created
  • 23. Metadata cache Routing : Configuration Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 23 • Bootstrap example : •Configuration file generated is automatically generated at /home/prasad/dir/mysqlrouter.conf
  • 24. Metadata cache Routing : Configuration Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 24
  • 25. Metadata cache Routing : Configuration Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 25
  • 26. Metadata cache Routing : Configuration Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 26
  • 27. Metadata cache Routing : Start Routing Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 27
  • 28. Metadata cache Routing : Key Features Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 28 • User doesn’t need to be aware of the topology information and details of all servers • Routing will be proper : – In the event of failover – When new servers get added to the cluster
  • 29. Program Agenda Introduction to MySQL Router Connection Routing InnoDB Cluster Metadata cache Routing Demo 1 2 3 4 5 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 29
  • 30. THANK YOU! Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 30