SlideShare uma empresa Scribd logo
1 de 41
MySQL High Availability Sprint:
      Launch the Pacemaker!
                      Florian Haas
                           hastexo
MySQL HA Sprint: Get Prepared!

●   Please grab a DVD from your table!
    ●   We have 12 in total – please share if needed!
●   Follow instructions in README.pdf.
●   If your laptop does not have a DVD drive, please see
    me for a USB stick.
●   For any questions, I'm the guy in the blue shirt who
    answers to “Florian”. When in doubt, just holler.
Florian Haas

CEO & Principal Consultant, hastexo
 http://www.hastexo.com/who/florian
               florian@hastexo.com
Visual Cues & Clues

How to follow this talk easily
This layout means:

                   Would you treat me
to the courtesy of your kind attention?
This layout means:

●   I'd ask you to do this,
●   and this,
●   and this.
Our virtual environment
An Overview
of the Linux HA stack
           (for MySQL)
Application Interface   MySQL RA



Cluster Resource Mgmt   Pacemaker



Cluster Messaging       Corosync



Storage Replication      DRBD

(optional)
Physical   DRBD     Physical
          Host                Host



         MySQL
         Master




MySQL    MySQL      MySQL     App        App
 Slave    Slave      Slave   Server     Server
Physical   DRBD     Physical
          Host                Host



                             MySQL
                             Master




MySQL    MySQL      MySQL     App        App
 Slave    Slave      Slave   Server     Server
DRBD

http://www.hastexo.com/knowledge/drbd
                    http://www.drbd.org

      DRBD & the DRBD logo are registered trademarks of Linbit Information Technologies
Create a DRBD resource!

●   Name:            mysql
●   Device name:     /dev/drbd0
●   Backing disk:    /dev/sdb1
●   Meta data:       internal
●   Replication:     192.168.133.111 ↔ 112
                     Port 7788
Hint: use “legacy” (pre-8.4) DRBD User's Guide
Corosync

http://www.hastexo.com/knowledge/corosync
                    http://www.corosync.org
Create a Corosync Cluster!

●   Enable secauth
●   2 rings, RRP mode: active
●   Multicast addresses: 239.255.42.0 and .1
●   Network addresses: 192.168.122.0 and .133.0
●   No logging to files, syslog only
●   Start Corosync
●   Check connectivity (corosync-cfgtool -s)
Pacemaker

http://www.hastexo.com/knowledge/pacemaker
                    http://www.clusterlabs.org
Create a Pacemaker Cluster

●   Add the “pacemaker” service to /etc/corosync.d
●   Use ver: 1
●   Restart corosync
●   Start pacemakerd
●   Verify both nodes have joined the cluster
    (crm_mon)
STONITH/Fencing
Set up your cluster

●   Open the shell with crm configure
●   Set no-quorum-policy to ignore
●   Disable STONITH
    ●   Kids, don't do this at home!
●   Commit the configuration
Pacemaker Resources
Set up a floating IP address

●   Add an IPaddr2 resource
    ●   Name: p_ip_mysql
    ●   IP: 192.168.122.110
    ●   CIDR Netmask: 24
    ●   NIC: eth0
●   Commit the configuration
Resource monitoring
Add resource monitoring

●   Add a monitor operation to p_ip_mysql
    ●   Interval: 10s
●   Commit the configuration
●   Manually delete the IP address
●   Watch with crm_mon -rf
●   Observe resource recovery
Master/Slave Sets
Started


start             stop


        Stopped
Started                  Started


start             stop   start             stop


        Stopped                  Stopped
Master


                         promote            demote


         Slave                     Slave


start             stop    start              stop


        Stopped                   Stopped
Add a DRBD Master/Slave Set

●   Create the DRBD primitive p_drbd_mysql
    ●   Use the ocf:linbit:drbd RA
    ●   Add 2 monitor operations (role=Master, role=Slave)
        with non-equal intervals
●   Wrap it in a master/slave set
    ●   notify=true, clone-max=2, master-max=1
●   Commit the configuration
●   Watch the cluster promote
Constraints
Create a Filesystem

●   Run mkfs -t ext3 on whichever node is the Master
●   Add the Filesystem resource
    ●   Name:               p_fs_mysql
    ●   Device:             /dev/drbd0
    ●   Directory:          /var/lib/mysql
    ●   File system type:   ext3
