MariaDB Cluster for High Availability
World Most Advanced Open Source Database Cluster
April 29, 2015
Sonali Minocha and Abdul Manaf
Maria DB Galera Cluster for High Availability
Introducing OSSCube
• Global Solutions Provider
• Consulting, Development, Integration, and Support
• Develop Integrated Enterprise Business Solutions
• Open Source
• CMMI Level 3 accredited
• Continuous Delivery for fast, predictable projects
• Flexible Delivery Model
• Support Projects or Staff Augmentation
• Scale up or down as required
OSSCube Practice Areas
• PHP – The World’s Only Zend Center of Excellence
• CRM - SugarCRM
• Marketing Automation – Act-On
• Content Management System – Drupal
• Product Information Management - Pimcore
• Enterprise Mobile and Web applications
• E-Commerce – Magento
• BPM and Workflow – BonitaSoft and ProcessMaker
• Enterprise Architecture and Consulting
• BI and Data Integration – Pentaho and Talend
• Big Data – Hadoop, Cloudera, Spark
• Database – MySQL, MariaDB
• Cloud based large computing capacity - AWS
Integrated Business Solutions
Webinar Agenda
• Concept of High Availability
• MySQL native replication and problems
• Overview of Galera cluster
• Galera cluster architecture
• MariaDB Galera 3 Node Implementation
High Availability
• High availability is a system design protocol and associated implementation that ensures a
certain degree of operational continuity during a given measurement period
• High availability refers to the ability of users to access a system without loss of service
Do you need high availability ? If you are not certain, consider the following question:
• Which level of availability do I need?
– How many nines? or How much downtime can your business survive?
• Do I require no loss of data?
– Could I loose some transactions?
– Will my users notice or care?
• Do I need automatic fail over or is manual switchover OK?
– How do I test this?
Availability Calculation
Availability = Uptime / (Uptime + Downtime)
Principles and Causes of loosing HA
Principles of High Availability
• Elimination of single points of failure
• Reliable crossover. In multi threaded systems, the crossover point itself tends to become a
single point of failure. High availability engineering must provide for reliable crossover.
• Detection of failures as they occur. If the two principles above are observed, then a user may
never see a failure. But the maintenance activity must.
Scheduled and unscheduled downtime
Causes of loosing it (unscheduled downtime)
• Failures of hosts
• Failures of Databases / MySQL
• Operating system
• The hardware
• Maintenance activity that may otherwise cause downtime
• And many more ……
MySQL HA Solutions
The primary solutions supported by MySQL include:
• MySQL Native Replication
• MySQL Cluster
• MySQL with DRBD
• Oracle VM Template for MySQL
• MySQL with Solaris Cluster
• MariaDB Galera Cluster
We will be covering:
• MySQL Native Replication Issues
• MariaDB Galera Cluster
Replication Overview and Components
• One of the “killer” features of MySQL
• Introduced in version 3.23
• Master
– Binary logs
• Row Format
• Statement Format
– Bin log dump thread on master
• Slave
– Relay logs
– IO and SQL thread on slave
– master.info and relay-log.info files
• Row format was introduced in 5.1
• Lots of improvements in 5.6
Replication Topologies Summary
Limitations and Known Issues
• Human error: updating slave instead of master
• Non-deterministic SQL, bugs, and other
• Binary Logging format issue
– Row
– Statement
• Limited availability
– Replication can break
– Replication can lag behind
– Replication can be out of sync
• Manual or at best semi-automatic fail over, tricky to automate.
• Limited write capacity: single threaded ( Up to MySQL 5.5 ) causes
slave lag
• Asynchronous = You will lose data
Master/Slave Based Failover
Simplest example, plain replication
Widely used
Manual failover
Manual operation required
Master-Master Based Failover
Using MMM
Transfer IP1 and IP to the
surviving server
Other Issues
• Duplicate Error on Slave
• Query caused different error on Master and
Slave
• Temp Table doesn't exist after slave restarts
• Binary log and relay log corruption
• Slave read from wrong position after crash
• And many more...
Galera cluster
Overview of Galera Cluster
Galera Cluster Features & Benefits
• Synchronous replication
• Active-Active multi-master topology
• Read and write to any cluster node
• Automatic membership control, failed nodes drop from the cluster
• Automatic node joining
• True parallel replication, on row level
• Direct client connections, native MySQL look & feel
• Available on Linux only
• No slave lag
• No lost transactions
• Both read and write scalability
• Smaller client latencies
Galera Cluster
• Provides virtually synchronous
replication
• Works with InnoDB
• No slave lag
• Transactions are validated by
slave on Transaction commit
– Certification based
replication
• Master – Master or Master –
Slave is possible
Certification Based Replication
• Certification-based replication uses group
communication and transaction ordering techniques to
achieve synchronous replication.
What Certification Based Replication Requires
• Transactional Database
• Atomic Changes
• Global Ordering
Certification Based Replication
Internal Architecture of Galera Cluster
Galera Cluster revolves around four components:
• Database Management System (DBMS)
• wsrep API
– wsrep hooks
– dlopen()
• Galera Replication Plugin
• Group Communication Plugins
State Transfers
The process of replicating data from the cluster to the individual node,
bringing the node into sync with the cluster, is known as
provisioning.
Methods available in Galera Cluster to provision nodes
• State Snapshot Transfers (SST) Where a snapshot of the entire node
state transfers.
• Incremental State Transfers (IST) Where only the missing
transactions transfer.
State Snapshot Transfers (SST)
The cluster provisions nodes by transferring a
full data copy from one node to another.
• Logical
– mysqldump
• Physical
– rsync
– xtrabackup
Incremental State Transfers (IST)
The cluster provisions a node by identifying the missing transactions
on the joiner and sends them only, instead of the entire state.
• This provisioning method is only available under certain conditions:
– Where the joiner node state UUID is the same as that of the group.
– Where all missing write-sets are available in the donor’s write-set
cache.
• For example, say that you have a node in your cluster that falls
behind the cluster.
• This node carries a node state that reads: 5a76ef62-30ec-11e1-
0800-dba504cf2aab:197222 Meanwhile, the current node state on
the cluster reads 5a76ef62-30ec-11e1-0800-dba504cf2aab:201913
Galera Cluster is
Important Status Variables
MySQL Native Replication Galera Cluster
Implementation
MariaDB 3 Node Cluster Implementation
How To Configure a Galera Cluster with MariaDB
on Ubuntu 12.04 Servers
• Basic set up for MariaDB Galera Cluster requires minimum of 3 Nodes
• In our demo we will be using 3 Linux ubuntu 12.04 nodes
• In order to configure cluster we will be following some basic steps on every node , on Node1 execute following steps
• STEP 1 : Remove old MySQL if already installed for fresh installation
– apt-get remove --purge mysql-server mysql-client mysql-common
– apt-get autoremove
– apt-get autoclean
• STEP 2 : Add the MariaDB Repositories
– apt-get install python-software-properties
– apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
– add-apt-repository 'deb http://mirror3.layerjet.com/mariadb/repo/10.0/ubuntu precise main‘
– apt-get update
• STEP 3 : Install MariaDB with Galera Patches
– apt-get install rsync
– apt-get install galera
– apt-get install mariadb-galera-server
How To Configure a Galera Cluster with MariaDB
on Ubuntu 12.04 Servers
• STEP 4 : Configure MariaDB and Galera
– Create Galera configuration file under /etc/mysql/conf.d/
– Most basic Galera configuration
[mysqld]
#mysql settings
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2
query_cache_size=0
query_cache_type=0
bind-address=0.0.0.0
#galera settings
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_cluster_name="my_wsrep_cluster"
wsrep_cluster_address="gcomm://192.168.10.184,192.168.10.185,192.168.10.186“ ## IP of nodes who will be part of cluster
wsrep_sst_method=rsync
• STEP 1 to STEP 4 will be followed on every Node
Starting the Galera Cluster
• After Step 4 MariaDB is ready to run individually on every node
Starting nodes to run as part of cluster
• Stop MySQL on all nodes
– service mysql stop
• On Node1 Start MySQL to run as cluster
– service mysql start --wsrep-new-cluster
• On All other nodes start mysql simply as
– service mysql start
– Check the variable “wsrep_cluster_size%”
Thank You!
We love to connect with you.
Twitter (@OSSCubeIndia)
Facebook (www.facebook.com/osscubeindia)
LinkedIn (www.linkedin.com/company/osscube)
Google+ (plus.google.com/u/0/+OSSCubeIndia/posts )

