SlideShare a Scribd company logo
MySQL Cluster Training
                                 presented by severalnines.com




                                                                      Address:
 Contact:                                                      Severalnines AB
 Jean-Jérôme Schmidt                                        c/o SICS, Box 1263
 Email: services@severalnines.com                            Isafjordsgatan 22
                                                               SE-164-29 Kista


Copyright 2011 Severalnines AB                              Control your database infrastructure   1
Introduction

       • At Severalnines, we believe in sharing information
         and knowledge; we all come from an open source
         background
       • We know a lot of things about MySQL Cluster and
         think that MySQL Cluster is a great technology
       • These free MySQL Cluster Training slides are a
         contribution of ours to the knowledge and information
         sharing that’s common practice in the open source
         community
       • If you have any questions on these slides or would
         like to book an actual training class, please contact
         us at: services@severalnines.com

Copyright 2011 Severalnines AB                   Control your database infrastructure   2
Training Slides - Concept

       • Over the coming weeks we will be chronologically
         releasing slides for the different sections of our
         MySQL Cluster Training program on our website.
       • The full agenda of the training with all of its modules
         is outlined in the next slides so that you can see what
         topics will be covered over the coming weeks.
       • Particularly specialised topics such as Cluster/J or
         NDB API are not fully covered in the slides. We
         recommend our instructor-led training classes for
         such topics.
       • Please contact us for more details:
         services@severalnines.com

Copyright 2011 Severalnines AB                    Control your database infrastructure   3
Full Training Agenda (1/4)
       •    MySQL Cluster Introduction
              –   MySQL eco system
              –   Scale up, scale out, and sharding
              –   MySQL Cluster Architecture
              –   Use cases
              –   Features
              –   Node types and Roles
       •    Detailed Concepts
              –   Data Distribution
              –   Verifying data distribution
              –   Access Methods
              –   Partitioning
              –   Node failures and failure detection
              –   Network Partitioning
              –   Transactions and Locking
              –   Consistency Model
              –   Redo logging and Checkpointing
       •    Internals
              –   NDB Design Internals


Copyright 2011 Severalnines AB                          Control your database infrastructure   4
Agenda (2/4)

       •    Installing MySQL Cluster
              –   Setting up MySQL Cluster
              –   Starting/stopping nodes
              –   Recovery and restarts
              –   Upgrading configuration
              –   Upgrading Cluster
       •    Performance Tuning (instructor-led only; contact us at services@severalnines.com)
              –   Differences compared to Innodb/MyISAM
              –   Designing efficient and fast applications
              –   Identifying bottlenecks
              –   Tweaking configuration (OS and MySQL Cluster)
              –   Query Tuning
              –   Schema Design
              –   Index Tuning




Copyright 2011 Severalnines AB                                        Control your database infrastructure   5
Agenda (3/4)

       •    Management and Administration
              –   Backup and Restore
              –   Geographical Replication
              –   Online and offline operations
              –   Ndbinfo tables
              –   Reporting
              –   Single user mode
              –   Scaling Cluster
       •    Disk Data
              –   Use cases
              –   Limitations
              –   Best practice configuration
       •    Designing a Cluster
              –   Capacity Planning and Dimensioning
              –   Hardware recommendations
              –   Best practice Configuration
              –   Storage calculations



Copyright 2011 Severalnines AB                          Control your database infrastructure   6
Agenda (4/4)

       •    Resolving Issues
              –   Common problems
              –   Error logs and Tracefiles
              –   Recovery and Escalation procedures
       •    Connectivity Overview
              –   NDBAPI
              –   Cluster/J
              –   LDAP
       •    Severalnines Tools
              –   Monitoring and Management
              –   Benchmarking
              –   Sandboxes
              –   Configuration and capacity planning
       •    Conclusion




Copyright 2011 Severalnines AB                          Control your database infrastructure   7
Agenda: Lab Exercises
            (only applicable to instructor-led training classes)


       •    Lab Exercises
              –   Installing and Loading data into MySQL Cluster
              –   Starting/stopping nodes, recovery
              –   Query tuning
              –   Backup and Restore
              –   Configuration Upgrade


       •    Would you like to try something particular?
              –   This is possible too, speak with your instructor




Copyright 2011 Severalnines AB                                       Control your database infrastructure   8
Prerequisites
       •    Readers / Participants have understanding of SQL and basic database concepts.

       •    Laptops/PCs for hands-on exercises
       •    Linux: 1GB RAM
       •    Windows: 2GB RAM
       •    Approx. 20GB disk space and Virtualbox installed.
       •    Virtualbox can be downloaded for free at http://www.virtualbox.org/wiki/Downloads

       •    MySQL Cluster version 7.1 or later




Copyright 2011 Severalnines AB                                                  Control your database infrastructure   9
6th Installment
              Severalnines Cluster Self-Training


                 Part 4: Installing MySQL Cluster




Copyright 2011 Severalnines AB             Control your database infrastructure   10
Topics covered in Installment 6


     • Configuration
     • Installation




Copyright 2011 Severalnines AB             Control your database infrastructure   11
Part 4: Installing MySQL Cluster

                    Configuration and Installation




