Elastic Scalability in MySQL Fabric using OpenStack



Similar documents
Enabling Database-as-a-Service (DBaaS) within Enterprises or Cloud Offerings

MySQL Fabric: High Availability Solution for Connector/Python

OpenStack. Orgad Kimchi. Principal Software Engineer. Oracle ISV Engineering. 1 Copyright 2013, Oracle and/or its affiliates. All rights reserved.


YouTube Vitess. Cloud-Native MySQL. Oracle OpenWorld Conference October 26, Anthony Yeh, Software Engineer, YouTube.

Scalable Architecture on Amazon AWS Cloud

MySQL and Virtualization Guide

Cloud Based Application Architectures using Smart Computing

MySQL Strategy. Morten Andersen, MySQL Enterprise Sales. Copyright 2014 Oracle and/or its affiliates. All rights reserved.

High Availability Solutions for the MariaDB and MySQL Database

SCALABLE DATA SERVICES

Appendix A Core Concepts in SQL Server High Availability and Replication

Best Practices for Using MySQL in the Cloud

Module 14: Scalability and High Availability

Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

Alfresco Enterprise on AWS: Reference Architecture

2) Xen Hypervisor 3) UEC

DISTRIBUTED SYSTEMS [COMP9243] Lecture 9a: Cloud Computing WHAT IS CLOUD COMPUTING? 2

References. Introduction to Database Systems CSE 444. Motivation. Basic Features. Outline: Database in the Cloud. Outline

Introduction to Database Systems CSE 444

Getting Started with Database As a Service on OpenStack

Fault-Tolerant Computer System Design ECE 695/CS 590. Putting it All Together

Designing, Optimizing and Maintaining a Database Administrative Solution for Microsoft SQL Server 2008

MySQL Administration and Management Essentials

Oracle Public Cloud An Enterprise Cloud for Business Critical Applications Gerry Lim, Regional Program Director, Cloud Initiatives, ASEAN

Migration Scenario: Migrating Backend Processing Pipeline to the AWS Cloud

Availability Digest. MySQL Clusters Go Active/Active. December 2006

How To Compare Cloud Computing To Cloud Platforms And Cloud Computing

TECHNOLOGY WHITE PAPER Jan 2016

High Availability of VistA EHR in Cloud. ViSolve Inc. White Paper February

TECHNOLOGY WHITE PAPER Jun 2012

On- Prem MongoDB- as- a- Service Powered by the CumuLogic DBaaS Platform

Best Practices for Virtualised SharePoint

MS Design, Optimize and Maintain Database for Microsoft SQL Server 2008

High-Availability in the Cloud Architectural Best Practices

Cloud Computing Architecture

Deploying Database clusters in the Cloud

Contents UNIFIED COMPUTING DATA SHEET. Virtual Data Centre Support.

Solution for private cloud computing

Adding Indirection Enhances Functionality

High Availability Using MySQL in the Cloud:

WSO2 Business Process Server Clustering Guide for 3.2.0

OpenStack Private Cloud Hosting in an Tier 3 Data Centre. G-Cloud Lot 1 IaaS

Cluster Computing. ! Fault tolerance. ! Stateless. ! Throughput. ! Stateful. ! Response time. Architectures. Stateless vs. Stateful.

Implementing Enhanced Secure Multi-tenancy Solutions (IESMT)

Configuring and Deploying a Private Cloud 20247C; 5 days

HOSTWAY. FlexCloudTM. Servers

Server Virtualization with Windows Server Hyper-V and System Center

MySQL: Cloud vs Bare Metal, Performance and Reliability

RackWare Solutions Disaster Recovery

9/26/2011. What is Virtualization? What are the different types of virtualization.

Amazon Elastic Beanstalk

Mind Q Systems Private Limited

An Introduction to Cloud Computing Concepts

Introduction to Openstack, an Open Cloud Computing Platform. Libre Software Meeting

In Memory Accelerator for MongoDB

SQL Server 2012 Database Administration With AlwaysOn & Clustering Techniques

Postgres Plus Cloud Database!

Scaling in the Cloud with AWS. By: Eli White (CTO & mojolive) eliw.com - mojolive.com

be architected pool of servers reliability and

Using SUSE Cloud to Orchestrate Multiple Hypervisors and Storage at ADP

OpenStack Introduction. November 4, 2015

Postgres on OpenStack

VMware vrealize Automation