More Related Content

PDF
Galera cluster for high availability
PDF
Introduction to Galera Cluster
PDF
MariaDB MaxScale: an Intelligent Database Proxy
PDF
Best practices for MySQL/MariaDB Server/Percona Server High Availability
PDF
MariaDB Galera Cluster presentation
PDF
The Complete MariaDB Server tutorial
PPTX
ProxySQL for MySQL
PDF
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Galera cluster for high availability
Introduction to Galera Cluster
MariaDB MaxScale: an Intelligent Database Proxy
Best practices for MySQL/MariaDB Server/Percona Server High Availability
MariaDB Galera Cluster presentation
The Complete MariaDB Server tutorial
ProxySQL for MySQL
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )

What's hot (20)

PDF
Top 5 Mistakes When Writing Spark Applications
PPT
Nginx internals
PPTX
Kafka Tutorial: Kafka Security
PDF
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
PPT
Introduction to redis
PDF
Introduction to Redis
PPTX
Running MariaDB in multiple data centers
PDF
How to Manage Scale-Out Environments with MariaDB MaxScale
PPTX
Supporting Apache HBase : Troubleshooting and Supportability Improvements
PDF
Paris Redis Meetup Introduction
PDF
What is new in PostgreSQL 14?
PDF
How to upgrade like a boss to MySQL 8.0 - PLE19
KEY
Introduction to memcached
PDF
MySQL High Availability Solutions
PDF
Mutiny + quarkus
PDF
MariaDB Administrator 교육
PDF
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
PPTX
Maxscale 소개 1.1.1
PDF
Hive tuning
PPTX
Best practices for ansible
Top 5 Mistakes When Writing Spark Applications
Nginx internals
Kafka Tutorial: Kafka Security
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Introduction to redis
Introduction to Redis
Running MariaDB in multiple data centers
How to Manage Scale-Out Environments with MariaDB MaxScale
Supporting Apache HBase : Troubleshooting and Supportability Improvements
Paris Redis Meetup Introduction
What is new in PostgreSQL 14?
How to upgrade like a boss to MySQL 8.0 - PLE19
Introduction to memcached
MySQL High Availability Solutions
Mutiny + quarkus
MariaDB Administrator 교육
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Maxscale 소개 1.1.1
Hive tuning
Best practices for ansible
Ad