Copyright 2011 Severalnines AB               Control your database infrastructure   12
Topics

       •    MySQL Cluster configuration (config.ini)
       •    MySQL Server configuration (my.cnf)
       •    Important parameters
       •    Installation
       •    Upgrading




Copyright 2011 Severalnines AB                         Control your database infrastructure   13
MySQL Cluster configuration (config.ini)

       • There are no parameter in config.ini that affects
         performance.
       • Each node and node type must be configured, and each
         node type has a group.
              – [ndb_mgmd] X <nodes> -- typically 1 or 2
              – [ndbd] X <nodes> -- between 2 and 48
              – [mysqld] / [api] X <nodes> -- from 2 and up
       • Remember, you can have 255 nodes in total in MySQL
         Cluster.
       • There are also default groups that applies to a group.
              –   [TCP DEFAULT]
              –   [NDB_MGMD DEFAULT]
              –   [NDBD DEFAULT]
              –   [MYSQLD DEFAULT]
                     • An item in [NDBD DEFAULT] applies to all [NDBD]

Copyright 2011 Severalnines AB                                     Control your database infrastructure   14
MySQL Cluster configuration (config.ini)
       [ndb_mgmd default]
       Datadir=/data/mysqlcluster
       Portnumber=1186

       [ndb_mgmd]
       Hostname=app01

       [ndb_mgmd]
       Hostname=app02

       [ndbd default]
       NoOfReplicas=2
       Datadir=/data/mysqlcluster

       [ndbd]
       Hostname=storage01

       [ndbd]
       Hostname=storage01

       [mysqld]
       [mysqld]
       [mysqld]
       [mysqld]




Copyright 2011 Severalnines AB      Control your database infrastructure   15
MySQL Server (my.cnf)
       [mysqld]
       basedir=/usr/local/mysql/
       datadir=/data/mysql
       socket=/tmp/mysql.sock
       port=3306

       ndbcluster
       ndb-connectstring=app01:1186,app02:1186

       ## the usual MySQL Server settings

       [mysql]
       Socket=/tmp/mysql.sock




Copyright 2011 Severalnines AB                      Control your database infrastructure   16
Preparations

       • Download MySQL Cluster from
         dev.mysql.com/downloads/cluster
       • On every machine
              – Copy it to every machine
                     • Using e.g scp
              –   cd /usr/local
              –   tar xvfz mysql-cluster-gpl-7.2.6-linux-x86_64-glibc23.tar.gz
              –   ln –s mysql-cluster-gpl-7.2.6-linux-x86_64-glibc23 mysql
              –   create data directories
                     • mkdir –p /data/mysql && mkdir –p /data/mysqlcluster
              – Create config directories
                     • mkdir –p /etc/mysql/



Copyright 2011 Severalnines AB                                    Control your database infrastructure   17
Preparations

       • On all Management nodes
              – Put config.ini in /etc/mysql/
       • On all MySQL servers
              – Put my.cnf in /etc/mysql/
              – Create the mysql user and group
                     • useradd mysql
                     • groupadd mysql
              – Install the system tables
                     • cd /usr/local/mysql
                     • scripts/mysql_install_db --defaults-file=/etc/mysql/my.cnf
                     • chown mysql:mysql –R /data/mysql




Copyright 2011 Severalnines AB                                       Control your database infrastructure   18
Minimal [ndbd default]
       [ndbd default]
       Datadir=/data/mysqlcluster/
       NoOfReplicas=2
       DataMemory=80M
       IndexMemory=16M
       FragmentLogFileSize=16M
       NoOfFragmentLogfiles=3

       MaxNoOfConcurrentOperations=32786
       MaxNoOfConcurrentTransactions=1024

       RedoBuffer=8M

       TransactionInactiveTimeout=0
       TransactionDeadlockDetectionTimeout=1200
       DiskCheckpointSpeed=5M
       #MaxNoOfTables
       #MaxNoOfOrderedIndexes
       #MaxNoOfUniqueHashIndexes
       #SharedGlobalMemory
       #DiskPageBufferMemory
Copyright 2011 Severalnines AB                        Control your database infrastructure   19
MySQL Server parameters

       • The following parameters affects performance
              – Ndb_cluster_connection_pool=8
                     • Each connection requires one free [mysqld] slot in config.ini
                     • With Ndb_cluster_connection_pool=1 the mysql server can
                       scale up to 4-5 simultaneous connections.
              – Ndb_auto_increment_prefetch_size=1024
                     • Each MYSQL server will cache ranges of 1024 numbers, and
                       then request a new range from the data node.
                     • Ndb_auto_increment_prefetch_size=1 means an extra
                       roundtrip for every insert on an auto_inc , really bad for
                       performance
       • This is most most important config parameter tuning.



Copyright 2011 Severalnines AB                                        Control your database infrastructure   20
Installing Cluster




Copyright 2011 Severalnines AB                        Control your database infrastructure   21
Topics

       •    Setting up MySQL Cluster
       •    Starting/stopping nodes
       •    Recovery and restarts
       •    Upgrading configuration
       •    Upgrading Cluster




