SlideShare a Scribd company logo
MySQL NDB 8.0
clusters in your laptop
with dbdeployer
Giuseppe Maxia

software explorer
Who's this guy?
About me
‣ Giuseppe Maxia, a.k.a. "The Data Charmer"
‣ Software Explorer at VMware
‣ Several decades development and DB
experience
‣ Long timer MySQL community member.
‣ Blog: http://datacharmer.blogspot.com
‣ Twitter: @datacharmer
2
dbdeployer
• Command line tool

• No dependencies (single binary per O.S.)

• Interface similar to git, docker

• Fast!

• Runs single database, replication, group replication,
multiple deployments, multi-source replication, NDB, PXC.

• Integrated help

• Easy to extend.
https://dbdeployer.org
What can it do? (1)
• Install a single MySQL sandbox of ANY VERSION

• Separated from any existing MySQL server

• Completely in user space

• Reasonably isolated

• Easy to use and administer
dbdeployer deploy single 8.0
What can it do? (2)
• Install a master-slave replication cluster

• 1 master and 2 (or more) slaves

• Replication enabled

• Optional GTID

• Easy tools to run operations on all nodes at once
dbdeployer deploy replication 8.0 
--topology=master-slave
What can it do? (3)
• Install a MySQL Cluster (NDB 7.6 and 8.0)

• 3 (or more) nodes

• Easy tools to run operations on all nodes at once
dbdeployer deploy replication ndb7.6 
--topology=ndb
What can it do? (4)
• Replicate between two sandboxes

• ... or between two clusters

• Most importantly, also between MySQL Cluster (NDB 7.6
and 8.0)
~/sandboxes/sandbox1/replicate_from sandbox2
What does dbdeployer
do when you deploy a
NDB cluster
what dbdeployer does for you
(1) MySQL configuration files
[mysqld]
[...]
user = gmax
port = 28920
socket = /tmp/mysql_sandbox28920.sock
basedir = ~/opt/mysql/ndb8.0.19
datadir = ~/sandboxes/ndb_msb_ndb8_0_19/node1/data
ndbcluster
ndb_connectstring=127.0.0.1:21900
what dbdeployer does for you
(2) NDB configuration file
[system]
Name=ndb_msb_ndb8_0_19
[ndbd]
DataDir=/Users/gmax/sandboxes/ndb_msb_ndb8_0_19/ndbnode2
HostName=localhost
NodeId=2
[ndbd]
DataDir=/Users/gmax/sandboxes/ndb_msb_ndb8_0_19/ndbnode3
HostName=localhost
NodeId=3
[ndb_mgmd]
DataDir=/Users/gmax/sandboxes/ndb_msb_ndb8_0_19/ndbnode1
NodeId=1
HostName=localhost
PortNumber=21900
what dbdeployer does for you
(3) start NDB cluster
# inside ./initialize_nodes
$BASEDIR/bin/ndb_mgmd -f ndb_conf/config.ini 
--configdir=$PWD/ndb_conf 
--ndb-connectstring="host=localhost:$cluster_port"
check_exit_code "ndb initialization"
what dbdeployer does for you
(4) start NDB nodes
# inside ./initialize_nodes
for i in $(seq 2 $NUM_NDB_NODES)
do
$BASEDIR/bin/ndbmtd --ndb-nodeid=$i 
--ndb-connectstring="host=localhost:$cluster_port"
check_exit_code "ndb node $i start"
done
what dbdeployer does for you
(5) start MySQL nodes
# inside ./initialize_nodes
for i in $(seq 1 $NUM_NODES)
do
echo "executing 'start' on node $i"
$SBDIR/node$i/start
check_exit_code "mysql node $i start"
$SBDIR/node$i/load_grants
check_exit_code "mysql node $i load grants"
done
Step-by-step
• download MySQL Cluster

• expand tarball

• deploy 2 clusters

• start replication between one node of cluster1 to one
node of cluster2