Viewers also liked (20)

PDF
Best practices for MySQL High Availability
PPTX
MySQL High Availability Solutions - Feb 2015 webinar
PDF
Alta Disponibilidade em Linux com Heartbeat e Drbd
PDF
CELC - Архитектура коммутаторов Catalyst 4500
PDF
Galera Cluster DDL and Schema Upgrades 220217
PPT
Galera Cluster Best Practices for DBA's and DevOps Part 1
PDF
Introduction to Galera
PDF
MariaDB Galera Cluster - Simple, Transparent, Highly Available
PDF
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
PPT
The OSSCube MySQL High Availability Tutorial
PDF
Webinar Slides: Migrating to Galera Cluster
PDF
Zero Downtime Schema Changes - Galera Cluster - Best Practices
PDF
ProxySQL Tutorial - PLAM 2016
PPTX
スケーラブルMoodle@Moodle Moot 2017JP
PPTX
オンプレサポート及び大学向けMoodle@Moodle Moot 2017JP
PPTX
Indexing the MySQL Index: Key to performance tuning
PDF
high availability case study fusion middleware cluster1
PDF
High Availability with Novell Cluster Services for Novell Open Enterprise Ser...
PPTX
OAuth2介紹
PPTX
Docker集群管理 工具篇
Best practices for MySQL High Availability
MySQL High Availability Solutions - Feb 2015 webinar
Alta Disponibilidade em Linux com Heartbeat e Drbd
CELC - Архитектура коммутаторов Catalyst 4500
Galera Cluster DDL and Schema Upgrades 220217
Galera Cluster Best Practices for DBA's and DevOps Part 1
Introduction to Galera
MariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
The OSSCube MySQL High Availability Tutorial
Webinar Slides: Migrating to Galera Cluster
Zero Downtime Schema Changes - Galera Cluster - Best Practices
ProxySQL Tutorial - PLAM 2016
スケーラブルMoodle@Moodle Moot 2017JP
オンプレサポート及び大学向けMoodle@Moodle Moot 2017JP
Indexing the MySQL Index: Key to performance tuning
high availability case study fusion middleware cluster1
High Availability with Novell Cluster Services for Novell Open Enterprise Ser...
OAuth2介紹
Docker集群管理 工具篇
Ad

Similar to Maria DB Galera Cluster for High Availability (20)