●   Add required order & colocation constraints
Groups
Add a Group

●   Create the g_mysql resource group
●   Add p_fs_mysql and p_ip_mysql
●   Watch the constraints update automagically
And Finally: MySQL!
Add the MySQL resource

●   Run mysql_install_db
●   Create an ocf:heartbeat:mysql primitive p_mysql
●   Set additional_parameters:
    --bind-address 192.168.122.110
●   Add resource level monitoring
●   Add it to the g_mysql group
●   Commit, Rejoice!
One more thing...
Physical   DRBD     Physical
          Host                Host



                             MySQL
                             Master




MySQL    MySQL      MySQL     App        App
 Slave    Slave      Slave   Server     Server
Physical   DRBD     Physical
          Host                Host



                             MySQL
                             Master




MySQL    MySQL      MySQL     App        App
 Slave    Slave      Slave   Server     Server
Physical                 Physical
             Host                     Host



            MySQL
                        InnoDB Recovery
            Master



    Umm..                WTF?       Hurry up!



MySQL       MySQL        MySQL         App       App
 Slave       Slave        Slave       Server    Server


            Booooring
Physical            Physical
          Host                Host



         MySQL
         Master




MySQL    MySQL      MySQL     App        App
 Slave    Slave      Slave   Server     Server
Further Information

  http://www.hastexo.com
http://twitter.com/hastexo
Liked this talk?

●   Go to www.hastexo.com/shoutbox
●   Log in
    (you can just use your OpenID from Wordpress,
    Blogger, Yahoo, Google Apps, Google Profile)
●   Leave us a message!

Mais conteúdo relacionado

Mais procurados

brief introduction of drbd in SLE12SP2
brief introduction of drbd in SLE12SP2brief introduction of drbd in SLE12SP2
brief introduction of drbd in SLE12SP2Nick Wang
 
Pacemaker+DRBD
Pacemaker+DRBDPacemaker+DRBD
Pacemaker+DRBDDan Frincu
 
Percona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationPercona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationMydbops
 
LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganetikawamuray
 
Introduction to XtraDB Cluster
Introduction to XtraDB ClusterIntroduction to XtraDB Cluster
Introduction to XtraDB Clusteryoku0825
 
Percona XtraDB Cluster
Percona XtraDB ClusterPercona XtraDB Cluster
Percona XtraDB ClusterKenny Gryp
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksCommand Prompt., Inc
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper Omid Vahdaty
 
Plny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practicesPlny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practicesDimas Prasetyo
 
Percona XtraDB 集群内部
Percona XtraDB 集群内部Percona XtraDB 集群内部
Percona XtraDB 集群内部YUCHENG HU
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcachedJurriaan Persyn
 
DataStax: Extreme Cassandra Optimization: The Sequel
DataStax: Extreme Cassandra Optimization: The SequelDataStax: Extreme Cassandra Optimization: The Sequel
DataStax: Extreme Cassandra Optimization: The SequelDataStax Academy
 
Consistency between Engine and Binlog under Reduced Durability
Consistency between Engine and Binlog under Reduced DurabilityConsistency between Engine and Binlog under Reduced Durability
Consistency between Engine and Binlog under Reduced DurabilityYoshinori Matsunobu
 
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisDvir Volk
 
Percona XtraDB Cluster SF Meetup
Percona XtraDB Cluster SF MeetupPercona XtraDB Cluster SF Meetup
Percona XtraDB Cluster SF MeetupVadim Tkachenko
 
Cassandra Summit 2014: Performance Tuning Cassandra in AWS
Cassandra Summit 2014: Performance Tuning Cassandra in AWSCassandra Summit 2014: Performance Tuning Cassandra in AWS
Cassandra Summit 2014: Performance Tuning Cassandra in AWSDataStax Academy
 

Mais procurados (20)

brief introduction of drbd in SLE12SP2
brief introduction of drbd in SLE12SP2brief introduction of drbd in SLE12SP2
brief introduction of drbd in SLE12SP2
 
Pacemaker+DRBD
Pacemaker+DRBDPacemaker+DRBD
Pacemaker+DRBD
 