Copyright 2011 Severalnines AB            Control your database infrastructure   22
Using the Configurator

       • We do recommend to use the Severalnines Cluster
         Configurator
              – www.severalnines.com/cluster-configurator
              – Rapid deployment
              – ./deploy.sh - automatically installs MySQL Cluster (or
                Galera or Replication) complete with monitoring and
                management (ClusterControl).
       • The Configurator generates configurations that has
         been proven in for a long time in Production
         environments.




Copyright 2011 Severalnines AB                              Control your database infrastructure   23
ClusterControl

       • Assists and automates mundane tasks:
              –   Configuration Management
              –   Upgrades
              –   Backup and Backup schedules
              –   Query Monitoring and Histograms
              –   Performance Management
              –   Scaling (add remove MySQL servers on demand)




Copyright 2011 Severalnines AB                           Control your database infrastructure   24
ClusterControl




Copyright 2011 Severalnines AB                    Control your database infrastructure   25
ClusterControl




Copyright 2011 Severalnines AB                    Control your database infrastructure   26
ClusterControl




Copyright 2011 Severalnines AB                    Control your database infrastructure   27
Starting MySQL Cluster

       • Management nodes must be started first
              – Otherwise no other node can join the Cluster
              – ndb_mgmd -f /etc/mysql/config.ini --configdir=/etc/mysql --
                reload
       • Start the data nodes
              – ndbmtd or ndbd
              – ndbmtd –c “management_node1, management_node2”
       • Start the mysql servers
              – mysqld –defaults-file=/etc/mysql/my.cnf &




Copyright 2011 Severalnines AB                               Control your database infrastructure   28
Simple management

       • The Management Client (ndb_mgm) can be used to
         to perform simple management:
              – ndb_mgm> ALL STATUS
              – ndb_mgm> SHOW
       • It is also possible to stop nodes (data nodes), but not
         starting them:
              – ndb_mgm> X STOP
       • Backups can also be started:
              – ndb_mgm> START BACKUP




Copyright 2011 Severalnines AB                       Control your database infrastructure   29
Rolling Restarts

       • Rolling restarts are used to perform changes on a
         running MySQL Cluster
              – Configuration Upgrade
              – Version Upgrade
              – Hardware Upgrade




Copyright 2011 Severalnines AB                      Control your database infrastructure   30
Rolling Restarts

       • Stop the management servers
              – kill -15 `pidof ndb_mgmd`
       • Start the management servers
              – Make sure you start them with --reload
       • For each data node, one by one:
              – Stop the Data nodes one by one
                     • kill -15 `pidof ndbmtd`
              – Start the Data node
       • For each mysqld node, one by one:
              – Stop the mysqld nodes one by one
                     • kill -15 `pidof mysqld`
              – Start the mysqld node

Copyright 2011 Severalnines AB                           Control your database infrastructure   31
Rolling Restarts

       • Rolling restarts are also implemented in
         ClusterControl.
              – Launch from the GUI
              – Launch from script:
                     • ./rolling-restart.sh




Copyright 2011 Severalnines AB                        Control your database infrastructure   32
Lab exercises
                        Contact us for more details

       • Setting up MySQL Cluster
       • Recovery & Restarts
       • Configurations Updates




Copyright 2011 Severalnines AB                 Control your database infrastructure   33
Upgrading Cluster Version

       • Install new binaries on all hosts
       • Perform a rolling restart




Copyright 2011 Severalnines AB                  Control your database infrastructure   34
Coming next in Installment 7:

                    Management & Administration




Copyright 2011 Severalnines AB               Control your database infrastructure   35
We hope these training slides are
                        useful to you!

            Please visit our website to view the
               next section of this training.

       For any questions, comments, feedback or to
        book a training class, please contact us at:

                        services@severalnines.com

                                 Thank you!

Copyright 2011 Severalnines AB                Control your database infrastructure   36
Disclaimer

 © Copyright 2011 Severalnines AB. All rights reserved.

 Severalnines & the Severalnines logo(s) are trademarks of Severalnines AB.

 MySQL is a registered trademark of Oracle and/or its affiliates.

 Other names may be trademarks of their respective owners.




Copyright 2011 Severalnines AB                           Control your database infrastructure   37

More Related Content

PPTX
Severalnines Self-Training: MySQL® Cluster - Part VII
Severalnines
 
PPTX
Severalnines Self-Training: MySQL® Cluster - Part II
Severalnines
 
PPTX
Severalnines Self-Training: MySQL® Cluster - Part V
Severalnines
 
PPTX
Severalnines Training: MySQL® Cluster - Part IX
Severalnines
 
PPTX
Severalnines Training: MySQL Cluster - Part X
Severalnines
 
PPTX
Severalnines Self-Training: MySQL® Cluster - Part VIII
Severalnines
 
PPT
MySQL Cluster Basics
Wagner Bianchi
 
PDF
My sql5.7 whatsnew_presentedatgids2015
Sanjay Manwani
 
Severalnines Self-Training: MySQL® Cluster - Part VII
Severalnines
 
Severalnines Self-Training: MySQL® Cluster - Part II
Severalnines
 