• Optionally, but not recommended, start replication
between one node of cluster2 to one node of cluster1
deploy
dbdeployer deploy replication ndb8.0.19 
--topology=ndb 
--port-as-server-id 
--sandbox-directory=alpha_ndb8_0_19 
-c ndb-log-bin 
--concurrent
dbdeployer deploy replication ndb8.0.19 
--topology=ndb 
--port-as-server-id 
--sandbox-directory=bravo_ndb8_0_19 
-c ndb-log-bin 
--concurrent
check
$ dbdeployer sandboxes --header
Start replication
~/sandboxes/bravo_ndb8_0_19/replicate_from
alpha_ndb8_0_19
Connecting to ~/sandboxes/alpha_ndb8_0_19/node1
--------------
CHANGE MASTER TO master_host="127.0.0.1",
master_port=28920,
master_user="rsandbox",
master_password="rsandbox"
, master_log_file="mysql-bin.000001",
master_log_pos=11444, GET_MASTER_PUBLIC_KEY=1
--------------
replication started
--------------
start slave
--------------
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 11444
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Exec_Master_Log_Pos: 11444
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
test replication (1)
# Inserting data in alpha_ndb8_0_19 node1
$ ~/sandboxes/alpha_ndb8_0_19/n1 -e 
'create table if not exists test.t1 (id int
not null primary key, server_id int )
engine=ndbcluster'
$ ~/sandboxes/alpha_ndb8_0_19/n1 -e 'insert into
test.t1 values (1, @@server_id)'
test replication (2)
# Retrieving data from one of bravo_ndb8_0_19
nodes
~/sandboxes/bravo_ndb8_0_19/n2 -e 
'select *, @@port from test.t1'
+----+-----------+--------+
| id | server_id | @@port |
+----+-----------+--------+
| 1 | 28920 | 28924 |
+----+-----------+--------+
replication between two
clusters
a1
b1 a2
c1
b2
c2
replication between two
clusters
asynchronous
replication
a1
b1 a2
c1
b2
c2
replication between two
clusters
asynchronous
replication
t1
a1
b1 a2
c1
b2
c2
replication between two
clusters
asynchronous
replication
t1
t1
t1
a1
b1 a2
c1
b2
c2
replication between two
clusters
asynchronous
replication
t1
t1
t1
a1
b1 a2
c1
b2
c2
replication between two
clusters
asynchronous
replication
t1
t1
t1
t1a1
b1 a2
c1
b2
c2
replication between two
clusters
asynchronous
replication
t1
t1
t1
t1
t1
t1
a1
b1 a2
c1
b2
c2
replication between two
clusters
asynchronous
replication
t1
t1
t1
t1
t1
t1
a1
b1 a2
c1
b2
c2
Caveat
• Only NDB tables can be fully replicated

• Asynchronous replication can generate conflicts (NDB
should be able to detect them, but you better know)
Using non-NDB tables
asynchronous
replication
a1
b1 a2
c1
b2
c2
Using non-NDB tables
asynchronous
replication
t1
a1
b1 a2
c1
b2
c2
Using non-NDB tables
asynchronous
replication
t1
a1
b1 a2
c1
b2
c2
Using non-NDB tables
asynchronous
replication
a1
b1 a2
c1
b2
c2
Using non-NDB tables
asynchronous
replication
t1
a1
b1 a2
c1
b2
c2
Using non-NDB tables
asynchronous
replication
t1
a1
b1 a2
c1
b2
c2
Using non-NDB tables
asynchronous
replication
t1
a1
b1 a2
c1
b2
c2
Using non-NDB tables
asynchronous
replication
t1
a1
b1 a2
c1
b2
c2
Using non-NDB tables
asynchronous
replication
t1
t1
a1
b1 a2
c1
b2
c2
bi-directional replication
Risk of conflicts!
asynchronous
replication
asynchronous
replication
a1
b1 a2
c1
b2
c2
bi-directional replication
Risk of conflicts!
asynchronous
replication
asynchronous
replication
LIVE DEMO
Q&A
https://dbdeployer.org

More Related Content

PDF
Dbdeployer, the universal installer
PDF
Test like a_boss
PDF
Test complex database systems in your laptop with dbdeployer
PDF
Dbdeployer
PDF
Containers > VMs
PDF
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
PDF
Apache Cassandra and Go
PDF
Happy Browser, Happy User! WordSesh 2019
Dbdeployer, the universal installer
Test like a_boss
Test complex database systems in your laptop with dbdeployer
Dbdeployer
Containers > VMs
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Apache Cassandra and Go
Happy Browser, Happy User! WordSesh 2019

What's hot (20)

PDF
OpenStack LA meetup Feb 18, 2015
PPTX
How (not) to kill your MySQL infrastructure
PPTX
Building Windows Images with Packer
PPTX
Powershell dcpp
PDF
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
PDF
Cialug August 2021
PPTX
Understanding DSE Search by Matt Stump
PDF
Configuring Django projects for multiple environments
PPTX
PDF
Composer Tools & Frameworks for Drupal
PDF
Passwordless login with unix auth_socket
PDF
Enhancing OpenShift Security for Business Critical Deployments
PDF
Introduction of mesos persistent storage
PPT
On MongoDB backup
PPTX
What I learned from FluentConf and then some
PDF
Intro ProxySQL
PPTX
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
PDF
MySQL Oslayer performace optimization
PDF
Building and deploying a distributed application with Docker, Mesos and Marathon
PDF
Less passwords, more security: unix socket authentication and other MariaDB h...
OpenStack LA meetup Feb 18, 2015
How (not) to kill your MySQL infrastructure
Building Windows Images with Packer
Powershell dcpp
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
Cialug August 2021
Understanding DSE Search by Matt Stump
Configuring Django projects for multiple environments
Composer Tools & Frameworks for Drupal
Passwordless login with unix auth_socket
Enhancing OpenShift Security for Business Critical Deployments
Introduction of mesos persistent storage
On MongoDB backup
What I learned from FluentConf and then some
Intro ProxySQL
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
MySQL Oslayer performace optimization
Building and deploying a distributed application with Docker, Mesos and Marathon
Less passwords, more security: unix socket authentication and other MariaDB h...
Ad