APP DEVELOPMENT ON THE CLOUD MADE EASY WITH PAAS

Storage and Disaster Recovery

Comparing MySQL and Postgres 9.0 Replication

VMware vrealize Automation

Deployment Options for Microsoft Hyper-V Server

Configuring and Deploying a Private Cloud

Introduction to OpenStack

Private Cloud in Educational Institutions: An Implementation using UEC

Preparing for the Big Oops! Disaster Recovery Sites for MySQL. Robert Hodges, CEO, Continuent MySQL Conference 2011

VMware vcloud Automation Center 6.1

Zadara Storage Cloud A

A Comparison of Clouds: Amazon Web Services, Windows Azure, Google Cloud Platform, VMWare and Others (Fall 2012)

Server Virtualization with Windows Server Hyper-V and System Center

Course 10751A: Configuring and Deploying a Private Cloud with System Center 2012

SUSE Cloud Installation: Best Practices Using a SMT, Xen and Ceph Storage Environment

High Availability Solutions for MySQL. Lenz Grimmer DrupalCon 2008, Szeged, Hungary

Multi-Datacenter Replication

6422: Implementing and Managing Windows Server 2008 Hyper-V (3 Days)

Best Practices for Python in the Cloud: Lessons

Database as a Service (DaaS) Version 1.02

Whitepaper. NexentaConnect for VMware Virtual SAN. Full Featured File services for Virtual SAN

Explain how to prepare the hardware and other resources necessary to install SQL Server. Install SQL Server. Manage and configure SQL Server.

How To Choose Cloud Computing

Implementing and Managing Windows Server 2008 Hyper-V

Virtualization and Cloud Computing

CON8473 Oracle Distribution of OpenStack Making OpenStack an Enterprise Grade Solution

Where We Are. References. Cloud Computing. Levels of Service. Cloud Computing History. Introduction to Data Management CSE 344

ArcGIS for Server: In the Cloud

An Oracle White Paper November Oracle Real Application Clusters One Node: The Always On Single-Instance Database

Transcription:

Elastic Scalability in MySQL Fabric using OpenStack Mats Kindahl Senior Principal Software Developer Narayanan Venkateswaran Principal Software Developer Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Safe Harbor Statement 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.

Session Outline 1 Elasticity in Computing 2 OpenStack 3 Introduction to MySQL Fabric 4 Elasticity in MySQL Fabric using OpenStack 5 Closing Remarks & Thoughts for the Future

Elasticity in Computing

What is Elasticity? [Elasticity] is defined as the degree to which a system is able to adapt to workload changes by provisioning and deprovisioning resources in an autonomic manner

Elasticity from our Perspective Managing server failures Managing read load Read load increases Problem: Read servers overloaded Solution: Add more read servers Managing shards A shard is hot or full Problem: slower queries Solution: Split the shard A server in a group fails Slave is promoted Problem: Availability is affected Solution: Add replacement node

OpenStack

What is OpenStack? OpenStack is a free and opensource software cloud computing software platform What is that?

Cloud Computing According to NIST Resouce pooling Resources are assigned and reassigned based on customer demand Broad network access Capabilities are accessed over the network through standard mechanisms Measured service On-demand self-service Customer can unilaterally provision computing capabilities Rapid elasticity Capabilities can be elastically provisioned and released

OpenStack Deployment Example Controller Controller Node Manages Identities Manages Images Manages Block Storage Compute Node (Virtual) machine host Contain hypervisor Spawn and destroy virtual machines Compute (VM Host)

Introduction to MySQL Fabric

What is MySQL Fabric? An extensible and easy-touse framework for managing a farm of MySQL servers supporting high-availability and sharding

What does all that mean? Management System Framework Manages a MySQL Farm Distributed Framework Procedure execution State store Transaction Routing Written in Python Latest Release 1.5.2 GA Open Source Extensible Extensions are first-class High-availability groups Semi-automatic sharding You can participate Suggest features Report bugs Contribute patches MySQL 5.6 is focus

MySQL Fabric: Goals & Features Decision logic in connector Connector API extensions Multi-table sharding Sharding functions Support transactions Support full SQL Load balancing Eliminates network hop Reduce network load Eliminate single point of failure Scale naturally: not a bottleneck Read-write split Weighted round-robin Shard operations Range (Consistent) hash Shard move Shard split Global updates Global tables Schema updates Cloud integration Support elasticity Servers on-demand