Severalnines Self-Training: MySQL® Cluster - Part V
Severalnines
 
Severalnines Training: MySQL® Cluster - Part IX
Severalnines
 
Severalnines Training: MySQL Cluster - Part X
Severalnines
 
Severalnines Self-Training: MySQL® Cluster - Part VIII
Severalnines
 
MySQL Cluster Basics
Wagner Bianchi
 
My sql5.7 whatsnew_presentedatgids2015
Sanjay Manwani
 

What's hot (20)

PDF
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
Continuent
 
PDF
MySQL Enterprise Backup
Mario Beck
 
PDF
Conference tutorial: MySQL Cluster as NoSQL
Severalnines
 
PDF
PayPal Big Data and MySQL Cluster
Mat Keep
 
PDF
MySQL Performance Tuning
FromDual GmbH
 
PDF
My First 100 days with a Cassandra Cluster
Gustavo Rene Antunez
 
PDF
MariaDB: Connect Storage Engine
Kangaroot
 
PDF
MySQL 5.7: Focus on InnoDB
Mario Beck
 
PDF
MySQL Cluster Scaling to a Billion Queries
Bernd Ocklin
 
PDF
My First 100 days with a MySQL DBMS
Gustavo Rene Antunez
 
PDF
MySQL High-Availability and Scale-Out architectures
FromDual GmbH
 
PPTX
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
xKinAnx
 
PPT
MySQL Features & Implementation
OSSCube
 
PPTX
My sql performance tuning course
Alberto Centanni
 
PDF
MySQL NDB Cluster 8.0
Ted Wennmark
 
PDF
MySQL Enterprise Backup (MEB)
Mydbops
 
PDF
MySQL Performance Tuning: The Perfect Scalability (OOW2019)
Mirko Ortensi
 
PPTX
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
Maris Elsins
 
PDF
Conference slides: MySQL Cluster Performance Tuning
Severalnines
 
PDF
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Jignesh Shah
 
MySQL High Availability and Disaster Recovery with Continuent, a VMware company
Continuent
 
MySQL Enterprise Backup
Mario Beck
 
Conference tutorial: MySQL Cluster as NoSQL
Severalnines
 
PayPal Big Data and MySQL Cluster
Mat Keep
 
MySQL Performance Tuning
FromDual GmbH
 
My First 100 days with a Cassandra Cluster
Gustavo Rene Antunez
 
MariaDB: Connect Storage Engine
Kangaroot
 
MySQL 5.7: Focus on InnoDB
Mario Beck
 
MySQL Cluster Scaling to a Billion Queries
Bernd Ocklin
 
My First 100 days with a MySQL DBMS
Gustavo Rene Antunez
 
MySQL High-Availability and Scale-Out architectures
FromDual GmbH
 
Ibm spectrum scale fundamentals workshop for americas part 2 IBM Spectrum Sca...
xKinAnx
 
MySQL Features & Implementation
OSSCube
 
My sql performance tuning course
Alberto Centanni
 
MySQL NDB Cluster 8.0
Ted Wennmark
 
MySQL Enterprise Backup (MEB)
Mydbops
 
MySQL Performance Tuning: The Perfect Scalability (OOW2019)
Mirko Ortensi
 
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
Maris Elsins
 
Conference slides: MySQL Cluster Performance Tuning
Severalnines
 
Best Practices of HA and Replication of PostgreSQL in Virtualized Environments
Jignesh Shah
 
Ad

Similar to Severalnines Self-Training: MySQL® Cluster - Part VI (20)

PPTX
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
Geir Høydalsvik
 
PDF
MySQL for Oracle DBAs
Mario Beck
 
PDF
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Manuel Contreras
 
PPTX
Handling Massive Writes
Liran Zelkha
 
PDF
SQL Server Clustering for Dummies
Mark Broadbent
 
PPSX
MySQL @ the University Of Nottingham
Mark Swarbrick
 
PDF
Database as a Service on the Oracle Database Appliance Platform
Maris Elsins
 
PDF
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Keith Hollman
 
PPTX
Disaster Recovery Site Implementation with MySQL
Syed Jahanzaib Bin Hassan - JBH Syed
 
PDF
MySQL At University Of Nottingham - 2018 MySQL Days
Mark Swarbrick
 
PDF
Storage Systems For Scalable systems
elliando dias
 
PPT
MySQL Strategy&Roadmap
slidethanks
 
PPT
My sqlstrategyroadmap
slidethanks
 
PDF
My sql tutorial-oscon-2012
John David Duncan
 
PDF
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
InSync2011
 
PDF
My sql crashcourse_intro_kdl
sqlhjalp
 
PDF
1 my sql20151219-kaji_ivan
Ivan Tu
 
PDF
20141011 my sql clusterv01pptx
Ivan Ma
 
PDF
Collaborate 2012 - Administering MySQL for Oracle DBAs
Nelson Calero
 
PDF
My sql competitive update
xKinAnx
 
2015: Whats New in MySQL 5.7, At Oracle Open World, November 3rd, 2015
Geir Høydalsvik
 
MySQL for Oracle DBAs
Mario Beck
 
