Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
OpenStack Meetup,
Boston on Feb. 19th 2014
Rags
Agenda
What is HA?
HA of OpenStack APIs
HA of RabbitMQ
MySQL HA
A Peek into HA Methods
Resources and Summary
Distribute everything
a) Especially logic. Move logic to where state naturally exists.
WWW.RACKSPACE.COM
What is HA?
HA as Nines
Downtime/Year
3.65 days
99.9%
8.76 hours
99.99%
52.56 minutes
99.999%
5.26 minutes
Implementing HA
Elimination of Single Point of Failure (SPOFs)
Redundancy of network components such as switchers and routers
Redundancy of applications and automatic service migrations
Redundancy of storage components
Redundancy of facilities services such as power, AC, etc.
NODE 2
Replication Services
Replication Services
Health Check
Health Check
Cluster Communication
Cluster Communication
Concepts
State
Description
Example
MySQL, RabbitMQ,
etc.
More Concepts
Terminology
Description
Failover
Failback
Switchover
Active/Active
o Multiple masters
HA for OpenStack
OpenStack APIs (nova, cinder, etc.)
RabbitMQ
MySQL
Cinder, Swift, and so on
Heat (still Work in Progress)
Application running on OpenStack (Application
dependent)
Agenda
What is HA?
HA of OpenStack APIs
HA of RabbitMQ
MySQL HA
A Peek into HA Methods
Resources and Summary
HA on OpenStack
Keepalived
Based on Linux Virtual Server (IPVS) kernel module providing layer 4 Load
Balancing
Implements a set of checkers to maintain health and Load Balancing
HA is implemented using VRRP Protocol
1 vrrp_script rabbitmq {!
script usr/sbin/service
2
interval 5
3
weight -2
4
rise 2
5
fall -2
6
}!
7
HAProxy
Load Balancing and Proxying for HTTP and TCP
Applications
Network Layer
Host1
HAProxy
Application Layer
Realserver1
Host2
Keepalived
Backup
Realserver2
HA on Rackspace Private
Cloud
INTERNET
Controller 1
VIP(Keepalived, VRRP)
HAProxy
Heartbeat
VMs Instantiated
Controller 2
Redundant Active-Passive
Infrastructure services
Redundant Active-Active
Infrastructure services
Compute Node N
HA on Rackspace Private
Cloud (switchover)
INTERNET
VIP(HAProxy)
Controller 2
Controller 1
Active-Passive Infrastructure services
(MySQL, Rabbit)
Heartbeat
VMs Instantiated
Infrastructure services
Compute Node N
Agenda
What is HA?
HA of OpenStack APIs
HA of RabbitMQ
MySQL HA
A Peek into HA Methods
Resources and Summary
RabbitMQ HA Options
Health Check without Clustering
Clustering without Health Check
Health Check and Clustering
RabbitMQ HA
Ethernet
VRID 13
192.168.236.199
Master (Active)
Controller 1
VRID 13
IP address:
192.168.236.11
Backup (Passive)
RabbitMQ
RabbitMQ
RabbitMQ Clustering
Controller 2
VRID 13
IP address:
192.168.236.12
Agenda
What is HA?
HA of OpenStack APIs
HA of RabbitMQ
MySQL HA
A Peek into HA Methods
Resources and Summary
MySQL Master/Master
Replication
Ethernet
VRID 12
192.168.236.198
Master (Active)
Backup (Passive)
MySQL
Controller 1
VRID 12
IP address: 192.168.236.11
MySQL
Master/Master
Controller 2
VRID 12
IP address:
192.168.236.12
MySQL Master/Master
Replication simplified
RACKSPACE HOSTING
WWW.RACKSPACE.COM
27
Pacemaker, Corosync,
DRBD
Pacemaker
Corosync
DRBD
DRBD
Service
Service
FILE SYSTEM
FILE SYSTEM
BUFFER CACHE
BUFFER CACHE
DRBD
RAW DEVICE
RAW DEVICE
TCP/IP
TCP/IP
DISK SCHED
DRBD
DISK SCHED
DISK DRIVER
NIC DRIVER
NIC DRIVER
DISK DRIVER
DISK
NIC
NIC
DISK
Galera
CLIENTS
Transparent
Connections
DBMS
DBMS
DBMS
wsrep API
wsrep API
wsrep API
Galera Replication
Multi-master replication
Based on Optimistic Concurrency Control
In case of two transactions modifying the same row on different nodes, one of
the transactions will abort
Victim transaction will get Deadlock Error
Application needs to handle this error
Multi-master Replication
MySQL
Multi-master conflicts
write
write
MySQL
MySQL
GALERA REPLICATION
MySQL
Multi-master conflicts
write
write
MySQL
MySQL
GALERA REPLICATION
MySQL
Conflict detected
Multi-master conflicts
write
OK
MySQL
MySQL
GALERA REPLICATION
MySQL
Deadlock
error
Agenda
What is HA?
HA of OpenStack APIs
HA of RabbitMQ
MySQL HA
A Peek into HA Methods
Resources and Summary
HA methods
Vendor
Clustering/Replication
Technique
Rackspace
Keepalived, HAProxy,
VRRP, native clustering
Red Hat
Pacemaker, Corosync,
DRBD
Cisco
Keepalived, HAProxy,
Galera for MySQL
HP
Characteristics
Agenda
What is HA?
HA of OpenStack APIs
HA of RabbitMQ
MySQL HA
A Peek into HA Methods
Resources and Summary
HA methods
Infrastructure
Clustering/Replication
Technique
Characteristics
RabbitMQ Clustering
Heat
TBD
MySQL
Many
OpenStack APIs
RabbitMQ
HAProxy
multiple nodes
methods yet).
Replication Technique
Keepalived/HAProxy/VRRP
Characteristics
Galera
Others
No Slave lag
Needs at least 3 nodes
Deadlock erros on hotspot rows.
Relatively new
Some relatively new (GTID)
Some well test
More complex setup
Resources
OpenStack HA guide
http://docs.openstack.org/high-availability-guide/content/ch-intro.html
https://wiki.ubuntu.com/ServerTeam/OpenStackHA
Other Resources
http://www.rackspace.com/blog/implementing-high-availability-ha-for-rackspace-private-cloud/
http://www.rackspace.com/blog/high-availability-ha-with-galera-for-rackspace-private-cloud/https://www.hastexo.com/
http://www.mysql.com/why-mysql/white-papers/mysql-high-availability-drbd-configuration-deployment-guide/
http://docwiki.cisco.com/wiki/OpenStack_Havana_Release:_High-Availability_Manual_Deployment_Guide
http://www.drbd.org/
http://www.codership.com/
http://www.severalnines.com/blog/clustering-mysql-backend-openstack
https://wiki.openstack.org/wiki/BasicDesignTenets
http://db.cs.berkeley.edu/papers/hpts85-nothing.pdf
Book
Summary
There are several time-tested and more recent methods for implementing MySQL HA.
Rackspace Private Cloud provides Chef cookbooks and recipes for implementing HA via Keepalived,
HAProxy and VRRP.
Galera is gaining more popularity. Since its Active/Active it does scale out and is HA.
Few steps to get from Rackspace Private Cloud to MySQL with Galera (officially unsupported).
Thank you!
Raghavan Rags Srinivas
Solutions Architect
Rackspace