Percona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL AdministrationPercona Toolkit for Effective MySQL Administration
Percona Toolkit for Effective MySQL Administration
 
LXC on Ganeti
LXC on GanetiLXC on Ganeti
LXC on Ganeti
 
Introduction to XtraDB Cluster
Introduction to XtraDB ClusterIntroduction to XtraDB Cluster
Introduction to XtraDB Cluster
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
Percona XtraDB Cluster
Percona XtraDB ClusterPercona XtraDB Cluster
Percona XtraDB Cluster
 
Elephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forksElephant Roads: a tour of Postgres forks
Elephant Roads: a tour of Postgres forks
 
Introduction to apache zoo keeper
Introduction to apache zoo keeper Introduction to apache zoo keeper
Introduction to apache zoo keeper
 
Containers > VMs
Containers > VMsContainers > VMs
Containers > VMs
 
Plny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practicesPlny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practices
 
Percona XtraDB 集群内部
Percona XtraDB 集群内部Percona XtraDB 集群内部
Percona XtraDB 集群内部
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
DataStax: Extreme Cassandra Optimization: The Sequel
DataStax: Extreme Cassandra Optimization: The SequelDataStax: Extreme Cassandra Optimization: The Sequel
DataStax: Extreme Cassandra Optimization: The Sequel
 
Consistency between Engine and Binlog under Reduced Durability
Consistency between Engine and Binlog under Reduced DurabilityConsistency between Engine and Binlog under Reduced Durability
Consistency between Engine and Binlog under Reduced Durability
 
7 Ways To Crash Postgres
7 Ways To Crash Postgres7 Ways To Crash Postgres
7 Ways To Crash Postgres
 
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Percona XtraDB Cluster SF Meetup
Percona XtraDB Cluster SF MeetupPercona XtraDB Cluster SF Meetup
Percona XtraDB Cluster SF Meetup
 
Cassandra Summit 2014: Performance Tuning Cassandra in AWS
Cassandra Summit 2014: Performance Tuning Cassandra in AWSCassandra Summit 2014: Performance Tuning Cassandra in AWS
Cassandra Summit 2014: Performance Tuning Cassandra in AWS
 

Destaque

Supriya Shailaja Latest Gallery
 Supriya Shailaja Latest Gallery Supriya Shailaja Latest Gallery
Supriya Shailaja Latest Gallerytelugustop.com
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Securitysedukull
 
Barbican 1.0 - Open Source Key Management for OpenStack
Barbican 1.0 - Open Source Key Management for OpenStackBarbican 1.0 - Open Source Key Management for OpenStack
Barbican 1.0 - Open Source Key Management for OpenStackjarito030506
 
Open Source KMIP Implementation
Open Source KMIP ImplementationOpen Source KMIP Implementation
Open Source KMIP Implementationsedukull
 
High availability and fault tolerance of openstack
High availability and fault tolerance of openstackHigh availability and fault tolerance of openstack
High availability and fault tolerance of openstackDeepak Mane
 
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!Linas Virbalas
 
Deployment topologies for high availability (ha)
Deployment topologies for high availability (ha)Deployment topologies for high availability (ha)
Deployment topologies for high availability (ha)Deepak Mane
 
MySQL real-time replication configuration
MySQL real-time replication configurationMySQL real-time replication configuration
MySQL real-time replication configurationkelechi Anyanwu
 
Open stack HA - Theory to Reality
Open stack HA -  Theory to RealityOpen stack HA -  Theory to Reality
Open stack HA - Theory to RealitySriram Subramanian
 
The OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialThe OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialOSSCube
 
Alta Disponibilidade em Linux com Heartbeat e Drbd
Alta Disponibilidade em Linux com Heartbeat e DrbdAlta Disponibilidade em Linux com Heartbeat e Drbd
Alta Disponibilidade em Linux com Heartbeat e DrbdFrederico Madeira
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016Derek Downey
 
MySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue SolutionsMySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue SolutionsRapidValue
 
Open stack ha design & deployment kilo
Open stack ha design & deployment   kiloOpen stack ha design & deployment   kilo
Open stack ha design & deployment kiloSteven Li
 
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningIndexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningOSSCube
 