PDF
The MySQL High Availability Landscape and where Galera Cluster fits in
PDF
Highly Available Load Balanced Galera MySql Cluster
PDF
High-level architecture of a complete MariaDB deployment
PDF
Best Practice for Achieving High Availability in MariaDB
PPT
Taking Full Advantage of Galera Multi Master Cluster
PDF
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
PDF
Galera Cluster 4 for MySQL 8 Release Webinar slides
PPTX
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
PDF
MariaDB Galera Cluster webinar — 2025 Edition.pdf
PDF
MariaDB High Availability Webinar
PDF
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
PPTX
MariaDB High Availability
PDF
M|18 Under the Hood: Galera Cluster
PDF
Scaling with sync_replication using Galera and EC2
PDF
Planning for Disaster Recovery (DR) with Galera Cluster
PPTX
Galera Mysql
PDF
OSDC 2017 | Lessons from database failures by Colin Charles
PDF
Using all of the high availability options in MariaDB
PDF
What’s new in Galera 4
PPT
Codership's galera cluster installation and quickstart webinar march 2016
The MySQL High Availability Landscape and where Galera Cluster fits in
Highly Available Load Balanced Galera MySql Cluster
High-level architecture of a complete MariaDB deployment
Best Practice for Achieving High Availability in MariaDB
Taking Full Advantage of Galera Multi Master Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #2: Galera Cluster
Galera Cluster 4 for MySQL 8 Release Webinar slides
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
MariaDB Galera Cluster webinar — 2025 Edition.pdf
MariaDB High Availability Webinar
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
MariaDB High Availability
M|18 Under the Hood: Galera Cluster
Scaling with sync_replication using Galera and EC2
Planning for Disaster Recovery (DR) with Galera Cluster
Galera Mysql
OSDC 2017 | Lessons from database failures by Colin Charles
Using all of the high availability options in MariaDB
What’s new in Galera 4
Codership's galera cluster installation and quickstart webinar march 2016

More from OSSCube (20)

PPTX
High Availability Using MySQL Group Replication
PPTX
Accelerate Your Digital Transformation Journey with Pimcore
PPTX
Migrating Legacy Applications to AWS Cloud: Strategies and Challenges
PPTX
Why Does Omnichannel Experience Matter to Your Customers
PPTX
Using MySQL Fabric for High Availability and Scaling Out
PPTX
Webinar: Five Ways a Technology Refresh Strategy Can Help Make Your Digital T...
PPTX
Cutting Through the Disruption
PPTX
Legacy to industry leader: a modernization case study
PPTX
Marketing and Sales together at last
PPTX
Using pim to maximize revenue and improve customer satisfaction
PPTX
Talend for the Enterprise
PPTX
Ahead of the Curve
PPTX
Non functional requirements. do we really care…?
PPTX
Learning from experience: Collaborative Journey towards CMMI
PPTX
Exploiting JXL using Selenium
PPTX
Introduction to AWS
PDF
Talend Open Studio Introduction - OSSCamp 2014
PDF
Performance Testing Session - OSSCamp 2014
PDF
Job Queue Presentation - OSSCamp 2014
PDF
Introduction to Business Process Model and Notation (BPMN) - OSSCamp 2014
High Availability Using MySQL Group Replication
Accelerate Your Digital Transformation Journey with Pimcore
Migrating Legacy Applications to AWS Cloud: Strategies and Challenges
Why Does Omnichannel Experience Matter to Your Customers
Using MySQL Fabric for High Availability and Scaling Out
Webinar: Five Ways a Technology Refresh Strategy Can Help Make Your Digital T...
Cutting Through the Disruption
Legacy to industry leader: a modernization case study
Marketing and Sales together at last
Using pim to maximize revenue and improve customer satisfaction
Talend for the Enterprise
Ahead of the Curve
Non functional requirements. do we really care…?
Learning from experience: Collaborative Journey towards CMMI
Exploiting JXL using Selenium
Introduction to AWS
Talend Open Studio Introduction - OSSCamp 2014
Performance Testing Session - OSSCamp 2014
Job Queue Presentation - OSSCamp 2014
Introduction to Business Process Model and Notation (BPMN) - OSSCamp 2014

Recently uploaded (20)

PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PPTX
MuleSoft-Compete-Deck for midddleware integrations
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
Build Real-Time ML Apps with Python, Feast & NoSQL
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
The AI Revolution in Customer Service - 2025
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PDF
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
PPTX
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
PDF
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
PDF
LMS bot: enhanced learning management systems for improved student learning e...
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
MuleSoft-Compete-Deck for midddleware integrations
NewMind AI Weekly Chronicles – August ’25 Week IV
Build Real-Time ML Apps with Python, Feast & NoSQL
giants, standing on the shoulders of - by Daniel Stenberg
The AI Revolution in Customer Service - 2025
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
INTERSPEECH 2025 「Recent Advances and Future Directions in Voice Conversion」
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
LMS bot: enhanced learning management systems for improved student learning e...
EIS-Webinar-Regulated-Industries-2025-08.pdf
Data Virtualization in Action: Scaling APIs and Apps with FME
Electrocardiogram sequences data analytics and classification using unsupervi...
Lung cancer patients survival prediction using outlier detection and optimize...
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
Build automations faster and more reliably with UiPath ScreenPlay