Oracle MySQL Tutorial -- MySQL NoSQL Cloud Buenos Aires Nov, 13 2014
Manuel Contreras
 
Handling Massive Writes
Liran Zelkha
 
SQL Server Clustering for Dummies
Mark Broadbent
 
MySQL @ the University Of Nottingham
Mark Swarbrick
 
Database as a Service on the Oracle Database Appliance Platform
Maris Elsins
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Keith Hollman
 
Disaster Recovery Site Implementation with MySQL
Syed Jahanzaib Bin Hassan - JBH Syed
 
MySQL At University Of Nottingham - 2018 MySQL Days
Mark Swarbrick
 
Storage Systems For Scalable systems
elliando dias
 
MySQL Strategy&Roadmap
slidethanks
 
My sqlstrategyroadmap
slidethanks
 
My sql tutorial-oscon-2012
John David Duncan
 
Database & Technology 2 _ Marting Lambert _ Mixed Workloads Why and How.pdf
InSync2011
 
My sql crashcourse_intro_kdl
sqlhjalp
 
1 my sql20151219-kaji_ivan
Ivan Tu
 
20141011 my sql clusterv01pptx
Ivan Ma
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Nelson Calero
 
My sql competitive update
xKinAnx
 
Ad

More from Severalnines (20)

PDF
The Long Term Cost of Managed DBaaS vs Sovereign DBaaS
Severalnines
 
PPTX
Sovereign DBaaS_ A Practical Vision for Self-Implementation of DBaaS.pptx
Severalnines
 
PDF
PostgreSQL on AWS Aurora/Azure Cosmos VS EC2/Azure VMs
Severalnines
 
PDF
Localhost Conference 2024_ Building a Flexible and Scalable Database Strategy...
Severalnines
 
PDF
SREDAY London 2024 | Cloud Native Technologies: The Building Blocks of Modern...
Severalnines
 
PDF
Building a Sovereign DBaaS on K8s OpenInfra Summit Asia 2024.pdf
Severalnines
 
PDF
S-DBaaS Community Call | Introduction to Sovereign DBaaS: The why, what and how
Severalnines
 
PDF
WEBINAR SLIDES: CCX for Cloud Service Providers
Severalnines
 
PPTX
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
Severalnines
 
PDF
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
PDF
DIY DBaaS: A guide to building your own full-featured DBaaS
Severalnines
 
PDF
Cloud's future runs through Sovereign DBaaS
Severalnines
 
PPTX
Tips to drive maria db cluster performance for nextcloud
Severalnines
 
PPTX
Working with the Moodle Database: The Basics
Severalnines
 
PPTX
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
Severalnines
 
PDF
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
Severalnines
 
PDF
Webinar slides: How to Migrate from Oracle DB to MariaDB
Severalnines
 
PDF
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Severalnines
 
PDF
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Severalnines
 
PDF
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Severalnines
 
The Long Term Cost of Managed DBaaS vs Sovereign DBaaS
Severalnines
 
Sovereign DBaaS_ A Practical Vision for Self-Implementation of DBaaS.pptx
Severalnines
 
PostgreSQL on AWS Aurora/Azure Cosmos VS EC2/Azure VMs
Severalnines
 
Localhost Conference 2024_ Building a Flexible and Scalable Database Strategy...
Severalnines
 
SREDAY London 2024 | Cloud Native Technologies: The Building Blocks of Modern...
Severalnines
 
Building a Sovereign DBaaS on K8s OpenInfra Summit Asia 2024.pdf
Severalnines
 
S-DBaaS Community Call | Introduction to Sovereign DBaaS: The why, what and how
Severalnines
 
WEBINAR SLIDES: CCX for Cloud Service Providers
Severalnines
 
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
Severalnines
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
DIY DBaaS: A guide to building your own full-featured DBaaS
Severalnines
 
Cloud's future runs through Sovereign DBaaS
Severalnines
 
Tips to drive maria db cluster performance for nextcloud
Severalnines
 
Working with the Moodle Database: The Basics
Severalnines
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
Severalnines
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
Severalnines
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Severalnines
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Severalnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Severalnines
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Severalnines
 

Recently uploaded (20)

PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
The Future of Artificial Intelligence (AI)
Mukul
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 