Similar to MySQL NDB 8.0 clusters in your laptop with dbdeployer (20)

PDF
MySQL Cluster 8.0 tutorial
PDF
Get mysql clusterrunning-windows
PDF
Mysql wp cluster_quickstart_windows
PPT
MySQL Cluster Basics
PDF
MySQL replication & cluster
PDF
MySQL Replication Update - DEbconf 2020 presentation
PDF
MySQL 8.0 Operational Changes
PDF
MySQL in your laptop
PPTX
My SQL Portal Database (Cluster)
PDF
MySQL Cluster (NDB) - Best Practices Percona Live 2017
PDF
High Availability with MySQL
PDF
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
PDF
OpenStack Days East -- MySQL Options in OpenStack
PPTX
MySQL Options in OpenStack
ODP
MySQL HA with PaceMaker
PDF
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
PDF
MySQL cluster 72 in the Cloud
PPT
Oreilly Webcast Jun17
PPTX
Distribuido
PDF
MySQL cluster workshop
MySQL Cluster 8.0 tutorial
Get mysql clusterrunning-windows
Mysql wp cluster_quickstart_windows
MySQL Cluster Basics
MySQL replication & cluster
MySQL Replication Update - DEbconf 2020 presentation
MySQL 8.0 Operational Changes
MySQL in your laptop
My SQL Portal Database (Cluster)
MySQL Cluster (NDB) - Best Practices Percona Live 2017
High Availability with MySQL
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
OpenStack Days East -- MySQL Options in OpenStack
MySQL Options in OpenStack
MySQL HA with PaceMaker
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL cluster 72 in the Cloud
Oreilly Webcast Jun17
Distribuido
MySQL cluster workshop
Ad

More from Giuseppe Maxia (20)

PDF
Dbdeployer
PDF
A quick tour of Mysql 8 roles
PDF
MySQL document_store
PDF
Replication skeptic
PDF
Synchronise your data between MySQL and MongoDB
PDF
Juggle your data with Tungsten Replicator
PDF
Script it
PDF
Tungsten Replicator tutorial
PDF
Preventing multi master conflicts with tungsten
PDF
MySQL high availability power and usability
PDF
Solving MySQL replication problems with Tungsten
PDF
State of the art of MySQL replication and clustering
PDF
Testing mysql creatively in a sandbox
PDF
Mysql 5.5 and 5.6 replication
PDF
Lightning talks percona live mysql_2012
PDF
Replication 101
PDF
Testing early mysql releases in a sandbox
PDF
Testing mysql creatively in a sandbox
PDF
Building simple and complex clusters with tungsten replicator
PDF
Moving data for the masses
Dbdeployer
A quick tour of Mysql 8 roles
MySQL document_store
Replication skeptic
Synchronise your data between MySQL and MongoDB
Juggle your data with Tungsten Replicator
Script it
Tungsten Replicator tutorial
Preventing multi master conflicts with tungsten
MySQL high availability power and usability
Solving MySQL replication problems with Tungsten
State of the art of MySQL replication and clustering
Testing mysql creatively in a sandbox
Mysql 5.5 and 5.6 replication
Lightning talks percona live mysql_2012
Replication 101
Testing early mysql releases in a sandbox
Testing mysql creatively in a sandbox
Building simple and complex clusters with tungsten replicator
Moving data for the masses

Recently uploaded (20)

PDF
Understanding Forklifts - TECH EHS Solution
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Transform Your Business with a Software ERP System
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Nekopoi APK 2025 free lastest update
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
medical staffing services at VALiNTRY
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
ai tools demonstartion for schools and inter college
PDF
Digital Strategies for Manufacturing Companies
PDF
top salesforce developer skills in 2025.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
Understanding Forklifts - TECH EHS Solution
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Transform Your Business with a Software ERP System
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Online Work Permit System for Fast Permit Processing
Nekopoi APK 2025 free lastest update
Design an Analysis of Algorithms II-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
medical staffing services at VALiNTRY
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Design an Analysis of Algorithms I-SECS-1021-03
ManageIQ - Sprint 268 Review - Slide Deck
Odoo POS Development Services by CandidRoot Solutions
ai tools demonstartion for schools and inter college
Digital Strategies for Manufacturing Companies
top salesforce developer skills in 2025.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf

MySQL NDB 8.0 clusters in your laptop with dbdeployer