Maria DB Galera Cluster for High Availability

  • 1. MariaDB Cluster for High Availability World Most Advanced Open Source Database Cluster April 29, 2015 Sonali Minocha and Abdul Manaf
  • 3. Introducing OSSCube • Global Solutions Provider • Consulting, Development, Integration, and Support • Develop Integrated Enterprise Business Solutions • Open Source • CMMI Level 3 accredited • Continuous Delivery for fast, predictable projects • Flexible Delivery Model • Support Projects or Staff Augmentation • Scale up or down as required
  • 4. OSSCube Practice Areas • PHP – The World’s Only Zend Center of Excellence • CRM - SugarCRM • Marketing Automation – Act-On • Content Management System – Drupal • Product Information Management - Pimcore • Enterprise Mobile and Web applications • E-Commerce – Magento • BPM and Workflow – BonitaSoft and ProcessMaker • Enterprise Architecture and Consulting • BI and Data Integration – Pentaho and Talend • Big Data – Hadoop, Cloudera, Spark • Database – MySQL, MariaDB • Cloud based large computing capacity - AWS
  • 6. Webinar Agenda • Concept of High Availability • MySQL native replication and problems • Overview of Galera cluster • Galera cluster architecture • MariaDB Galera 3 Node Implementation
  • 7. High Availability • High availability is a system design protocol and associated implementation that ensures a certain degree of operational continuity during a given measurement period • High availability refers to the ability of users to access a system without loss of service Do you need high availability ? If you are not certain, consider the following question: • Which level of availability do I need? – How many nines? or How much downtime can your business survive? • Do I require no loss of data? – Could I loose some transactions? – Will my users notice or care? • Do I need automatic fail over or is manual switchover OK? – How do I test this?
  • 8. Availability Calculation Availability = Uptime / (Uptime + Downtime)
  • 9. Principles and Causes of loosing HA Principles of High Availability • Elimination of single points of failure • Reliable crossover. In multi threaded systems, the crossover point itself tends to become a single point of failure. High availability engineering must provide for reliable crossover. • Detection of failures as they occur. If the two principles above are observed, then a user may never see a failure. But the maintenance activity must. Scheduled and unscheduled downtime Causes of loosing it (unscheduled downtime) • Failures of hosts • Failures of Databases / MySQL • Operating system • The hardware • Maintenance activity that may otherwise cause downtime • And many more ……
  • 10. MySQL HA Solutions The primary solutions supported by MySQL include: • MySQL Native Replication • MySQL Cluster • MySQL with DRBD • Oracle VM Template for MySQL • MySQL with Solaris Cluster • MariaDB Galera Cluster We will be covering: • MySQL Native Replication Issues • MariaDB Galera Cluster
  • 11. Replication Overview and Components • One of the “killer” features of MySQL • Introduced in version 3.23 • Master – Binary logs • Row Format • Statement Format – Bin log dump thread on master • Slave – Relay logs – IO and SQL thread on slave – master.info and relay-log.info files • Row format was introduced in 5.1 • Lots of improvements in 5.6
  • 13. Limitations and Known Issues • Human error: updating slave instead of master • Non-deterministic SQL, bugs, and other • Binary Logging format issue – Row – Statement • Limited availability – Replication can break – Replication can lag behind – Replication can be out of sync • Manual or at best semi-automatic fail over, tricky to automate. • Limited write capacity: single threaded ( Up to MySQL 5.5 ) causes slave lag • Asynchronous = You will lose data
  • 14. Master/Slave Based Failover Simplest example, plain replication Widely used Manual failover Manual operation required
  • 15. Master-Master Based Failover Using MMM Transfer IP1 and IP to the surviving server
  • 16. Other Issues • Duplicate Error on Slave • Query caused different error on Master and Slave • Temp Table doesn't exist after slave restarts • Binary log and relay log corruption • Slave read from wrong position after crash • And many more...
  • 17. Galera cluster Overview of Galera Cluster
  • 18. Galera Cluster Features & Benefits • Synchronous replication • Active-Active multi-master topology • Read and write to any cluster node • Automatic membership control, failed nodes drop from the cluster • Automatic node joining • True parallel replication, on row level • Direct client connections, native MySQL look & feel • Available on Linux only • No slave lag • No lost transactions • Both read and write scalability • Smaller client latencies
  • 19. Galera Cluster • Provides virtually synchronous replication • Works with InnoDB • No slave lag • Transactions are validated by slave on Transaction commit – Certification based replication • Master – Master or Master – Slave is possible
  • 20. Certification Based Replication • Certification-based replication uses group communication and transaction ordering techniques to achieve synchronous replication. What Certification Based Replication Requires • Transactional Database • Atomic Changes • Global Ordering
  • 22. Internal Architecture of Galera Cluster Galera Cluster revolves around four components: • Database Management System (DBMS) • wsrep API – wsrep hooks – dlopen() • Galera Replication Plugin • Group Communication Plugins
  • 23. State Transfers The process of replicating data from the cluster to the individual node, bringing the node into sync with the cluster, is known as provisioning. Methods available in Galera Cluster to provision nodes • State Snapshot Transfers (SST) Where a snapshot of the entire node state transfers. • Incremental State Transfers (IST) Where only the missing transactions transfer.
  • 24. State Snapshot Transfers (SST) The cluster provisions nodes by transferring a full data copy from one node to another. • Logical – mysqldump • Physical – rsync – xtrabackup
  • 25. Incremental State Transfers (IST) The cluster provisions a node by identifying the missing transactions on the joiner and sends them only, instead of the entire state. • This provisioning method is only available under certain conditions: – Where the joiner node state UUID is the same as that of the group. – Where all missing write-sets are available in the donor’s write-set cache. • For example, say that you have a node in your cluster that falls behind the cluster. • This node carries a node state that reads: 5a76ef62-30ec-11e1- 0800-dba504cf2aab:197222 Meanwhile, the current node state on the cluster reads 5a76ef62-30ec-11e1-0800-dba504cf2aab:201913
  • 27. Important Status Variables MySQL Native Replication Galera Cluster
  • 28. Implementation MariaDB 3 Node Cluster Implementation
  • 29. How To Configure a Galera Cluster with MariaDB on Ubuntu 12.04 Servers • Basic set up for MariaDB Galera Cluster requires minimum of 3 Nodes • In our demo we will be using 3 Linux ubuntu 12.04 nodes • In order to configure cluster we will be following some basic steps on every node , on Node1 execute following steps • STEP 1 : Remove old MySQL if already installed for fresh installation – apt-get remove --purge mysql-server mysql-client mysql-common – apt-get autoremove – apt-get autoclean • STEP 2 : Add the MariaDB Repositories – apt-get install python-software-properties – apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db – add-apt-repository 'deb http://mirror3.layerjet.com/mariadb/repo/10.0/ubuntu precise main‘ – apt-get update • STEP 3 : Install MariaDB with Galera Patches – apt-get install rsync – apt-get install galera – apt-get install mariadb-galera-server
  • 30. How To Configure a Galera Cluster with MariaDB on Ubuntu 12.04 Servers • STEP 4 : Configure MariaDB and Galera – Create Galera configuration file under /etc/mysql/conf.d/ – Most basic Galera configuration [mysqld] #mysql settings binlog_format=ROW default-storage-engine=innodb innodb_autoinc_lock_mode=2 query_cache_size=0 query_cache_type=0 bind-address=0.0.0.0 #galera settings wsrep_provider=/usr/lib/galera/libgalera_smm.so wsrep_cluster_name="my_wsrep_cluster" wsrep_cluster_address="gcomm://192.168.10.184,192.168.10.185,192.168.10.186“ ## IP of nodes who will be part of cluster wsrep_sst_method=rsync • STEP 1 to STEP 4 will be followed on every Node
  • 31. Starting the Galera Cluster • After Step 4 MariaDB is ready to run individually on every node Starting nodes to run as part of cluster • Stop MySQL on all nodes – service mysql stop • On Node1 Start MySQL to run as cluster – service mysql start --wsrep-new-cluster • On All other nodes start mysql simply as – service mysql start – Check the variable “wsrep_cluster_size%”
  • 32. Thank You! We love to connect with you. Twitter (@OSSCubeIndia) Facebook (www.facebook.com/osscubeindia) LinkedIn (www.linkedin.com/company/osscube) Google+ (plus.google.com/u/0/+OSSCubeIndia/posts )