A Brief History of MySQL Fabric MySQL Fabric 1.4 First public release Sept 2013 MySQL Fabric 1.4.3 GA May 2014 High-availability groups Failure detection Load balancing Range and hash sharding Shard move and split Connector/J support Connector/PHP support Connector/Python support Doctrine Hibernate MySQL Fabric 1.5 MySQL Fabric 1.5.1 RC in Aug 2014 MySQL Fabric 1.5.2 GA in Sept 2014 Cloud Integration (WL#6432) MySQL-RPC support (WL#7600) Connector/NET support Labs: C API

Birds-eye View Operator Application Database Servers Connector XML-RPC MySQL-RPC Connector Connector SQL MySQL Fabric Node SQL High Availability Groups

High-Level Components Fabric-aware Connectors Python, PHP, Java,.NET, C Enhanced Connector API Connector MySQL Fabric Node Application Manage information about farm Provide status information Execute procedures MySQL Servers Connector MySQL Fabric Node Organized in high-availability groups Handling application data High Availability Group Connector

MySQL Fabric Node Architecture Protocols Connector Connector? AMQP MySQL-RPC XML-RPC Connector Sh MySQL Fabric Framework Executor HA State Store (Persister) Extensions? MySQL Backing Store

High-Availability Concepts Redundancy Monitoring Duplicate components Detecting failing components Monitor load Procedures Activate replacements Distribute load

MySQL Fabric and the Cloud Using OpenStack for Elasticity

Server Providers Server Creation Create new server instances Server Filling Fill instance with data Internal Memory Clone from an existing server Disk Size Restore a backup Number of CPUs Configured for the purpose GTID enabled Binary log enabled Correct engines enabled L Q S My Set up replication ic r b Fa Point secondary to primary Custom filling operation d u o l +C d e l d n a h ic y r d b a a e Alr SQL F y M in

Server Providers A server factory Abstract concept Extension interface added to MySQL Fabric Possible to support multiple providers OpenStack Nova (in MySQL Fabric 1.5) OpenStack Trove Amazon AWS Amazon RDS Custom hardware registry

MySQL Fabric and OpenStack MySQL Fabric Node Application High-Availability Groups / Shards OpenStack Instance

Adding a new provider to MySQL Fabric Register a provider with MySQL Fabric Provide API address and user credentials Provider type OPENSTACK spawns new virtual machines mysqlfabric provider register my_stack mats xyzzy http://example.net:5000/v2.0/ my_project --provider_type=openstack

Creating a new server from MySQL Fabric Create a new machine using the registered provider Provide an image to use for the machine You have to set up the image beforehand Provide a cloud-init script to set up MySQL server mysqlfabric machine create my_stack --image name= Oracle Linux 7 amd64 --flavor name=m1.small --userdata=mysql-oracle-linux-init

Creating a snapshot from MySQL Fabric Create a snapshot of an existing machine Return an provider-internal name of the snapshot Can be used to create your golden image mysqlfabric snapshot create my_stack 903476b7-db4d-4d63-84e6-f79c7d0cec31

Elasticity using providers Read load increases Server is lost Spawn new read servers High-availability is reduced Add them to the group Spawn new server Add it to the group Shard is overloaded Spawn new servers for a shard Create a new shard Split existing shard Can we automate this? Yes, we can!

Events MySQL Fabric executor Event driven Queue Events will trigger execution of procedures Procedures can trigger events themselves Each step of a procedure is called a job Backing Store Procedures Written in Python Interacts with servers Write state changes into backing store Lock manager for conflict resolution Conservative two-phase locking strategy Avoid deadlocks

Automatically adding a server to a group Register procedure for event @on_event decorator Accept event to register for Fetch the group the server belonged to Fetch a new server from the provider Add the server to the group @on_event(server_lost) def _add_server(group_id, server_uuid): group = Group.fetch(group_id) machines = PROVIDER.create_machines( parameters ) server = MySQLServer( server_uuid, address ) MySQLServer.add(server) group.add(server) _configure_as_slave(server)

Events MySQL Fabric procedure execution Before starting a job: Queue Aquire the necessary locks Checkpoint execution state in backing store Start a transaction on the backing store Backing Store When executing job: Make updates to backing store inside transaction Interact with servers After executing a job: Wh Mark job completed in internal log Commit transaction on backing store ut o b at a s? e h s cr a

Events MySQL Fabric executor recovery Two types of jobs: Queue Idempotent: Restart the job Not idempotent: Execute compensation Recovery procedure Start the executor Collect unfinished checkpoints Execute compensation activity for each job associated with the checkpoint Backing Store if there is one Re-schedule each job

Defining an compensation procedure Use the @undo decorator Compensating action Search for the machine by UUID Give it back to provider Compensating actions need to be idempotent @_add_server.undo def _undo_add_srv(group_id, server_uuid): meta_filters = { 'mysql fabric machine group uuid': server_uuid } machines = MANAGER.search_machines( {}, meta_filters ) for machine in machines: MANAGER.destroy_machine( machine.uuid )

Example using Rackspace Provider mysqlfabric provider register my_rackspace mats xyzzy https://lon.identity.api.rackspacecloud.com/v2.0/ tenant accountnumber extra auth_system=rackspace provider_type OPENSTACK mysqlfabric machine create my_rackspace image id=8c964b3f 8c15 4966 86ee 7a55824df564 ns i g u flavor name="512mb Standard Instance" l p n tio e a t c o i N nt e h t u a or f g) t n r i o om pp c u ( s e r i u Req

Experiments with Amazon AWS mysqlfabric provider register my_amazon AKIAIOSFODNN7EXAMPLE wjalrxutnfemi/k7mdeng/bpxrficyexamplekey eu west 1 provider_type=amazon mysqlfabric machine create my_amazon image image id=ami 892fe1fe flavor name=t2.micro Note! Not in MySQL Fabric 1.5 Will be on MySQL Labs

Experiments with OpenStack Trove mysqlfabric provider register my_trove mats xyzzy https://lon.identity.api.rackspacecloud.com/v2.0/ tenant 123456 extra service_type=rax:database provider_type=openstack.database mysqlfabric server create my_trove flavor name="512mb Instance" size 1 users mats:xyzzy databases employee datastore MySQL datastore_version 5.6 Note! Not in MySQL Fabric 1.5 Will be on MySQL Labs

Closing remarks

What do we have now? High-availability Range and hash sharding Shard move and shard split Transaction properties Virtual connections Cloud integration Server providers OpenStack Nova Connectors report failures Custom failure detectors Credentials Command-line XML-RPC MySQL-RPC Distributed failure detector Connector/Python Connector/PHP Connector/J Connector/NET Interfaces Connector APIs Enhanced connectors Group Concept Slave promotion Sharding RFC 2617 SSL support

Thoughts for the Future Connector multi-cast Improve extension support Improve procedures support Focus on ease-of-use Cloud support OpenStack Trove Amazon AWS Amazon RDS Django? More connectors? MySQL-RPC Protocol? Done! More frameworks? Command-line interface More protocols UNION of result sets More complex operations? Extension interfaces C/C++? In Labs! Fabric-unaware connectors? More HA group types DRBD MySQL Cluster Amazon RDS?

Thoughts for the Future Automatic sharding Single-query transactions? Speculative execution? Cross-shard queries? Efficient initial sharding Better use of resources Node failure stop execution Execution restart on recovery Replicated State Machine (RSM) Independent tables Multi-way shard split Highly-available executor Multiple shard mappings Paxos? Raft? Fail-over execution Session consistency We have a distributed database It should look like a single database Read monotonicity Write monotonicity

Reading for the Interested MySQL Forum: Fabric, Sharding, HA, Utilities http://forums.mysql.com/list.php?144 MySQL Fabric Documentation http://dev.mysql.com/doc/mysql-utilities/1.4/en/fabric.html Migrating From an Unsharded to a Sharded Setup http://vnwrites.blogspot.com/2013/09/mysqlfabric-sharding-migration.html Configuring and running MySQL Fabric http://alfranio-distributed.blogspot.com/2014/03/mysqlfabric-installation.html

Want to contribute? Check it Test it and send us use-case and feature suggestions and send comments to the forum Break it and send in bugs to http://bugs.mysql.com

Keeping in Touch Mats Kindahl Narayanan Venkateswaran Alfranio Correia Geert Vanderkelen Twitter: @mkindahl http://mysqlmusings.blogspot.com Twitter: @alfranio http://alfranio-distributed.blogspot.com Twitter: @vn_tweets http://vnwrites.blogspot.com Twitter: @geertjanvdk http://geert.vanderkelen.org

Safe Harbor Statement The preceding 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.