Severalnines Self-Training: MySQL® Cluster - Part VI

  • 1. MySQL Cluster Training presented by severalnines.com Address: Contact: Severalnines AB Jean-Jérôme Schmidt c/o SICS, Box 1263 Email: [email protected] Isafjordsgatan 22 SE-164-29 Kista Copyright 2011 Severalnines AB Control your database infrastructure 1
  • 2. Introduction • At Severalnines, we believe in sharing information and knowledge; we all come from an open source background • We know a lot of things about MySQL Cluster and think that MySQL Cluster is a great technology • These free MySQL Cluster Training slides are a contribution of ours to the knowledge and information sharing that’s common practice in the open source community • If you have any questions on these slides or would like to book an actual training class, please contact us at: [email protected] Copyright 2011 Severalnines AB Control your database infrastructure 2
  • 3. Training Slides - Concept • Over the coming weeks we will be chronologically releasing slides for the different sections of our MySQL Cluster Training program on our website. • The full agenda of the training with all of its modules is outlined in the next slides so that you can see what topics will be covered over the coming weeks. • Particularly specialised topics such as Cluster/J or NDB API are not fully covered in the slides. We recommend our instructor-led training classes for such topics. • Please contact us for more details: [email protected] Copyright 2011 Severalnines AB Control your database infrastructure 3
  • 4. Full Training Agenda (1/4) • MySQL Cluster Introduction – MySQL eco system – Scale up, scale out, and sharding – MySQL Cluster Architecture – Use cases – Features – Node types and Roles • Detailed Concepts – Data Distribution – Verifying data distribution – Access Methods – Partitioning – Node failures and failure detection – Network Partitioning – Transactions and Locking – Consistency Model – Redo logging and Checkpointing • Internals – NDB Design Internals Copyright 2011 Severalnines AB Control your database infrastructure 4
  • 5. Agenda (2/4) • Installing MySQL Cluster – Setting up MySQL Cluster – Starting/stopping nodes – Recovery and restarts – Upgrading configuration – Upgrading Cluster • Performance Tuning (instructor-led only; contact us at [email protected]) – Differences compared to Innodb/MyISAM – Designing efficient and fast applications – Identifying bottlenecks – Tweaking configuration (OS and MySQL Cluster) – Query Tuning – Schema Design – Index Tuning Copyright 2011 Severalnines AB Control your database infrastructure 5
  • 6. Agenda (3/4) • Management and Administration – Backup and Restore – Geographical Replication – Online and offline operations – Ndbinfo tables – Reporting – Single user mode – Scaling Cluster • Disk Data – Use cases – Limitations – Best practice configuration • Designing a Cluster – Capacity Planning and Dimensioning – Hardware recommendations – Best practice Configuration – Storage calculations Copyright 2011 Severalnines AB Control your database infrastructure 6
  • 7. Agenda (4/4) • Resolving Issues – Common problems – Error logs and Tracefiles – Recovery and Escalation procedures • Connectivity Overview – NDBAPI – Cluster/J – LDAP • Severalnines Tools – Monitoring and Management – Benchmarking – Sandboxes – Configuration and capacity planning • Conclusion Copyright 2011 Severalnines AB Control your database infrastructure 7
  • 8. Agenda: Lab Exercises (only applicable to instructor-led training classes) • Lab Exercises – Installing and Loading data into MySQL Cluster – Starting/stopping nodes, recovery – Query tuning – Backup and Restore – Configuration Upgrade • Would you like to try something particular? – This is possible too, speak with your instructor Copyright 2011 Severalnines AB Control your database infrastructure 8
  • 9. Prerequisites • Readers / Participants have understanding of SQL and basic database concepts. • Laptops/PCs for hands-on exercises • Linux: 1GB RAM • Windows: 2GB RAM • Approx. 20GB disk space and Virtualbox installed. • Virtualbox can be downloaded for free at http://www.virtualbox.org/wiki/Downloads • MySQL Cluster version 7.1 or later Copyright 2011 Severalnines AB Control your database infrastructure 9
  • 10. 6th Installment Severalnines Cluster Self-Training Part 4: Installing MySQL Cluster Copyright 2011 Severalnines AB Control your database infrastructure 10
  • 11. Topics covered in Installment 6 • Configuration • Installation Copyright 2011 Severalnines AB Control your database infrastructure 11
  • 12. Part 4: Installing MySQL Cluster Configuration and Installation Copyright 2011 Severalnines AB Control your database infrastructure 12
  • 13. Topics • MySQL Cluster configuration (config.ini) • MySQL Server configuration (my.cnf) • Important parameters • Installation • Upgrading Copyright 2011 Severalnines AB Control your database infrastructure 13
  • 14. MySQL Cluster configuration (config.ini) • There are no parameter in config.ini that affects performance. • Each node and node type must be configured, and each node type has a group. – [ndb_mgmd] X <nodes> -- typically 1 or 2 – [ndbd] X <nodes> -- between 2 and 48 – [mysqld] / [api] X <nodes> -- from 2 and up • Remember, you can have 255 nodes in total in MySQL Cluster. • There are also default groups that applies to a group. – [TCP DEFAULT] – [NDB_MGMD DEFAULT] – [NDBD DEFAULT] – [MYSQLD DEFAULT] • An item in [NDBD DEFAULT] applies to all [NDBD] Copyright 2011 Severalnines AB Control your database infrastructure 14
  • 15. MySQL Cluster configuration (config.ini) [ndb_mgmd default] Datadir=/data/mysqlcluster Portnumber=1186 [ndb_mgmd] Hostname=app01 [ndb_mgmd] Hostname=app02 [ndbd default] NoOfReplicas=2 Datadir=/data/mysqlcluster [ndbd] Hostname=storage01 [ndbd] Hostname=storage01 [mysqld] [mysqld] [mysqld] [mysqld] Copyright 2011 Severalnines AB Control your database infrastructure 15
  • 16. MySQL Server (my.cnf) [mysqld] basedir=/usr/local/mysql/ datadir=/data/mysql socket=/tmp/mysql.sock port=3306 ndbcluster ndb-connectstring=app01:1186,app02:1186 ## the usual MySQL Server settings [mysql] Socket=/tmp/mysql.sock Copyright 2011 Severalnines AB Control your database infrastructure 16
  • 17. Preparations • Download MySQL Cluster from dev.mysql.com/downloads/cluster • On every machine – Copy it to every machine • Using e.g scp – cd /usr/local – tar xvfz mysql-cluster-gpl-7.2.6-linux-x86_64-glibc23.tar.gz – ln –s mysql-cluster-gpl-7.2.6-linux-x86_64-glibc23 mysql – create data directories • mkdir –p /data/mysql && mkdir –p /data/mysqlcluster – Create config directories • mkdir –p /etc/mysql/ Copyright 2011 Severalnines AB Control your database infrastructure 17
  • 18. Preparations • On all Management nodes – Put config.ini in /etc/mysql/ • On all MySQL servers – Put my.cnf in /etc/mysql/ – Create the mysql user and group • useradd mysql • groupadd mysql – Install the system tables • cd /usr/local/mysql • scripts/mysql_install_db --defaults-file=/etc/mysql/my.cnf • chown mysql:mysql –R /data/mysql Copyright 2011 Severalnines AB Control your database infrastructure 18
  • 19. Minimal [ndbd default] [ndbd default] Datadir=/data/mysqlcluster/ NoOfReplicas=2 DataMemory=80M IndexMemory=16M FragmentLogFileSize=16M NoOfFragmentLogfiles=3 MaxNoOfConcurrentOperations=32786 MaxNoOfConcurrentTransactions=1024 RedoBuffer=8M TransactionInactiveTimeout=0 TransactionDeadlockDetectionTimeout=1200 DiskCheckpointSpeed=5M #MaxNoOfTables #MaxNoOfOrderedIndexes #MaxNoOfUniqueHashIndexes #SharedGlobalMemory #DiskPageBufferMemory Copyright 2011 Severalnines AB Control your database infrastructure 19
  • 20. MySQL Server parameters • The following parameters affects performance – Ndb_cluster_connection_pool=8 • Each connection requires one free [mysqld] slot in config.ini • With Ndb_cluster_connection_pool=1 the mysql server can scale up to 4-5 simultaneous connections. – Ndb_auto_increment_prefetch_size=1024 • Each MYSQL server will cache ranges of 1024 numbers, and then request a new range from the data node. • Ndb_auto_increment_prefetch_size=1 means an extra roundtrip for every insert on an auto_inc , really bad for performance • This is most most important config parameter tuning. Copyright 2011 Severalnines AB Control your database infrastructure 20
  • 21. Installing Cluster Copyright 2011 Severalnines AB Control your database infrastructure 21
  • 22. Topics • Setting up MySQL Cluster • Starting/stopping nodes • Recovery and restarts • Upgrading configuration • Upgrading Cluster Copyright 2011 Severalnines AB Control your database infrastructure 22
  • 23. Using the Configurator • We do recommend to use the Severalnines Cluster Configurator – www.severalnines.com/cluster-configurator – Rapid deployment – ./deploy.sh - automatically installs MySQL Cluster (or Galera or Replication) complete with monitoring and management (ClusterControl). • The Configurator generates configurations that has been proven in for a long time in Production environments. Copyright 2011 Severalnines AB Control your database infrastructure 23
  • 24. ClusterControl • Assists and automates mundane tasks: – Configuration Management – Upgrades – Backup and Backup schedules – Query Monitoring and Histograms – Performance Management – Scaling (add remove MySQL servers on demand) Copyright 2011 Severalnines AB Control your database infrastructure 24
  • 25. ClusterControl Copyright 2011 Severalnines AB Control your database infrastructure 25
  • 26. ClusterControl Copyright 2011 Severalnines AB Control your database infrastructure 26
  • 27. ClusterControl Copyright 2011 Severalnines AB Control your database infrastructure 27
  • 28. Starting MySQL Cluster • Management nodes must be started first – Otherwise no other node can join the Cluster – ndb_mgmd -f /etc/mysql/config.ini --configdir=/etc/mysql -- reload • Start the data nodes – ndbmtd or ndbd – ndbmtd –c “management_node1, management_node2” • Start the mysql servers – mysqld –defaults-file=/etc/mysql/my.cnf & Copyright 2011 Severalnines AB Control your database infrastructure 28
  • 29. Simple management • The Management Client (ndb_mgm) can be used to to perform simple management: – ndb_mgm> ALL STATUS – ndb_mgm> SHOW • It is also possible to stop nodes (data nodes), but not starting them: – ndb_mgm> X STOP • Backups can also be started: – ndb_mgm> START BACKUP Copyright 2011 Severalnines AB Control your database infrastructure 29
  • 30. Rolling Restarts • Rolling restarts are used to perform changes on a running MySQL Cluster – Configuration Upgrade – Version Upgrade – Hardware Upgrade Copyright 2011 Severalnines AB Control your database infrastructure 30
  • 31. Rolling Restarts • Stop the management servers – kill -15 `pidof ndb_mgmd` • Start the management servers – Make sure you start them with --reload • For each data node, one by one: – Stop the Data nodes one by one • kill -15 `pidof ndbmtd` – Start the Data node • For each mysqld node, one by one: – Stop the mysqld nodes one by one • kill -15 `pidof mysqld` – Start the mysqld node Copyright 2011 Severalnines AB Control your database infrastructure 31
  • 32. Rolling Restarts • Rolling restarts are also implemented in ClusterControl. – Launch from the GUI – Launch from script: • ./rolling-restart.sh Copyright 2011 Severalnines AB Control your database infrastructure 32
  • 33. Lab exercises Contact us for more details • Setting up MySQL Cluster • Recovery & Restarts • Configurations Updates Copyright 2011 Severalnines AB Control your database infrastructure 33
  • 34. Upgrading Cluster Version • Install new binaries on all hosts • Perform a rolling restart Copyright 2011 Severalnines AB Control your database infrastructure 34
  • 35. Coming next in Installment 7: Management & Administration Copyright 2011 Severalnines AB Control your database infrastructure 35
  • 36. We hope these training slides are useful to you! Please visit our website to view the next section of this training. For any questions, comments, feedback or to book a training class, please contact us at: [email protected] Thank you! Copyright 2011 Severalnines AB Control your database infrastructure 36
  • 37. Disclaimer © Copyright 2011 Severalnines AB. All rights reserved. Severalnines & the Severalnines logo(s) are trademarks of Severalnines AB. MySQL is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Copyright 2011 Severalnines AB Control your database infrastructure 37