Galera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slidesGalera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slidesSeveralnines
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMakerKris Buytaert
 
MySQL High Availability Deep Dive
MySQL High Availability Deep DiveMySQL High Availability Deep Dive
MySQL High Availability Deep Divehastexo
 
Pacemaker: OpenStack's Pid 1
Pacemaker: OpenStack's Pid 1Pacemaker: OpenStack's Pid 1
Pacemaker: OpenStack's Pid 1David Vossel
 

Destaque (20)

Supriya Shailaja Latest Gallery
 Supriya Shailaja Latest Gallery Supriya Shailaja Latest Gallery
Supriya Shailaja Latest Gallery
 
Code Quality - Security
Code Quality - SecurityCode Quality - Security
Code Quality - Security
 
Barbican 1.0 - Open Source Key Management for OpenStack
Barbican 1.0 - Open Source Key Management for OpenStackBarbican 1.0 - Open Source Key Management for OpenStack
Barbican 1.0 - Open Source Key Management for OpenStack
 
Open Source KMIP Implementation
Open Source KMIP ImplementationOpen Source KMIP Implementation
Open Source KMIP Implementation
 
Project: OpenStack, #OSATH
Project: OpenStack, #OSATH Project: OpenStack, #OSATH
Project: OpenStack, #OSATH
 
High availability and fault tolerance of openstack
High availability and fault tolerance of openstackHigh availability and fault tolerance of openstack
High availability and fault tolerance of openstack
 
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!
Liberating Your Data From MySQL: Cross-Database Replication to the Rescue!
 
Deployment topologies for high availability (ha)
Deployment topologies for high availability (ha)Deployment topologies for high availability (ha)
Deployment topologies for high availability (ha)
 
MySQL real-time replication configuration
MySQL real-time replication configurationMySQL real-time replication configuration
MySQL real-time replication configuration
 
Open stack HA - Theory to Reality
Open stack HA -  Theory to RealityOpen stack HA -  Theory to Reality
Open stack HA - Theory to Reality
 
The OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability TutorialThe OSSCube MySQL High Availability Tutorial
The OSSCube MySQL High Availability Tutorial
 
Alta Disponibilidade em Linux com Heartbeat e Drbd
Alta Disponibilidade em Linux com Heartbeat e DrbdAlta Disponibilidade em Linux com Heartbeat e Drbd
Alta Disponibilidade em Linux com Heartbeat e Drbd
 
ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016ProxySQL Tutorial - PLAM 2016
ProxySQL Tutorial - PLAM 2016
 
MySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue SolutionsMySQL Database Replication - A Guide by RapidValue Solutions
MySQL Database Replication - A Guide by RapidValue Solutions
 
Open stack ha design & deployment kilo
Open stack ha design & deployment   kiloOpen stack ha design & deployment   kilo
Open stack ha design & deployment kilo
 
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningIndexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuning
 
Galera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slidesGalera Cluster - Node Recovery - Webinar slides
Galera Cluster - Node Recovery - Webinar slides
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 
MySQL High Availability Deep Dive
MySQL High Availability Deep DiveMySQL High Availability Deep Dive
MySQL High Availability Deep Dive
 
Pacemaker: OpenStack's Pid 1
Pacemaker: OpenStack's Pid 1Pacemaker: OpenStack's Pid 1
Pacemaker: OpenStack's Pid 1
 

Semelhante a MySQL High Availability Sprint: Launch the Pacemaker

LCA 2012: High Availability Sprint
LCA 2012: High Availability SprintLCA 2012: High Availability Sprint
LCA 2012: High Availability Sprinthastexo
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmudjcp
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Valerii Kravchuk
 
High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-costnormanmaurer
 
Malware analysis
Malware analysisMalware analysis
Malware analysisxabean
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseFITC
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaDana Luther
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPDana Luther
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Dana Luther
 
Chef on SmartOS
Chef on SmartOSChef on SmartOS
Chef on SmartOSEric Saxby
 
Creation of Own Cloud
Creation of Own Cloud Creation of Own Cloud
Creation of Own Cloud Mohammed Adam
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with PuppetKris Buytaert
 
Cloudera hadoop installation
Cloudera hadoop installationCloudera hadoop installation
Cloudera hadoop installationSumitra Pundlik
 
Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Chris Tankersley
 