Editor's Notes

  • #13: Dear Jury, Just as the electric grid revolutionized access to electricity 100 years ago, we at Severalnines believe that Cloud Computing will revolutionize IT where organizations will be able to plug into extremely powerful computing resources over the network. We have already seen the beginnings of this new wave, where the current infrastructure stack is being challenged and disrupted by a whole set of new technologies. For instance, in the database market, over 40 startups have received funding over the past 18 months. Severalnines is not building yet another database product, we believe there are already a lot of good technologies available. To manage a database costs 4 times the purchase price, and yet, very few companies are addressing this problem. Severalnines focuses on solutions to address this underserved segment. The founders of the company have a solid background in databases, having been at MySQL since 2003. The company develops a management platform which is database and cloud agnostic.We are database independent since we do not know who, if anybody, will be the next MySQL of the cloud.We are cloud independent, since we do not want to depend on any cloud vendor (e.g. Amazon or Rackspace) to avoid vendor lock-in. After the Amazon EC2 downtime during the Easter break, hundreds of affected companies have realized the importance of this. There is also a commercial aspect for avoiding vendor lock-in. Severalnines enhances productivity of organizations by attacking the biggest cost associated with database systems. We are a Swedish startup, hosted by SICS in Kista. There is also a small but very efficient development capacity in Singapore. Just as MySQL became a major brand and placed Sweden on the global software infrastructure map, we believe Severalnines can become a serious global player in the emerging Cloud space. We are very thankful that an organization like Eurocloud exists, and would like to thank the jury for considering our application. Kind regards,Vinay Joosery Severalnines AB
  • #18: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #19: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #20: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #21: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #22: Dear Jury, Just as the electric grid revolutionized access to electricity 100 years ago, we at Severalnines believe that Cloud Computing will revolutionize IT where organizations will be able to plug into extremely powerful computing resources over the network. We have already seen the beginnings of this new wave, where the current infrastructure stack is being challenged and disrupted by a whole set of new technologies. For instance, in the database market, over 40 startups have received funding over the past 18 months. Severalnines is not building yet another database product, we believe there are already a lot of good technologies available. To manage a database costs 4 times the purchase price, and yet, very few companies are addressing this problem. Severalnines focuses on solutions to address this underserved segment. The founders of the company have a solid background in databases, having been at MySQL since 2003. The company develops a management platform which is database and cloud agnostic.We are database independent since we do not know who, if anybody, will be the next MySQL of the cloud.We are cloud independent, since we do not want to depend on any cloud vendor (e.g. Amazon or Rackspace) to avoid vendor lock-in. After the Amazon EC2 downtime during the Easter break, hundreds of affected companies have realized the importance of this. There is also a commercial aspect for avoiding vendor lock-in. Severalnines enhances productivity of organizations by attacking the biggest cost associated with database systems. We are a Swedish startup, hosted by SICS in Kista. There is also a small but very efficient development capacity in Singapore. Just as MySQL became a major brand and placed Sweden on the global software infrastructure map, we believe Severalnines can become a serious global player in the emerging Cloud space. We are very thankful that an organization like Eurocloud exists, and would like to thank the jury for considering our application. Kind regards,Vinay Joosery Severalnines AB
  • #23: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #24: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #25: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #26: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #27: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #28: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #29: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #30: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #31: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #32: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #33: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #34: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #35: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com
  • #38: Severalnines has been offering its products free of charge since 2007, while the founders were employed at MySQL. These products are the de-facto standard tools to assist MySQL customers and users in deploying their MySQL clusters. More information about Severalnines at www.severalnines.com