MySQL Monitoring with Zabbix
MySQL Monitoring with ZabbixMySQL Monitoring with Zabbix
MySQL Monitoring with ZabbixFromDual GmbH
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal DevelopmentChris Tankersley
 

Semelhante a MySQL High Availability Sprint: Launch the Pacemaker (20)

LCA 2012: High Availability Sprint
LCA 2012: High Availability SprintLCA 2012: High Availability Sprint
LCA 2012: High Availability Sprint
 
Screaming Fast Wpmu
Screaming Fast WpmuScreaming Fast Wpmu
Screaming Fast Wpmu
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)
 
Scaling PHP apps
Scaling PHP appsScaling PHP apps
Scaling PHP apps
 
High Availability != High-cost
High Availability != High-costHigh Availability != High-cost
High Availability != High-cost
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
MongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL DatabaseMongoDB: Advantages of an Open Source NoSQL Database
MongoDB: Advantages of an Open Source NoSQL Database
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
eurobsd2013
eurobsd2013eurobsd2013
eurobsd2013
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Chef on SmartOS
Chef on SmartOSChef on SmartOS
Chef on SmartOS
 
Creation of Own Cloud
Creation of Own Cloud Creation of Own Cloud
Creation of Own Cloud
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
Cloudera hadoop installation
Cloudera hadoop installationCloudera hadoop installation
Cloudera hadoop installation
 
Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015
 
MySQL Monitoring with Zabbix
MySQL Monitoring with ZabbixMySQL Monitoring with Zabbix
MySQL Monitoring with Zabbix
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal Development
 

Mais de hastexo

Hands On Trove: Database as a Service in OpenStack
Hands On Trove: Database as a Service in OpenStack Hands On Trove: Database as a Service in OpenStack
Hands On Trove: Database as a Service in OpenStack hastexo
 
Storage mit ceph (glt 2013)
Storage mit ceph (glt 2013)Storage mit ceph (glt 2013)
Storage mit ceph (glt 2013)hastexo
 
Storage with Ceph (OSDC 2013)
Storage with Ceph (OSDC 2013)Storage with Ceph (OSDC 2013)
Storage with Ceph (OSDC 2013)hastexo
 
Mit OpenStack zur eigenen Cloud (LinuxTag 2012)
Mit OpenStack zur eigenen Cloud (LinuxTag 2012)Mit OpenStack zur eigenen Cloud (LinuxTag 2012)
Mit OpenStack zur eigenen Cloud (LinuxTag 2012)hastexo
 
Mit OpenStack zur eigenen Cloud (LinuxWochen Wien, 2012)
Mit OpenStack zur eigenen Cloud (LinuxWochen Wien, 2012)Mit OpenStack zur eigenen Cloud (LinuxWochen Wien, 2012)
Mit OpenStack zur eigenen Cloud (LinuxWochen Wien, 2012)hastexo
 
Mit OpenStack zur eigenen Cloud (GLT 2012)
Mit OpenStack zur eigenen Cloud (GLT 2012)Mit OpenStack zur eigenen Cloud (GLT 2012)
Mit OpenStack zur eigenen Cloud (GLT 2012)hastexo
 
Mit OpenStack zur eigenen Cloud (OSDC 2012)
Mit OpenStack zur eigenen Cloud (OSDC 2012)Mit OpenStack zur eigenen Cloud (OSDC 2012)
Mit OpenStack zur eigenen Cloud (OSDC 2012)hastexo
 
GlusterFS und Ceph: Skalierbares Storage ohne Wenn und Aber
GlusterFS und Ceph: Skalierbares Storage ohne Wenn und AberGlusterFS und Ceph: Skalierbares Storage ohne Wenn und Aber
GlusterFS und Ceph: Skalierbares Storage ohne Wenn und Aberhastexo
 
Mit OpenStack zur eigenen Cloud
Mit OpenStack zur eigenen CloudMit OpenStack zur eigenen Cloud
Mit OpenStack zur eigenen Cloudhastexo
 
Storage Replication in High-Performance High-Availability Environments
Storage Replication in High-Performance High-Availability EnvironmentsStorage Replication in High-Performance High-Availability Environments
Storage Replication in High-Performance High-Availability Environmentshastexo
 
Fencing and Maintaining Sanity in High Availability Clusters
Fencing and Maintaining Sanity in High Availability ClustersFencing and Maintaining Sanity in High Availability Clusters
Fencing and Maintaining Sanity in High Availability Clustershastexo
 

Mais de hastexo (11)

Hands On Trove: Database as a Service in OpenStack
Hands On Trove: Database as a Service in OpenStack Hands On Trove: Database as a Service in OpenStack
Hands On Trove: Database as a Service in OpenStack
 
Storage mit ceph (glt 2013)
Storage mit ceph (glt 2013)Storage mit ceph (glt 2013)
Storage mit ceph (glt 2013)
 
Storage with Ceph (OSDC 2013)
Storage with Ceph (OSDC 2013)Storage with Ceph (OSDC 2013)
Storage with Ceph (OSDC 2013)
 
Mit OpenStack zur eigenen Cloud (LinuxTag 2012)
Mit OpenStack zur eigenen Cloud (LinuxTag 2012)Mit OpenStack zur eigenen Cloud (LinuxTag 2012)
Mit OpenStack zur eigenen Cloud (LinuxTag 2012)
 
Mit OpenStack zur eigenen Cloud (LinuxWochen Wien, 2012)
Mit OpenStack zur eigenen Cloud (LinuxWochen Wien, 2012)Mit OpenStack zur eigenen Cloud (LinuxWochen Wien, 2012)
Mit OpenStack zur eigenen Cloud (LinuxWochen Wien, 2012)
 
Mit OpenStack zur eigenen Cloud (GLT 2012)
Mit OpenStack zur eigenen Cloud (GLT 2012)Mit OpenStack zur eigenen Cloud (GLT 2012)
Mit OpenStack zur eigenen Cloud (GLT 2012)
 
Mit OpenStack zur eigenen Cloud (OSDC 2012)
Mit OpenStack zur eigenen Cloud (OSDC 2012)Mit OpenStack zur eigenen Cloud (OSDC 2012)
Mit OpenStack zur eigenen Cloud (OSDC 2012)
 
GlusterFS und Ceph: Skalierbares Storage ohne Wenn und Aber
GlusterFS und Ceph: Skalierbares Storage ohne Wenn und AberGlusterFS und Ceph: Skalierbares Storage ohne Wenn und Aber
GlusterFS und Ceph: Skalierbares Storage ohne Wenn und Aber
 
Mit OpenStack zur eigenen Cloud
Mit OpenStack zur eigenen CloudMit OpenStack zur eigenen Cloud
Mit OpenStack zur eigenen Cloud
 
Storage Replication in High-Performance High-Availability Environments
Storage Replication in High-Performance High-Availability EnvironmentsStorage Replication in High-Performance High-Availability Environments
Storage Replication in High-Performance High-Availability Environments
 
Fencing and Maintaining Sanity in High Availability Clusters
Fencing and Maintaining Sanity in High Availability ClustersFencing and Maintaining Sanity in High Availability Clusters
Fencing and Maintaining Sanity in High Availability Clusters
 

Último

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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 textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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 MenDelhi Call girls
 
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 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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 slidevu2urc
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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 Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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 organizationRadu Cotescu
 

Último (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL 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
 

MySQL High Availability Sprint: Launch the Pacemaker

  • 1. MySQL High Availability Sprint: Launch the Pacemaker! Florian Haas hastexo
  • 2. MySQL HA Sprint: Get Prepared! ● Please grab a DVD from your table! ● We have 12 in total – please share if needed! ● Follow instructions in README.pdf. ● If your laptop does not have a DVD drive, please see me for a USB stick. ● For any questions, I'm the guy in the blue shirt who answers to “Florian”. When in doubt, just holler.
  • 3. Florian Haas CEO & Principal Consultant, hastexo http://www.hastexo.com/who/florian florian@hastexo.com
  • 4. Visual Cues & Clues How to follow this talk easily
  • 5. This layout means: Would you treat me to the courtesy of your kind attention?
  • 6. This layout means: ● I'd ask you to do this, ● and this, ● and this.
  • 8. An Overview of the Linux HA stack (for MySQL)
  • 9. Application Interface MySQL RA Cluster Resource Mgmt Pacemaker Cluster Messaging Corosync Storage Replication DRBD (optional)
  • 10. Physical DRBD Physical Host Host MySQL Master MySQL MySQL MySQL App App Slave Slave Slave Server Server
  • 11. Physical DRBD Physical Host Host MySQL Master MySQL MySQL MySQL App App Slave Slave Slave Server Server
  • 12. DRBD http://www.hastexo.com/knowledge/drbd http://www.drbd.org DRBD & the DRBD logo are registered trademarks of Linbit Information Technologies
  • 13. Create a DRBD resource! ● Name: mysql ● Device name: /dev/drbd0 ● Backing disk: /dev/sdb1 ● Meta data: internal ● Replication: 192.168.133.111 ↔ 112 Port 7788 Hint: use “legacy” (pre-8.4) DRBD User's Guide
  • 15. Create a Corosync Cluster! ● Enable secauth ● 2 rings, RRP mode: active ● Multicast addresses: 239.255.42.0 and .1 ● Network addresses: 192.168.122.0 and .133.0 ● No logging to files, syslog only ● Start Corosync ● Check connectivity (corosync-cfgtool -s)
  • 17. Create a Pacemaker Cluster ● Add the “pacemaker” service to /etc/corosync.d ● Use ver: 1 ● Restart corosync ● Start pacemakerd ● Verify both nodes have joined the cluster (crm_mon)
  • 19. Set up your cluster ● Open the shell with crm configure ● Set no-quorum-policy to ignore ● Disable STONITH ● Kids, don't do this at home! ● Commit the configuration
  • 21. Set up a floating IP address ● Add an IPaddr2 resource ● Name: p_ip_mysql ● IP: 192.168.122.110 ● CIDR Netmask: 24 ● NIC: eth0 ● Commit the configuration
  • 23. Add resource monitoring ● Add a monitor operation to p_ip_mysql ● Interval: 10s ● Commit the configuration ● Manually delete the IP address ● Watch with crm_mon -rf ● Observe resource recovery
  • 25. Started start stop Stopped
  • 26. Started Started start stop start stop Stopped Stopped
  • 27. Master promote demote Slave Slave start stop start stop Stopped Stopped
  • 28. Add a DRBD Master/Slave Set ● Create the DRBD primitive p_drbd_mysql ● Use the ocf:linbit:drbd RA ● Add 2 monitor operations (role=Master, role=Slave) with non-equal intervals ● Wrap it in a master/slave set ● notify=true, clone-max=2, master-max=1 ● Commit the configuration ● Watch the cluster promote
  • 30. Create a Filesystem ● Run mkfs -t ext3 on whichever node is the Master ● Add the Filesystem resource ● Name: p_fs_mysql ● Device: /dev/drbd0 ● Directory: /var/lib/mysql ● File system type: ext3 ● Add required order & colocation constraints
  • 32. Add a Group ● Create the g_mysql resource group ● Add p_fs_mysql and p_ip_mysql ● Watch the constraints update automagically
  • 34. Add the MySQL resource ● Run mysql_install_db ● Create an ocf:heartbeat:mysql primitive p_mysql ● Set additional_parameters: --bind-address 192.168.122.110 ● Add resource level monitoring ● Add it to the g_mysql group ● Commit, Rejoice!
  • 36. Physical DRBD Physical Host Host MySQL Master MySQL MySQL MySQL App App Slave Slave Slave Server Server
  • 37. Physical DRBD Physical Host Host MySQL Master MySQL MySQL MySQL App App Slave Slave Slave Server Server
  • 38. Physical Physical Host Host MySQL InnoDB Recovery Master Umm.. WTF? Hurry up! MySQL MySQL MySQL App App Slave Slave Slave Server Server Booooring
  • 39. Physical Physical Host Host MySQL Master MySQL MySQL MySQL App App Slave Slave Slave Server Server
  • 40. Further Information http://www.hastexo.com http://twitter.com/hastexo
  • 41. Liked this talk? ● Go to www.hastexo.com/shoutbox ● Log in (you can just use your OpenID from Wordpress, Blogger, Yahoo, Google Apps, Google Profile) ● Leave us a message!