SlideShare ist ein Scribd-Unternehmen logo
1 von 130
Downloaden Sie, um offline zu lesen
Test like a boss:
Deploy and test complex
topologies with a single command
Giuseppe Maxia
dbdeployer
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
Intro
dbdeployer
•MySQL community
application of the
year 2019

•dbdeployer.org
dbdeployer
• Command line tool to deploy MySQL in a sandbox

• No dependencies (single binary per O.S., written in go)

• Interface similar to git, docker

• Fast!

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

• Integrated help

• Easy to extend.
https://dbdeployer.org
Basic dbdeployer principle
Basic dbdeployer principle
•LAZINESS!
Basic dbdeployer principle
•LAZINESS!
•i.e. try avoiding repeated tasks, or
doing difficult things manually.
Basic dbdeployer principle
•LAZINESS!
•i.e. try avoiding repeated tasks, or
doing difficult things manually.
•Whenever a repeated task
becomes annoying, a new
dbdeployer feature comes out.
Let's start with a cool
example
MySQL upgrade
MySQL upgrade
• Will deploy MySQL 5.5 and 5.6
MySQL upgrade
• Will deploy MySQL 5.5 and 5.6
• and upgrade 5.5 to 5.6
MySQL upgrade
• Will deploy MySQL 5.5 and 5.6
• and upgrade 5.5 to 5.6
• Then deploy MySQL 5.7
MySQL upgrade
• Will deploy MySQL 5.5 and 5.6
• and upgrade 5.5 to 5.6
• Then deploy MySQL 5.7
• and upgrade from 5.6 to 5.7
MySQL upgrade
• Will deploy MySQL 5.5 and 5.6
• and upgrade 5.5 to 5.6
• Then deploy MySQL 5.7
• and upgrade from 5.6 to 5.7
• Then deploy MySQL 8.0
MySQL upgrade
• Will deploy MySQL 5.5 and 5.6
• and upgrade 5.5 to 5.6
• Then deploy MySQL 5.7
• and upgrade from 5.6 to 5.7
• Then deploy MySQL 8.0
• and upgrade from 5.7 to 8.0
MySQL upgrade
• Will deploy MySQL 5.5 and 5.6
• and upgrade 5.5 to 5.6
• Then deploy MySQL 5.7
• and upgrade from 5.6 to 5.7
• Then deploy MySQL 8.0
• and upgrade from 5.7 to 8.0
ALL IN LESS THAN
ONE MINUTE!
demo # 1
(upgrade)
WHY have I used it?
• Support to customers using different versions

• Consulting

• Rapid prototyping

• Testing of new versions

• Reporting bugs

• Avoid using a VM
WHY have I used it?
• Support to customers using different versions

• Consulting

• Rapid prototyping

• Testing of new versions

• Reporting bugs

• Avoid using a VM
Do you have a different
reason?
Let me know via Twitter
@datacharmer
What's a sandbox?
Physical server deployments
• Best performance

• Highest isolation

• Low scalability
bare metal
operating system
libraries/applications
service service service service service service
Sandboxes, VMs, containers (1)
Virtual machines
• High scalability

• Good isolation

• Low performance
bare metal
host operating system
hypervisor
virtual machine
service
guest operating system
libraries/applications
virtual machine
service
guest operating system
libraries/applications
virtual machine
service
guest operating system
libraries/applications
Sandboxes, VMs, containers (2)
Docker containers
• High scalability

• High performance

• Minimal isolation
bare metal
host operating system
Docker engine
container
service
library
library
container
service
library
library
container
service
library
container
service
library
library
library
library
Sandboxes, VMs, containers (3)
Sandboxes
• Best performance

• High scalability

• Low isolation
bare metal
operating system
libraries/applications
service service service service service service
Sandboxes, VMs, containers (4)
dbdeployer features
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

• Simple to use and administer
dbdeployer deploy single 8.0
What can it do? (2)
• Install a group of sandboxes

• Isolated from each other

• Without any relationship

• With binary logging active
dbdeployer deploy multiple 8.0
What can it do? (3)
• Install a master-slave replication cluster

• 1 master and 2 (or more) slaves

• Replication enabled

• Optional GTID

• Handy tools to run operations on all nodes at once
dbdeployer deploy replication 8.0 
--topology=master-slave
What can it do? (4)
• Install a group replication cluster (MySQL 5.7 and 8.0)

• 3 (or more) nodes

• Single-primary or multi-primary

• Group replication configured and enabled

• Handy tools to run operations on all nodes at once
dbdeployer deploy replication 8.0 
--topology=group
What can it do? (5)
• Install a multi-source replication cluster (MySQL 5.7-8.0)

• 3 (or more) nodes

• fan-in or all-masters topologies

• Handy tools to run operations on all nodes at once
dbdeployer deploy replication 8.0.17 
--topology=fan-in # or all-masters
What can it do? (6)
• Install a single or multiple TiDB sandbox
dbdeployer deploy single tidb3.0.0 
--client-from=5.7.25
dbdeployer deploy multiple tidb3.0.0 
--client-from=5.7.25
What can it do? (7)
• Install a Percona XtraDB cluster (5.7, only Linux)

• 3 (or more) nodes

• Handy tools to run operations on all nodes at once
dbdeployer deploy replication pxc5.7 
--topology=pxc
What can it do? (8)
• Install a MySQL Cluster (NDB 7.6 and 8.0)

• 3 (or more) nodes

• Handy tools to run operations on all nodes at once
dbdeployer deploy replication ndb7.6 
--topology=ndb
What can it do? (9)
• Administer sandboxes

• List available binaries

• List installed sandboxes

• start, restart (with options), stop

• check status

• test

• delete
What can it do? (10)
• Customize sandboxes

• Customizable initialization and database start

• Provide templates for every script

• Allow on-the-fly and permanent template replacement

• Change most of the default values

• Make sandboxes permanent (= can't be deleted)
What can it do? (11)
• Find free ports automatically

• Test replication flow

• Expose MySQL 8 dictionary tables

• Use semi-sync replication

• Run SQL command before and after loading grants

• enable/disable X-protocol
What can it do? (12)
• List downloads for MacOS and Linux (dbdeployer 1.33.0)

• Download latest binaries directly
dbdeployer downloads list
What can it do? (12)
• List downloads for MacOS and Linux (dbdeployer 1.33.0)

• Download latest binaries directly
dbdeployer downloads list
dbdeployer downloads get mysql-5.7.26.tar.xz
What can it do? (12)
• List downloads for MacOS and Linux (dbdeployer 1.33.0)

• Download latest binaries directly
dbdeployer downloads list
dbdeployer downloads get mysql-5.7.26.tar.xz
dbdeployer downloads get-by-version 8.0 
--newest --minimal
What can it do? (12)
• List downloads for MacOS and Linux (dbdeployer 1.33.0)

• Download latest binaries directly
dbdeployer downloads list
dbdeployer downloads get mysql-5.7.26.tar.xz
dbdeployer downloads get-by-version 8.0 
--newest --minimal
dbdeployer downloads get-unpack 
mysql-5.7.26.tar.xz
What can it do? (13)
• Import existing database servers into a sandbox
(dbdeployer 1.39.0)

• Use the imported sandbox with regular sandbox scripts
What can it do? (13)
• Import existing database servers into a sandbox
(dbdeployer 1.39.0)

• Use the imported sandbox with regular sandbox scripts
dbdeployer import single 
192.168.0.164 3306 
admin notMyPassword
demo # 2
(features, features)
installation
Installation (1)
1. Go to https://github.com/datacharmer/dbdeployer

2. Find releases

3. Download the binary for your O.S.

4. Put it in a directory within your $PATH
5. Run it!
Installation (2)
(if you use go)
1. go get github.com/datacharmer/dbdeployer

2. Use it!
sandbox usage
Using it
(the long [old] way)
1. Download a MySQL binary tarball

2. Use dbdeployer to expand it

3. start creating sandboxes
Choose your download
Choose your download
Choose your download
Choose your download
MySQL 8.0.16+ has MINIMAL tarballs!
operations:
unpack once, use forever
$ dbdeployer unpack 
mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz
Unpacking tarball mysql-8.0.11-linux-glibc2.12-
x86_64.tar.gz to $HOME/opt/mysql/8.0.11
$ dbdeployer versions
8.0.11
$ dbdeployer deploy single 8.0.11
Database installed in $HOME/sandboxes/msb_8_0_11
Principles
Principles
https://dev.mysql.com/downloads/mysql/get a MySQL
binary tarball
1
mysql-5.7.26-yourOS.tar.gz
Principles
https://dev.mysql.com/downloads/mysql/get a MySQL
binary tarball
1
mysql-5.7.26-yourOS.tar.gz
dbdeployer unpack2
$HOME/opt/mysql/5.7.26
Principles
https://dev.mysql.com/downloads/mysql/get a MySQL
binary tarball
1
mysql-5.7.26-yourOS.tar.gz
dbdeployer unpack2
$HOME/opt/mysql/5.7.26
dbdeployer deploy single3
$HOME/sandboxes/msb_5_7_26
Principles
https://dev.mysql.com/downloads/mysql/get a MySQL
binary tarball
1
mysql-5.7.26-yourOS.tar.gz
dbdeployer unpack2
$HOME/opt/mysql/5.7.26
dbdeployer deploy single3
$HOME/sandboxes/msb_5_7_26
dbdeployer deploy multiple3
$HOME/sandboxes/multi_msb_5_7_26
laziness alert!
Using it
(the modern way)
$ dbdeployer downloads list
Available tarballs (2019-08-10)
name version flavor size
--------------------------------------------------- --------- ------------- -------
tidb-master-darwin-amd64.tar.gz 3.0.0 tidb 26 MB
mysql-5.7.26-macos10.14-x86_64.tar.gz 5.7.26 mysql 337 MB
mysql-8.0.16-macos10.14-x86_64.tar.gz 8.0.16 mysql 153 MB
mysql-8.0.15-macos10.14-x86_64.tar.gz 8.0.15 mysql 139 MB
mysql-5.7.25-macos10.14-x86_64.tar.gz 5.7.25 mysql 337 MB
mysql-5.6.41-macos10.13-x86_64.tar.gz 5.6.41 mysql 176 MB
mysql-5.5.53-osx10.9-x86_64.tar.gz 5.5.53 mysql 114 MB
mysql-5.1.73-osx10.6-x86_64.tar.gz 5.1.73 mysql 82 MB
mysql-5.0.96-osx10.5-x86_64.tar.gz 5.0.96 mysql 61 MB
mysql-cluster-8.0.16-dmr-macos10.14-x86_64.tar.gz 8.0.16 ndb 252 MB
mysql-8.0.17-macos10.14-x86_64.tar.gz 8.0.17 mysql 155 MB
mysql-5.7.27-macos10.14-x86_64.tar.gz 5.7.27 mysql 337 MB
mysql-cluster-gpl-7.6.10-macos10.14-x86_64.tar.gz 7.6.10 ndb 482 MB
mysql-cluster-8.0.17-rc-macos10.14-x86_64.tar.gz 8.0.17 ndb 255 MB
mysql-cluster-gpl-7.6.11-macos10.14-x86_64.tar.gz 7.6.11 ndb 482 MB
mysql-shell-8.0.17-macos10.14-x86-64bit.tar.gz 8.0.17 mysql-shell 17 MB
(1a)
Using it
(the modern way)
$ dbdeployer downloads list
Available tarballs (2019-08-10)
name version flavor size minimal
-------------------------------------------------------- --------- ------------- -------- ---------
tidb-master-linux-amd64.tar.gz 3.0.0 tidb 26 MB
mysql-8.0.16-linux-glibc2.12-x86_64.tar.xz 8.0.16 mysql 461 MB
mysql-8.0.16-linux-x86_64-minimal.tar.xz 8.0.16 mysql 44 MB Y
mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz 5.7.27 mysql 645 MB
mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz 8.0.17 mysql 480 MB
mysql-8.0.17-linux-x86_64-minimal.tar.xz 8.0.17 mysql 45 MB Y
mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz 5.7.26 mysql 645 MB
mysql-5.6.44-linux-glibc2.12-x86_64.tar.gz 5.6.44 mysql 329 MB
mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz 5.5.62 mysql 199 MB
mysql-8.0.15-linux-glibc2.12-x86_64.tar.xz 8.0.15 mysql 376 MB
mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz 8.0.13 mysql 394 MB
mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz 5.7.25 mysql 645 MB
mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz 5.6.43 mysql 329 MB
mysql-5.5.61-linux-glibc2.12-x86_64.tar.gz 5.5.61 mysql 199 MB
mysql-5.1.73-linux-x86_64-glibc23.tar.gz 5.1.73 mysql 134 MB
mysql-5.0.96.tar.xz 5.0.96 mysql 5.5 MB Y
mysql-5.1.72.tar.xz 5.1.72 mysql 10 MB Y
mysql-5.5.61.tar.xz 5.5.61 mysql 6.6 MB Y
mysql-5.5.62.tar.xz 5.5.62 mysql 6.6 MB Y
mysql-5.6.43.tar.xz 5.6.43 mysql 9.0 MB Y
mysql-5.6.44.tar.xz 5.6.44 mysql 9.1 MB Y
mysql-5.7.25.tar.xz 5.7.25 mysql 23 MB Y
mysql-5.7.26.tar.xz 5.7.26 mysql 23 MB Y
mysql-5.0.96-linux-x86_64-glibc23.tar.gz 5.0.96 mysql 127 MB
mysql-4.1.22.tar.xz 4.1.22 mysql 4.6 MB Y
mysql-cluster-gpl-7.6.10-linux-glibc2.12-x86_64.tar.gz 7.6.10 ndb 916 MB
mysql-cluster-8.0.16-dmr-linux-glibc2.12-x86_64.tar.gz 8.0.16 ndb 1.1 GB
mysql-cluster-gpl-7.6.11-linux-glibc2.12-x86_64.tar.gz 7.6.11 ndb 916 MB
mysql-cluster-8.0.17-rc-linux-glibc2.12-x86_64.tar.gz 8.0.17 ndb 1.1 GB
mysql-shell-8.0.17-linux-glibc2.12-x86-64bit.tar.gz 8.0.17 mysql-shell 30 MB
(1b)
Using it
(the modern way)
$ dbdeployer downloads show 
mysql-8.0.17-linux-x86_64-minimal.tar.xz
Name: mysql-8.0.17-linux-x86_64-
minimal.tar.xz
Short version: 8.0
Version: 8.0.17
Flavor: mysql
OS: Linux
URL: https://dev.mysql.com/get/
Downloads/MySQL-8.0/mysql-8.0.17-linux-x86_64-
minimal.tar.xz
Checksum: MD5:
26e807f0140472fcc40166a67a775c7d
Size: 45 MB
(1c)
Using it
(the modern way)
$ dbdeployer downloads get 
mysql-8.0.17-linux-x86_64-minimal.tar.xz
(1d)
Principles (revised)
Principles (revised)
get a MySQL
binary tarball
1
dbdeployer downloads get 
mysql-5.7.27-yourOS.tar.gz
Principles (revised)
get a MySQL
binary tarball
1
dbdeployer downloads get 
mysql-5.7.27-yourOS.tar.gz
dbdeployer unpack2
$HOME/opt/mysql/5.7.27
Principles (revised)
get a MySQL
binary tarball
1
dbdeployer downloads get 
mysql-5.7.27-yourOS.tar.gz
dbdeployer unpack2
$HOME/opt/mysql/5.7.27
dbdeployer deploy single3
$HOME/sandboxes/msb_5_7_27
Principles (revised)
get a MySQL
binary tarball
1
dbdeployer downloads get 
mysql-5.7.27-yourOS.tar.gz
dbdeployer unpack2
$HOME/opt/mysql/5.7.27
dbdeployer deploy single3
$HOME/sandboxes/msb_5_7_27
dbdeployer deploy multiple3
$HOME/sandboxes/multi_msb_5_7_27
even more laziness
alert!
Using it
(the hyper-modern way)
$ dbdeployer downloads get-unpack 
mysql-8.0.17-linux-x86_64-minimal.tar.xz
Downloading mysql-8.0.17-linux-x86_64-
minimal.tar.xz
.... 45 MB
File mysql-8.0.17-linux-x86_64-minimal.tar.xz
downloaded
Checksum matches
Unpacking tarball mysql-8.0.17-linux-x86_64-
minimal.tar.xz to $HOME/opt/mysql/8.0.17
.........100.........200..227
Renaming directory $HOME/opt/mysql/mysql-8.0.17-
linux-x86_64-minimal to $HOME/opt/mysql/8.0.17
(2)
customising
defaults
• list 

• export

• load

• reset

• update

• or use option --defaults=key-value
Internal values used to create sandboxes
Templates
• list

• show

• export

• import

• reset

• or use option --use-template=tmpl_name:file_name
used to create sandbox scripts
demo # 3
(customising)
Using it with
generated tools
Using it with
generated tools
Knowing these tools makes the difference
between fumbling around and proficient usage
Single sandbox tools
1. init_db 

2. use / use_admin

3. start / restart [options]

4. stop / send_kill

5. status

6. clear

7. add_option

8. test_sb
9. mysqlsh

10. my 

11. show_log

12. show_binlog

13. show_relaylog

14. replicate_from

15. clone_from
init_db
• Initialises the server.

• Useful to see what is being done at startup
# sample:
$HOME/opt/mysql/8.0.17/bin/mysqld 
--no-defaults 
--user=gmax 
--basedir=$BASEDIR 
--datadir=$DATADIR 
--tmpdir=$SBDIR/tmp 
--initialize-insecure
use / use_admin
• Runs the mysql client with the right options

• use_admin exists if you used --enable-admin-address
# sample:
./use -e 'select @@port'
start/restart
• starts or restarts the server with optional parameters

• the optional parameters are only valid until the server stops
# sample:
./restart --max-allowed-packet=209715200
./stop
./start --max-connections=650
status
• Show the status of the sandbox 

• "on" = running, "off" = not running
# sample:
$ ./status
msb_8_0_17 on
./stop
./status
msb_8_0_17 off
add_option
• restarts the server with a permanent new option

•
# sample:
# NOTE: no '--'
./add_option max-allowed-packet=209715200
stop/send_kill
• Stops the server cleanly

• If the command fails, send_kill will attempt a stronger method
# sample:
./stop
./start
./send_kill
Attempting normal termination --- kill -15 70070
clear
• Stops the server and REMOVES ALL DATA

• WARNING: cannot be undone
# sample:
./clear
./status
msb_8_0_17 off
my
• prefix for all "my*" tools

• It adds automatically all options
# sample:
# NOTE: space between "my" and "sqldump"
./my sqldump database_name > file_name
# runs
# mysqldump --defaults-file=$PWD/my.sandbox.cnf
database_name
show_log
• shows the error log
# sample:
./show_log
###################### WARNING ############################
# You are not using a pager.
# The output of this script can be quite large.
# Please pipe this script with a pager, such as 'less' or
'vim -'
# Choose one of the following:
# * simply RETURN to continue without a pager
# * 'q' to exit
# * enter the name of the pager to use
q
./show_log | less
show_binlog/show_relaylog
• shows the binary log or relay log (if present
# sample:
./show_binlog | less
replicate_from
• replicates from another sandbox

• both sandboxes need to be replication ready
# sample:
$ dbdeployer sandboxes
msb_8_0_17_1 : single 8.0.17 [8017 18017 ]
msb_8_0_17_2 : single 8.0.17 [8018 18018 ]
$ cd ~/sandboxes/msb_8_0_17_1
$ ./replicate_from msb_8_0_17_2
or
$ ./replicate_from msb_8_0_17_2 clone
clone_from
• clones from another sandbox

• both sandboxes need to be clone ready (8.0.17+)
# sample:
$ dbdeployer sandboxes
msb_8_0_17_1 : single 8.0.17 [8017 18017 ]
msb_8_0_17_2 : single 8.0.17 [8018 18018 ]
$ cd ~/sandboxes/msb_8_0_17_1
$ ./clone_from msb_8_0_17_2
Single sandbox data
1. my.sandbox.cnf

2. grants.mysql

3. metadata

4. connection.conf

5. connection.json

6. connection.sql

7. sbdescription.json
1. options file

2. grants for all sandbox users

3. metadata

4. connection data

5. connection data

6. connection commands

7. sandbox info
replication tools
1. check_slaves
2. initialize_slaves
3. clear_all

4. m, s1, s2
5. n1, n2 ,n3

6. start_all / restart_all [opt]

7. stop_all / send_kill_all
8. status_all

9. use_all

10. use_all_masters

11. user_all_slaves

12. test_sb_all

13. test_replication

sbdescription.json
initialize_slaves
• called when creating replication

• should not be needed after that
# sample:
$ cat initialize_slaves
[...]
echo "initializing slave 1"
echo 'CHANGE MASTER TO master_host="127.0.0.1",
master_port=20718, master_user="rsandbox",
master_password="rsandbox" ,
GET_MASTER_PUBLIC_KEY=1' | $SBDIR/node1/use -u root
$SBDIR/node1/use -u root -e 'START SLAVE'
[...]
check_slaves
• shows replication status
$ ./check_slaves
master
port 20718 - server_id 100
File: mysql-bin.000001
Position: 7732
slave1
port 20719 - server_id 200
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 7732
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Exec_Master_Log_Pos: 7732
slave2
port 20720 - server_id 300
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 7732
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Exec_Master_Log_Pos: 7732
m, s1, s2
• m = master 

• s1 = slave1, etc
# sample:
$ ./m -e 'select @@server_id'
+-------------+
| @@server_id |
+-------------+
| 100 |
+-------------+
$ ./s1 -e 'select @@server_id'
+-------------+
| @@server_id |
+-------------+
| 200 |
+-------------+
n1, n2, n3
• n1 = master 

• n2 = slave1, n3 = slave2
# sample:
$ ./n1 -e 'select @@server_id'
+-------------+
| @@server_id |
+-------------+
| 100 |
+-------------+
$ ./n2 -e 'select @@server_id'
+-------------+
| @@server_id |
+-------------+
| 200 |
+-------------+
status_all, start_all, *_all
• same as corresponding single commands

• execute them on all nodes
# sample:
$ ./status_all
REPLICATION /Users/gmax/sandboxes/
rsandbox_8_0_17
master : master on - port 20718 (20718)
node1 : node1 on - port 20719 (20719)
node2 : node2 on - port 20720 (20720)
use_all, use_all_masters, use_all_slaves
• runs a query in all nodes or all masters or all slaves

•
# sample:
$ ./use_all 'select @@server_id'
# master
@@server_id
100
# server: 1
@@server_id
200
# server: 2
@@server_id
300
test_replication
• checks that replication is working

•
$ ./test_replication
# master log: mysql-bin.000001 - Position: 14700 - Rows: 20
# Testing slave #1
ok - slave #1 acknowledged reception of transactions from master
ok - slave #1 IO thread is running
ok - slave #1 SQL thread is running
ok - Table t1 found on slave #1
ok - Table t1 has 20 rows on #1
# Testing slave #2
ok - slave #2 acknowledged reception of transactions from master
ok - slave #2 IO thread is running
ok - slave #2 SQL thread is running
ok - Table t1 found on slave #2
ok - Table t1 has 20 rows on #2
# Tests : 10
# failed: 0 ( 0.0%)
# PASSED: 10 (100.0%)
# exit code: 0
group replication tools
1. check_nodes
2. initialize_nodes
3. clear_all

4. n1, n2 ,n3

5. start_all / restart_all [opt]

6. stop_all / send_kill_all
7. status_all

8. use_all

9. use_all_masters

10. user_all_slaves

11. test_sb_all

12. test_replication

sbdescription.json
NDB replication tools
1. check_nodes
2. initialize_nodes
3. ndb_mgm
4. clear_all

5. n1, n2 ,n3

6. start_all / restart_all [opt]

7. stop_all / send_kill_all
8. status_all

9. use_all

10. use_all_masters

11. user_all_slaves

12. test_sb_all

13. test_replication

sbdescription.json
multi-masters tools
1. check_ms_nodes
2. initialize_ms_nodes
3. clear_all

4. n1, n2 ,n3

5. m1,m2,m3, s1,s2,s3
6. start_all / restart_all [opt]

7. stop_all / send_kill_all
8. status_all

9. use_all

10. use_all_masters

11. user_all_slaves

12. test_sb_all

13. test_replication

sbdescription.json
demo # 4
(tools)
scripting
designed for scripting
• Use internal sandbox tools like shell commands

• See examples in cookbook
cookbook:
dbdeployer scripting examples
• dbdeployer cookbook list
demo # 5
(scripting)
dbdeployer in docker
docker for dbdeployer
datacharmer/mysql-sb-base empty container, with latest
dbdeployer and pre-requisites
for running MySQL
datacharmer/mysql-sb-full mysql-sb-base +

extracted tarballs for MySQL
4.1, 5.0, 5.1, 5.5, 5.6, 5.7, 8.0
docker usage (1a)
# in the host OS
$ docker run -ti 
-v $PWD:/workdir 
datacharmer/mysql-sb-base bash
docker usage (1b)
# inside docker
$ dbdeployer unpack /workdir/mysql-8.0.18-linux-
x86_64-minimal.tar.gz
Unpacking tarball /workdir/mysql-8.0.18-linux-
x86_64-minimal.tar.gz to $HOME/opt/mysql/8.0.18
.........100.........200...233
Renaming directory $HOME/opt/mysql/mysql-8.0.18-
linux-x86_64-minimal to /home/msandbox/opt/
mysql/8.0.18
docker usage (1c)
# inside docker
$ dbdeployer versions
Basedir: /home/msandbox/opt/mysql
8.0.18
$ dbdeployer deploy single 8.0
# 8.0 => 8.0.18
Creating directory /home/msandbox/sandboxes
Database installed in $HOME/sandboxes/msb_8_0_18
run 'dbdeployer usage single' for basic
instructions'
.. sandbox server started
docker usage (2a)
# in the host OS
$ docker run -ti 
datacharmer/mysql-sb-full bash
# in the container
$ dbdeployer versions
Basedir: /home/msandbox/opt/mysql
4.1.22 5.0.96 5.1.72 5.5.62
5.6.44 5.7.26 8.0.16 tidb3.0.0
docker usage (2b)
# in the container
$ dbdeployer versions
Basedir: /home/msandbox/opt/mysql
4.1.22 5.0.96 5.1.72 5.5.62
5.6.44 5.7.26 8.0.16 tidb3.0.0
$ for v in 4.1 5.0 5.1 5.5 5.6 5.7 8.0 ; 
do dbdeployer deploy single $v ; 
done
docker usage (2c)
# in the container
$ dbdeployer sandboxes --full-info
.------------.--------.---------.-----------.---------------.--------.
| name | type | version | host | port | flavor |
+------------+--------+---------+-----------+---------------+--------+
| msb_4_1_22 | single | 4.1.22 | 127.0.0.1 | [4122 ] | mysql |
| msb_5_0_96 | single | 5.0.96 | 127.0.0.1 | [5096 ] | mysql |
| msb_5_1_72 | single | 5.1.72 | 127.0.0.1 | [5172 ] | mysql |
| msb_5_5_62 | single | 5.5.62 | 127.0.0.1 | [5562 ] | mysql |
| msb_5_6_44 | single | 5.6.44 | 127.0.0.1 | [5644 ] | mysql |
| msb_5_7_26 | single | 5.7.26 | 127.0.0.1 | [5726 ] | mysql |
| msb_8_0_16 | single | 8.0.16 | 127.0.0.1 | [8016 18016 ] | mysql |
'------------'--------'---------'-----------'---------------'--------'
$ dbdeployer delete all --concurrent --skip-confirm
docker usage (2d)
# in the container
$ dbdeployer deploy replication 
--topology=group 
--single-primary 8.0
demo # 5
(dbdeployer in docker)
Imported sandboxes
Importing sandboxes
• You can import an existing MySQL database into a sandbox

• The only requirement is that the database is accessible from
your machine

• Syntax: 

dbdeployer import single IP port user password

• After importing, you can access the external database like any
other sandboxes
import example (1)
# Importing MySQL from a docker container
# with port 3306 redirected to host port 5000
$ dbdeployer import single 
127.0.0.1 5000 public secret
detected: 8.0.17
# Using client version 8.0.17
Database installed in $HOME/sandboxes/
imp_msb_8_0_17
run 'dbdeployer usage single' for basic
instructions'
import example (2)
# You can replicate from the imported server
# into a regular sandbox
$ ~/sandboxes/msb_8_0_17/replicate_from 
imp_msb_8_0_17
Many possibilities
192.168.0.15 - port 3306 192.168.0.21 - port 3306
sandbox sb1
imported
sandbox sb2
imported
sandbox sb3
Many possibilities
192.168.0.15 - port 3306 192.168.0.21 - port 3306
sandbox sb1
imported
sandbox sb2
imported
sandbox sb3
Replicate from sb2
to sb1
(from 192.168.0.15
to 127.0.0.1)
Many possibilities
192.168.0.15 - port 3306 192.168.0.21 - port 3306
sandbox sb1
imported
sandbox sb2
imported
sandbox sb3
Replicate from sb2
to sb1
(from 192.168.0.15
to 127.0.0.1)
Replicate from sb3
to sb2
(from 192.168.0.21
to 192.168.0.15)
wrapping up
Will publish the slides soon
Check twitter: @datacharmer

Weitere ähnliche Inhalte

Was ist angesagt?

How (not) to kill your MySQL infrastructure
How (not) to kill your MySQL infrastructureHow (not) to kill your MySQL infrastructure
How (not) to kill your MySQL infrastructureMiklos Szel
 
Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019Katie Sylor-Miller
 
Building Windows Images with Packer
Building Windows Images with PackerBuilding Windows Images with Packer
Building Windows Images with PackerMatt Wrock
 
Powershell dcpp
Powershell dcppPowershell dcpp
Powershell dcppartisriva
 
OpenStack LA meetup Feb 18, 2015
OpenStack LA meetup Feb 18, 2015OpenStack LA meetup Feb 18, 2015
OpenStack LA meetup Feb 18, 2015Tesora
 
Minimal OpenStack LinuxCon NA 2015
Minimal OpenStack LinuxCon NA 2015Minimal OpenStack LinuxCon NA 2015
Minimal OpenStack LinuxCon NA 2015Sean Dague
 
Dependencies and Licenses
Dependencies and LicensesDependencies and Licenses
Dependencies and LicensesRobert Reiz
 
On MongoDB backup
On MongoDB backupOn MongoDB backup
On MongoDB backupWilliam Yeh
 
Enhancing OpenShift Security for Business Critical Deployments
Enhancing OpenShift Security for Business Critical DeploymentsEnhancing OpenShift Security for Business Critical Deployments
Enhancing OpenShift Security for Business Critical DeploymentsDevOps.com
 
Building and deploying a distributed application with Docker, Mesos and Marathon
Building and deploying a distributed application with Docker, Mesos and MarathonBuilding and deploying a distributed application with Docker, Mesos and Marathon
Building and deploying a distributed application with Docker, Mesos and MarathonJulia Mateo
 
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto GarcíaOpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto GarcíaOpenNebula Project
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalPantheon
 
Introduction of mesos persistent storage
Introduction of mesos persistent storageIntroduction of mesos persistent storage
Introduction of mesos persistent storageZhou Weitao
 
What I learned from FluentConf and then some
What I learned from FluentConf and then someWhat I learned from FluentConf and then some
What I learned from FluentConf and then someOhad Kravchick
 
Understanding DSE Search by Matt Stump
Understanding DSE Search by Matt StumpUnderstanding DSE Search by Matt Stump
Understanding DSE Search by Matt StumpDataStax
 
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...OpenNebula Project
 
Introduction To Apache Mesos
Introduction To Apache MesosIntroduction To Apache Mesos
Introduction To Apache MesosJoe Stein
 

Was ist angesagt? (20)

How (not) to kill your MySQL infrastructure
How (not) to kill your MySQL infrastructureHow (not) to kill your MySQL infrastructure
How (not) to kill your MySQL infrastructure
 
Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019Happy Browser, Happy User! WordSesh 2019
Happy Browser, Happy User! WordSesh 2019
 
Building Windows Images with Packer
Building Windows Images with PackerBuilding Windows Images with Packer
Building Windows Images with Packer
 
Powershell dcpp
Powershell dcppPowershell dcpp
Powershell dcpp
 
OpenStack LA meetup Feb 18, 2015
OpenStack LA meetup Feb 18, 2015OpenStack LA meetup Feb 18, 2015
OpenStack LA meetup Feb 18, 2015
 
Minimal OpenStack LinuxCon NA 2015
Minimal OpenStack LinuxCon NA 2015Minimal OpenStack LinuxCon NA 2015
Minimal OpenStack LinuxCon NA 2015
 
Dependencies and Licenses
Dependencies and LicensesDependencies and Licenses
Dependencies and Licenses
 
On MongoDB backup
On MongoDB backupOn MongoDB backup
On MongoDB backup
 
Enhancing OpenShift Security for Business Critical Deployments
Enhancing OpenShift Security for Business Critical DeploymentsEnhancing OpenShift Security for Business Critical Deployments
Enhancing OpenShift Security for Business Critical Deployments
 
Building and deploying a distributed application with Docker, Mesos and Marathon
Building and deploying a distributed application with Docker, Mesos and MarathonBuilding and deploying a distributed application with Docker, Mesos and Marathon
Building and deploying a distributed application with Docker, Mesos and Marathon
 
Ansible
AnsibleAnsible
Ansible
 
Cialug August 2021
Cialug August 2021Cialug August 2021
Cialug August 2021
 
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto GarcíaOpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
 
Composer Tools & Frameworks for Drupal
Composer Tools & Frameworks for DrupalComposer Tools & Frameworks for Drupal
Composer Tools & Frameworks for Drupal
 
Introduction of mesos persistent storage
Introduction of mesos persistent storageIntroduction of mesos persistent storage
Introduction of mesos persistent storage
 
What I learned from FluentConf and then some
What I learned from FluentConf and then someWhat I learned from FluentConf and then some
What I learned from FluentConf and then some
 
Understanding DSE Search by Matt Stump
Understanding DSE Search by Matt StumpUnderstanding DSE Search by Matt Stump
Understanding DSE Search by Matt Stump
 
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
OpenNebulaConf2017EU: Alternative Context for Windows by Paul Batchelor, Blac...
 
Introduction To Apache Mesos
Introduction To Apache MesosIntroduction To Apache Mesos
Introduction To Apache Mesos
 
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
 

Ähnlich wie Test like a_boss

2013-cloudconnect-OpenStack@BT
2013-cloudconnect-OpenStack@BT2013-cloudconnect-OpenStack@BT
2013-cloudconnect-OpenStack@BTuictamale
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...Gaetano Giunta
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...Evans Ye
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at ScaleAntony Messerl
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON
 
Docking postgres
Docking postgresDocking postgres
Docking postgresrycamor
 
LASUG Online: Introduction to Docker and Docker Tools
LASUG Online: Introduction to Docker and Docker ToolsLASUG Online: Introduction to Docker and Docker Tools
LASUG Online: Introduction to Docker and Docker ToolsVasiliy Fomichev
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterContinuent
 
PaaSTA: Running applications at Yelp
PaaSTA: Running applications at YelpPaaSTA: Running applications at Yelp
PaaSTA: Running applications at YelpNathan Handler
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureAdrian Otto
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedDataStax Academy
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Dockernklmish
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Railselliando dias
 
Crowbar2 update
Crowbar2 updateCrowbar2 update
Crowbar2 updateosonoi
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedTim Callaghan
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"IT Event
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchHoward Greenberg
 
Leveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningLeveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningEvans Ye
 

Ähnlich wie Test like a_boss (20)

2013-cloudconnect-OpenStack@BT
2013-cloudconnect-OpenStack@BT2013-cloudconnect-OpenStack@BT
2013-cloudconnect-OpenStack@BT
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 
DevOps tools for winning agility
DevOps tools for winning agilityDevOps tools for winning agility
DevOps tools for winning agility
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at Scale
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
 
Docking postgres
Docking postgresDocking postgres
Docking postgres
 
LASUG Online: Introduction to Docker and Docker Tools
LASUG Online: Introduction to Docker and Docker ToolsLASUG Online: Introduction to Docker and Docker Tools
LASUG Online: Introduction to Docker and Docker Tools
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
 
PaaSTA: Running applications at Yelp
PaaSTA: Running applications at YelpPaaSTA: Running applications at Yelp
PaaSTA: Running applications at Yelp
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable Infrastructure
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
 
Crowbar2 update
Crowbar2 updateCrowbar2 update
Crowbar2 update
 
Hosting Ruby Web Apps
Hosting Ruby Web AppsHosting Ruby Web Apps
Hosting Ruby Web Apps
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Leonid Vasilyev  "Building, deploying and running production code at Dropbox"Leonid Vasilyev  "Building, deploying and running production code at Dropbox"
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
 
Leveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioningLeveraging docker for hadoop build automation and big data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioning
 

Mehr von Giuseppe Maxia

A quick tour of Mysql 8 roles
A quick tour of Mysql 8 rolesA quick tour of Mysql 8 roles
A quick tour of Mysql 8 rolesGiuseppe Maxia
 
Synchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDBSynchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDBGiuseppe Maxia
 
Juggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorJuggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorGiuseppe Maxia
 
Tungsten Replicator tutorial
Tungsten Replicator tutorialTungsten Replicator tutorial
Tungsten Replicator tutorialGiuseppe Maxia
 
Preventing multi master conflicts with tungsten
Preventing multi master conflicts with tungstenPreventing multi master conflicts with tungsten
Preventing multi master conflicts with tungstenGiuseppe Maxia
 
MySQL high availability power and usability
MySQL high availability power and usabilityMySQL high availability power and usability
MySQL high availability power and usabilityGiuseppe Maxia
 
Solving MySQL replication problems with Tungsten
Solving MySQL replication problems with TungstenSolving MySQL replication problems with Tungsten
Solving MySQL replication problems with TungstenGiuseppe Maxia
 
State of the art of MySQL replication and clustering
State of the art of MySQL replication and clusteringState of the art of MySQL replication and clustering
State of the art of MySQL replication and clusteringGiuseppe Maxia
 
Testing mysql creatively in a sandbox
Testing mysql creatively in a sandboxTesting mysql creatively in a sandbox
Testing mysql creatively in a sandboxGiuseppe Maxia
 
Mysql 5.5 and 5.6 replication
Mysql 5.5 and 5.6 replicationMysql 5.5 and 5.6 replication
Mysql 5.5 and 5.6 replicationGiuseppe Maxia
 
Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Giuseppe Maxia
 
Testing early mysql releases in a sandbox
Testing early mysql releases in a sandboxTesting early mysql releases in a sandbox
Testing early mysql releases in a sandboxGiuseppe Maxia
 
Testing mysql creatively in a sandbox
Testing mysql creatively in a sandboxTesting mysql creatively in a sandbox
Testing mysql creatively in a sandboxGiuseppe Maxia
 
Building simple and complex clusters with tungsten replicator
Building simple and complex clusters with tungsten replicatorBuilding simple and complex clusters with tungsten replicator
Building simple and complex clusters with tungsten replicatorGiuseppe Maxia
 

Mehr von Giuseppe Maxia (20)

Dbdeployer
DbdeployerDbdeployer
Dbdeployer
 
A quick tour of Mysql 8 roles
A quick tour of Mysql 8 rolesA quick tour of Mysql 8 roles
A quick tour of Mysql 8 roles
 
MySQL document_store
MySQL document_storeMySQL document_store
MySQL document_store
 
Replication skeptic
Replication skepticReplication skeptic
Replication skeptic
 
Synchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDBSynchronise your data between MySQL and MongoDB
Synchronise your data between MySQL and MongoDB
 
Juggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorJuggle your data with Tungsten Replicator
Juggle your data with Tungsten Replicator
 
MySQL in your laptop
MySQL in your laptopMySQL in your laptop
MySQL in your laptop
 
Script it
Script itScript it
Script it
 
Tungsten Replicator tutorial
Tungsten Replicator tutorialTungsten Replicator tutorial
Tungsten Replicator tutorial
 
Preventing multi master conflicts with tungsten
Preventing multi master conflicts with tungstenPreventing multi master conflicts with tungsten
Preventing multi master conflicts with tungsten
 
MySQL high availability power and usability
MySQL high availability power and usabilityMySQL high availability power and usability
MySQL high availability power and usability
 
Solving MySQL replication problems with Tungsten
Solving MySQL replication problems with TungstenSolving MySQL replication problems with Tungsten
Solving MySQL replication problems with Tungsten
 
State of the art of MySQL replication and clustering
State of the art of MySQL replication and clusteringState of the art of MySQL replication and clustering
State of the art of MySQL replication and clustering
 
Testing mysql creatively in a sandbox
Testing mysql creatively in a sandboxTesting mysql creatively in a sandbox
Testing mysql creatively in a sandbox
 
Mysql 5.5 and 5.6 replication
Mysql 5.5 and 5.6 replicationMysql 5.5 and 5.6 replication
Mysql 5.5 and 5.6 replication
 
Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012Lightning talks percona live mysql_2012
Lightning talks percona live mysql_2012
 
Replication 101
Replication 101Replication 101
Replication 101
 
Testing early mysql releases in a sandbox
Testing early mysql releases in a sandboxTesting early mysql releases in a sandbox
Testing early mysql releases in a sandbox
 
Testing mysql creatively in a sandbox
Testing mysql creatively in a sandboxTesting mysql creatively in a sandbox
Testing mysql creatively in a sandbox
 
Building simple and complex clusters with tungsten replicator
Building simple and complex clusters with tungsten replicatorBuilding simple and complex clusters with tungsten replicator
Building simple and complex clusters with tungsten replicator
 

Kürzlich hochgeladen

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Kürzlich hochgeladen (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Test like a_boss

  • 1. Test like a boss: Deploy and test complex topologies with a single command Giuseppe Maxia dbdeployer
  • 2. 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
  • 4. dbdeployer •MySQL community application of the year 2019 •dbdeployer.org
  • 5. dbdeployer • Command line tool to deploy MySQL in a sandbox • No dependencies (single binary per O.S., written in go) • Interface similar to git, docker • Fast! • Runs single database, replication, group replication, multiple deployments, multi-source replication. • Integrated help • Easy to extend. https://dbdeployer.org
  • 8. Basic dbdeployer principle •LAZINESS! •i.e. try avoiding repeated tasks, or doing difficult things manually.
  • 9. Basic dbdeployer principle •LAZINESS! •i.e. try avoiding repeated tasks, or doing difficult things manually. •Whenever a repeated task becomes annoying, a new dbdeployer feature comes out.
  • 10. Let's start with a cool example
  • 12. MySQL upgrade • Will deploy MySQL 5.5 and 5.6
  • 13. MySQL upgrade • Will deploy MySQL 5.5 and 5.6 • and upgrade 5.5 to 5.6
  • 14. MySQL upgrade • Will deploy MySQL 5.5 and 5.6 • and upgrade 5.5 to 5.6 • Then deploy MySQL 5.7
  • 15. MySQL upgrade • Will deploy MySQL 5.5 and 5.6 • and upgrade 5.5 to 5.6 • Then deploy MySQL 5.7 • and upgrade from 5.6 to 5.7
  • 16. MySQL upgrade • Will deploy MySQL 5.5 and 5.6 • and upgrade 5.5 to 5.6 • Then deploy MySQL 5.7 • and upgrade from 5.6 to 5.7 • Then deploy MySQL 8.0
  • 17. MySQL upgrade • Will deploy MySQL 5.5 and 5.6 • and upgrade 5.5 to 5.6 • Then deploy MySQL 5.7 • and upgrade from 5.6 to 5.7 • Then deploy MySQL 8.0 • and upgrade from 5.7 to 8.0
  • 18. MySQL upgrade • Will deploy MySQL 5.5 and 5.6 • and upgrade 5.5 to 5.6 • Then deploy MySQL 5.7 • and upgrade from 5.6 to 5.7 • Then deploy MySQL 8.0 • and upgrade from 5.7 to 8.0 ALL IN LESS THAN ONE MINUTE!
  • 20. WHY have I used it? • Support to customers using different versions • Consulting • Rapid prototyping • Testing of new versions • Reporting bugs • Avoid using a VM
  • 21. WHY have I used it? • Support to customers using different versions • Consulting • Rapid prototyping • Testing of new versions • Reporting bugs • Avoid using a VM Do you have a different reason? Let me know via Twitter @datacharmer
  • 23. Physical server deployments • Best performance • Highest isolation • Low scalability bare metal operating system libraries/applications service service service service service service Sandboxes, VMs, containers (1)
  • 24. Virtual machines • High scalability • Good isolation • Low performance bare metal host operating system hypervisor virtual machine service guest operating system libraries/applications virtual machine service guest operating system libraries/applications virtual machine service guest operating system libraries/applications Sandboxes, VMs, containers (2)
  • 25. Docker containers • High scalability • High performance • Minimal isolation bare metal host operating system Docker engine container service library library container service library library container service library container service library library library library Sandboxes, VMs, containers (3)
  • 26. Sandboxes • Best performance • High scalability • Low isolation bare metal operating system libraries/applications service service service service service service Sandboxes, VMs, containers (4)
  • 28. 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 • Simple to use and administer dbdeployer deploy single 8.0
  • 29. What can it do? (2) • Install a group of sandboxes • Isolated from each other • Without any relationship • With binary logging active dbdeployer deploy multiple 8.0
  • 30. What can it do? (3) • Install a master-slave replication cluster • 1 master and 2 (or more) slaves • Replication enabled • Optional GTID • Handy tools to run operations on all nodes at once dbdeployer deploy replication 8.0 --topology=master-slave
  • 31. What can it do? (4) • Install a group replication cluster (MySQL 5.7 and 8.0) • 3 (or more) nodes • Single-primary or multi-primary • Group replication configured and enabled • Handy tools to run operations on all nodes at once dbdeployer deploy replication 8.0 --topology=group
  • 32. What can it do? (5) • Install a multi-source replication cluster (MySQL 5.7-8.0) • 3 (or more) nodes • fan-in or all-masters topologies • Handy tools to run operations on all nodes at once dbdeployer deploy replication 8.0.17 --topology=fan-in # or all-masters
  • 33. What can it do? (6) • Install a single or multiple TiDB sandbox dbdeployer deploy single tidb3.0.0 --client-from=5.7.25 dbdeployer deploy multiple tidb3.0.0 --client-from=5.7.25
  • 34. What can it do? (7) • Install a Percona XtraDB cluster (5.7, only Linux) • 3 (or more) nodes • Handy tools to run operations on all nodes at once dbdeployer deploy replication pxc5.7 --topology=pxc
  • 35. What can it do? (8) • Install a MySQL Cluster (NDB 7.6 and 8.0) • 3 (or more) nodes • Handy tools to run operations on all nodes at once dbdeployer deploy replication ndb7.6 --topology=ndb
  • 36. What can it do? (9) • Administer sandboxes • List available binaries • List installed sandboxes • start, restart (with options), stop • check status • test • delete
  • 37. What can it do? (10) • Customize sandboxes • Customizable initialization and database start • Provide templates for every script • Allow on-the-fly and permanent template replacement • Change most of the default values • Make sandboxes permanent (= can't be deleted)
  • 38. What can it do? (11) • Find free ports automatically • Test replication flow • Expose MySQL 8 dictionary tables • Use semi-sync replication • Run SQL command before and after loading grants • enable/disable X-protocol
  • 39. What can it do? (12) • List downloads for MacOS and Linux (dbdeployer 1.33.0) • Download latest binaries directly dbdeployer downloads list
  • 40. What can it do? (12) • List downloads for MacOS and Linux (dbdeployer 1.33.0) • Download latest binaries directly dbdeployer downloads list dbdeployer downloads get mysql-5.7.26.tar.xz
  • 41. What can it do? (12) • List downloads for MacOS and Linux (dbdeployer 1.33.0) • Download latest binaries directly dbdeployer downloads list dbdeployer downloads get mysql-5.7.26.tar.xz dbdeployer downloads get-by-version 8.0 --newest --minimal
  • 42. What can it do? (12) • List downloads for MacOS and Linux (dbdeployer 1.33.0) • Download latest binaries directly dbdeployer downloads list dbdeployer downloads get mysql-5.7.26.tar.xz dbdeployer downloads get-by-version 8.0 --newest --minimal dbdeployer downloads get-unpack mysql-5.7.26.tar.xz
  • 43. What can it do? (13) • Import existing database servers into a sandbox (dbdeployer 1.39.0) • Use the imported sandbox with regular sandbox scripts
  • 44. What can it do? (13) • Import existing database servers into a sandbox (dbdeployer 1.39.0) • Use the imported sandbox with regular sandbox scripts dbdeployer import single 192.168.0.164 3306 admin notMyPassword
  • 45. demo # 2 (features, features)
  • 47. Installation (1) 1. Go to https://github.com/datacharmer/dbdeployer 2. Find releases 3. Download the binary for your O.S. 4. Put it in a directory within your $PATH 5. Run it!
  • 48.
  • 49.
  • 50.
  • 51.
  • 52. Installation (2) (if you use go) 1. go get github.com/datacharmer/dbdeployer 2. Use it!
  • 54. Using it (the long [old] way) 1. Download a MySQL binary tarball 2. Use dbdeployer to expand it 3. start creating sandboxes
  • 58. Choose your download MySQL 8.0.16+ has MINIMAL tarballs!
  • 59. operations: unpack once, use forever $ dbdeployer unpack mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz Unpacking tarball mysql-8.0.11-linux-glibc2.12- x86_64.tar.gz to $HOME/opt/mysql/8.0.11 $ dbdeployer versions 8.0.11 $ dbdeployer deploy single 8.0.11 Database installed in $HOME/sandboxes/msb_8_0_11
  • 62. Principles https://dev.mysql.com/downloads/mysql/get a MySQL binary tarball 1 mysql-5.7.26-yourOS.tar.gz dbdeployer unpack2 $HOME/opt/mysql/5.7.26
  • 63. Principles https://dev.mysql.com/downloads/mysql/get a MySQL binary tarball 1 mysql-5.7.26-yourOS.tar.gz dbdeployer unpack2 $HOME/opt/mysql/5.7.26 dbdeployer deploy single3 $HOME/sandboxes/msb_5_7_26
  • 64. Principles https://dev.mysql.com/downloads/mysql/get a MySQL binary tarball 1 mysql-5.7.26-yourOS.tar.gz dbdeployer unpack2 $HOME/opt/mysql/5.7.26 dbdeployer deploy single3 $HOME/sandboxes/msb_5_7_26 dbdeployer deploy multiple3 $HOME/sandboxes/multi_msb_5_7_26
  • 66. Using it (the modern way) $ dbdeployer downloads list Available tarballs (2019-08-10) name version flavor size --------------------------------------------------- --------- ------------- ------- tidb-master-darwin-amd64.tar.gz 3.0.0 tidb 26 MB mysql-5.7.26-macos10.14-x86_64.tar.gz 5.7.26 mysql 337 MB mysql-8.0.16-macos10.14-x86_64.tar.gz 8.0.16 mysql 153 MB mysql-8.0.15-macos10.14-x86_64.tar.gz 8.0.15 mysql 139 MB mysql-5.7.25-macos10.14-x86_64.tar.gz 5.7.25 mysql 337 MB mysql-5.6.41-macos10.13-x86_64.tar.gz 5.6.41 mysql 176 MB mysql-5.5.53-osx10.9-x86_64.tar.gz 5.5.53 mysql 114 MB mysql-5.1.73-osx10.6-x86_64.tar.gz 5.1.73 mysql 82 MB mysql-5.0.96-osx10.5-x86_64.tar.gz 5.0.96 mysql 61 MB mysql-cluster-8.0.16-dmr-macos10.14-x86_64.tar.gz 8.0.16 ndb 252 MB mysql-8.0.17-macos10.14-x86_64.tar.gz 8.0.17 mysql 155 MB mysql-5.7.27-macos10.14-x86_64.tar.gz 5.7.27 mysql 337 MB mysql-cluster-gpl-7.6.10-macos10.14-x86_64.tar.gz 7.6.10 ndb 482 MB mysql-cluster-8.0.17-rc-macos10.14-x86_64.tar.gz 8.0.17 ndb 255 MB mysql-cluster-gpl-7.6.11-macos10.14-x86_64.tar.gz 7.6.11 ndb 482 MB mysql-shell-8.0.17-macos10.14-x86-64bit.tar.gz 8.0.17 mysql-shell 17 MB (1a)
  • 67. Using it (the modern way) $ dbdeployer downloads list Available tarballs (2019-08-10) name version flavor size minimal -------------------------------------------------------- --------- ------------- -------- --------- tidb-master-linux-amd64.tar.gz 3.0.0 tidb 26 MB mysql-8.0.16-linux-glibc2.12-x86_64.tar.xz 8.0.16 mysql 461 MB mysql-8.0.16-linux-x86_64-minimal.tar.xz 8.0.16 mysql 44 MB Y mysql-5.7.27-linux-glibc2.12-x86_64.tar.gz 5.7.27 mysql 645 MB mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz 8.0.17 mysql 480 MB mysql-8.0.17-linux-x86_64-minimal.tar.xz 8.0.17 mysql 45 MB Y mysql-5.7.26-linux-glibc2.12-x86_64.tar.gz 5.7.26 mysql 645 MB mysql-5.6.44-linux-glibc2.12-x86_64.tar.gz 5.6.44 mysql 329 MB mysql-5.5.62-linux-glibc2.12-x86_64.tar.gz 5.5.62 mysql 199 MB mysql-8.0.15-linux-glibc2.12-x86_64.tar.xz 8.0.15 mysql 376 MB mysql-8.0.13-linux-glibc2.12-x86_64.tar.xz 8.0.13 mysql 394 MB mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz 5.7.25 mysql 645 MB mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz 5.6.43 mysql 329 MB mysql-5.5.61-linux-glibc2.12-x86_64.tar.gz 5.5.61 mysql 199 MB mysql-5.1.73-linux-x86_64-glibc23.tar.gz 5.1.73 mysql 134 MB mysql-5.0.96.tar.xz 5.0.96 mysql 5.5 MB Y mysql-5.1.72.tar.xz 5.1.72 mysql 10 MB Y mysql-5.5.61.tar.xz 5.5.61 mysql 6.6 MB Y mysql-5.5.62.tar.xz 5.5.62 mysql 6.6 MB Y mysql-5.6.43.tar.xz 5.6.43 mysql 9.0 MB Y mysql-5.6.44.tar.xz 5.6.44 mysql 9.1 MB Y mysql-5.7.25.tar.xz 5.7.25 mysql 23 MB Y mysql-5.7.26.tar.xz 5.7.26 mysql 23 MB Y mysql-5.0.96-linux-x86_64-glibc23.tar.gz 5.0.96 mysql 127 MB mysql-4.1.22.tar.xz 4.1.22 mysql 4.6 MB Y mysql-cluster-gpl-7.6.10-linux-glibc2.12-x86_64.tar.gz 7.6.10 ndb 916 MB mysql-cluster-8.0.16-dmr-linux-glibc2.12-x86_64.tar.gz 8.0.16 ndb 1.1 GB mysql-cluster-gpl-7.6.11-linux-glibc2.12-x86_64.tar.gz 7.6.11 ndb 916 MB mysql-cluster-8.0.17-rc-linux-glibc2.12-x86_64.tar.gz 8.0.17 ndb 1.1 GB mysql-shell-8.0.17-linux-glibc2.12-x86-64bit.tar.gz 8.0.17 mysql-shell 30 MB (1b)
  • 68. Using it (the modern way) $ dbdeployer downloads show mysql-8.0.17-linux-x86_64-minimal.tar.xz Name: mysql-8.0.17-linux-x86_64- minimal.tar.xz Short version: 8.0 Version: 8.0.17 Flavor: mysql OS: Linux URL: https://dev.mysql.com/get/ Downloads/MySQL-8.0/mysql-8.0.17-linux-x86_64- minimal.tar.xz Checksum: MD5: 26e807f0140472fcc40166a67a775c7d Size: 45 MB (1c)
  • 69. Using it (the modern way) $ dbdeployer downloads get mysql-8.0.17-linux-x86_64-minimal.tar.xz (1d)
  • 71. Principles (revised) get a MySQL binary tarball 1 dbdeployer downloads get mysql-5.7.27-yourOS.tar.gz
  • 72. Principles (revised) get a MySQL binary tarball 1 dbdeployer downloads get mysql-5.7.27-yourOS.tar.gz dbdeployer unpack2 $HOME/opt/mysql/5.7.27
  • 73. Principles (revised) get a MySQL binary tarball 1 dbdeployer downloads get mysql-5.7.27-yourOS.tar.gz dbdeployer unpack2 $HOME/opt/mysql/5.7.27 dbdeployer deploy single3 $HOME/sandboxes/msb_5_7_27
  • 74. Principles (revised) get a MySQL binary tarball 1 dbdeployer downloads get mysql-5.7.27-yourOS.tar.gz dbdeployer unpack2 $HOME/opt/mysql/5.7.27 dbdeployer deploy single3 $HOME/sandboxes/msb_5_7_27 dbdeployer deploy multiple3 $HOME/sandboxes/multi_msb_5_7_27
  • 76. Using it (the hyper-modern way) $ dbdeployer downloads get-unpack mysql-8.0.17-linux-x86_64-minimal.tar.xz Downloading mysql-8.0.17-linux-x86_64- minimal.tar.xz .... 45 MB File mysql-8.0.17-linux-x86_64-minimal.tar.xz downloaded Checksum matches Unpacking tarball mysql-8.0.17-linux-x86_64- minimal.tar.xz to $HOME/opt/mysql/8.0.17 .........100.........200..227 Renaming directory $HOME/opt/mysql/mysql-8.0.17- linux-x86_64-minimal to $HOME/opt/mysql/8.0.17 (2)
  • 78. defaults • list • export • load • reset • update • or use option --defaults=key-value Internal values used to create sandboxes
  • 79. Templates • list • show • export • import • reset • or use option --use-template=tmpl_name:file_name used to create sandbox scripts
  • 82. Using it with generated tools Knowing these tools makes the difference between fumbling around and proficient usage
  • 83. Single sandbox tools 1. init_db 2. use / use_admin 3. start / restart [options] 4. stop / send_kill 5. status 6. clear 7. add_option 8. test_sb 9. mysqlsh 10. my 11. show_log 12. show_binlog 13. show_relaylog 14. replicate_from 15. clone_from
  • 84. init_db • Initialises the server. • Useful to see what is being done at startup # sample: $HOME/opt/mysql/8.0.17/bin/mysqld --no-defaults --user=gmax --basedir=$BASEDIR --datadir=$DATADIR --tmpdir=$SBDIR/tmp --initialize-insecure
  • 85. use / use_admin • Runs the mysql client with the right options • use_admin exists if you used --enable-admin-address # sample: ./use -e 'select @@port'
  • 86. start/restart • starts or restarts the server with optional parameters • the optional parameters are only valid until the server stops # sample: ./restart --max-allowed-packet=209715200 ./stop ./start --max-connections=650
  • 87. status • Show the status of the sandbox • "on" = running, "off" = not running # sample: $ ./status msb_8_0_17 on ./stop ./status msb_8_0_17 off
  • 88. add_option • restarts the server with a permanent new option • # sample: # NOTE: no '--' ./add_option max-allowed-packet=209715200
  • 89. stop/send_kill • Stops the server cleanly • If the command fails, send_kill will attempt a stronger method # sample: ./stop ./start ./send_kill Attempting normal termination --- kill -15 70070
  • 90. clear • Stops the server and REMOVES ALL DATA • WARNING: cannot be undone # sample: ./clear ./status msb_8_0_17 off
  • 91. my • prefix for all "my*" tools • It adds automatically all options # sample: # NOTE: space between "my" and "sqldump" ./my sqldump database_name > file_name # runs # mysqldump --defaults-file=$PWD/my.sandbox.cnf database_name
  • 92. show_log • shows the error log # sample: ./show_log ###################### WARNING ############################ # You are not using a pager. # The output of this script can be quite large. # Please pipe this script with a pager, such as 'less' or 'vim -' # Choose one of the following: # * simply RETURN to continue without a pager # * 'q' to exit # * enter the name of the pager to use q ./show_log | less
  • 93. show_binlog/show_relaylog • shows the binary log or relay log (if present # sample: ./show_binlog | less
  • 94. replicate_from • replicates from another sandbox • both sandboxes need to be replication ready # sample: $ dbdeployer sandboxes msb_8_0_17_1 : single 8.0.17 [8017 18017 ] msb_8_0_17_2 : single 8.0.17 [8018 18018 ] $ cd ~/sandboxes/msb_8_0_17_1 $ ./replicate_from msb_8_0_17_2 or $ ./replicate_from msb_8_0_17_2 clone
  • 95. clone_from • clones from another sandbox • both sandboxes need to be clone ready (8.0.17+) # sample: $ dbdeployer sandboxes msb_8_0_17_1 : single 8.0.17 [8017 18017 ] msb_8_0_17_2 : single 8.0.17 [8018 18018 ] $ cd ~/sandboxes/msb_8_0_17_1 $ ./clone_from msb_8_0_17_2
  • 96. Single sandbox data 1. my.sandbox.cnf 2. grants.mysql 3. metadata 4. connection.conf 5. connection.json 6. connection.sql 7. sbdescription.json 1. options file 2. grants for all sandbox users 3. metadata 4. connection data 5. connection data 6. connection commands 7. sandbox info
  • 97. replication tools 1. check_slaves 2. initialize_slaves 3. clear_all 4. m, s1, s2 5. n1, n2 ,n3 6. start_all / restart_all [opt] 7. stop_all / send_kill_all 8. status_all 9. use_all 10. use_all_masters 11. user_all_slaves 12. test_sb_all 13. test_replication sbdescription.json
  • 98. initialize_slaves • called when creating replication • should not be needed after that # sample: $ cat initialize_slaves [...] echo "initializing slave 1" echo 'CHANGE MASTER TO master_host="127.0.0.1", master_port=20718, master_user="rsandbox", master_password="rsandbox" , GET_MASTER_PUBLIC_KEY=1' | $SBDIR/node1/use -u root $SBDIR/node1/use -u root -e 'START SLAVE' [...]
  • 99. check_slaves • shows replication status $ ./check_slaves master port 20718 - server_id 100 File: mysql-bin.000001 Position: 7732 slave1 port 20719 - server_id 200 Master_Log_File: mysql-bin.000001 Read_Master_Log_Pos: 7732 Slave_IO_Running: Yes Slave_SQL_Running: Yes Exec_Master_Log_Pos: 7732 slave2 port 20720 - server_id 300 Master_Log_File: mysql-bin.000001 Read_Master_Log_Pos: 7732 Slave_IO_Running: Yes Slave_SQL_Running: Yes Exec_Master_Log_Pos: 7732
  • 100. m, s1, s2 • m = master • s1 = slave1, etc # sample: $ ./m -e 'select @@server_id' +-------------+ | @@server_id | +-------------+ | 100 | +-------------+ $ ./s1 -e 'select @@server_id' +-------------+ | @@server_id | +-------------+ | 200 | +-------------+
  • 101. n1, n2, n3 • n1 = master • n2 = slave1, n3 = slave2 # sample: $ ./n1 -e 'select @@server_id' +-------------+ | @@server_id | +-------------+ | 100 | +-------------+ $ ./n2 -e 'select @@server_id' +-------------+ | @@server_id | +-------------+ | 200 | +-------------+
  • 102. status_all, start_all, *_all • same as corresponding single commands • execute them on all nodes # sample: $ ./status_all REPLICATION /Users/gmax/sandboxes/ rsandbox_8_0_17 master : master on - port 20718 (20718) node1 : node1 on - port 20719 (20719) node2 : node2 on - port 20720 (20720)
  • 103. use_all, use_all_masters, use_all_slaves • runs a query in all nodes or all masters or all slaves • # sample: $ ./use_all 'select @@server_id' # master @@server_id 100 # server: 1 @@server_id 200 # server: 2 @@server_id 300
  • 104. test_replication • checks that replication is working • $ ./test_replication # master log: mysql-bin.000001 - Position: 14700 - Rows: 20 # Testing slave #1 ok - slave #1 acknowledged reception of transactions from master ok - slave #1 IO thread is running ok - slave #1 SQL thread is running ok - Table t1 found on slave #1 ok - Table t1 has 20 rows on #1 # Testing slave #2 ok - slave #2 acknowledged reception of transactions from master ok - slave #2 IO thread is running ok - slave #2 SQL thread is running ok - Table t1 found on slave #2 ok - Table t1 has 20 rows on #2 # Tests : 10 # failed: 0 ( 0.0%) # PASSED: 10 (100.0%) # exit code: 0
  • 105. group replication tools 1. check_nodes 2. initialize_nodes 3. clear_all 4. n1, n2 ,n3 5. start_all / restart_all [opt] 6. stop_all / send_kill_all 7. status_all 8. use_all 9. use_all_masters 10. user_all_slaves 11. test_sb_all 12. test_replication sbdescription.json
  • 106. NDB replication tools 1. check_nodes 2. initialize_nodes 3. ndb_mgm 4. clear_all 5. n1, n2 ,n3 6. start_all / restart_all [opt] 7. stop_all / send_kill_all 8. status_all 9. use_all 10. use_all_masters 11. user_all_slaves 12. test_sb_all 13. test_replication sbdescription.json
  • 107. multi-masters tools 1. check_ms_nodes 2. initialize_ms_nodes 3. clear_all 4. n1, n2 ,n3 5. m1,m2,m3, s1,s2,s3 6. start_all / restart_all [opt] 7. stop_all / send_kill_all 8. status_all 9. use_all 10. use_all_masters 11. user_all_slaves 12. test_sb_all 13. test_replication sbdescription.json
  • 110. designed for scripting • Use internal sandbox tools like shell commands • See examples in cookbook
  • 111. cookbook: dbdeployer scripting examples • dbdeployer cookbook list
  • 114. docker for dbdeployer datacharmer/mysql-sb-base empty container, with latest dbdeployer and pre-requisites for running MySQL datacharmer/mysql-sb-full mysql-sb-base + extracted tarballs for MySQL 4.1, 5.0, 5.1, 5.5, 5.6, 5.7, 8.0
  • 115. docker usage (1a) # in the host OS $ docker run -ti -v $PWD:/workdir datacharmer/mysql-sb-base bash
  • 116. docker usage (1b) # inside docker $ dbdeployer unpack /workdir/mysql-8.0.18-linux- x86_64-minimal.tar.gz Unpacking tarball /workdir/mysql-8.0.18-linux- x86_64-minimal.tar.gz to $HOME/opt/mysql/8.0.18 .........100.........200...233 Renaming directory $HOME/opt/mysql/mysql-8.0.18- linux-x86_64-minimal to /home/msandbox/opt/ mysql/8.0.18
  • 117. docker usage (1c) # inside docker $ dbdeployer versions Basedir: /home/msandbox/opt/mysql 8.0.18 $ dbdeployer deploy single 8.0 # 8.0 => 8.0.18 Creating directory /home/msandbox/sandboxes Database installed in $HOME/sandboxes/msb_8_0_18 run 'dbdeployer usage single' for basic instructions' .. sandbox server started
  • 118. docker usage (2a) # in the host OS $ docker run -ti datacharmer/mysql-sb-full bash # in the container $ dbdeployer versions Basedir: /home/msandbox/opt/mysql 4.1.22 5.0.96 5.1.72 5.5.62 5.6.44 5.7.26 8.0.16 tidb3.0.0
  • 119. docker usage (2b) # in the container $ dbdeployer versions Basedir: /home/msandbox/opt/mysql 4.1.22 5.0.96 5.1.72 5.5.62 5.6.44 5.7.26 8.0.16 tidb3.0.0 $ for v in 4.1 5.0 5.1 5.5 5.6 5.7 8.0 ; do dbdeployer deploy single $v ; done
  • 120. docker usage (2c) # in the container $ dbdeployer sandboxes --full-info .------------.--------.---------.-----------.---------------.--------. | name | type | version | host | port | flavor | +------------+--------+---------+-----------+---------------+--------+ | msb_4_1_22 | single | 4.1.22 | 127.0.0.1 | [4122 ] | mysql | | msb_5_0_96 | single | 5.0.96 | 127.0.0.1 | [5096 ] | mysql | | msb_5_1_72 | single | 5.1.72 | 127.0.0.1 | [5172 ] | mysql | | msb_5_5_62 | single | 5.5.62 | 127.0.0.1 | [5562 ] | mysql | | msb_5_6_44 | single | 5.6.44 | 127.0.0.1 | [5644 ] | mysql | | msb_5_7_26 | single | 5.7.26 | 127.0.0.1 | [5726 ] | mysql | | msb_8_0_16 | single | 8.0.16 | 127.0.0.1 | [8016 18016 ] | mysql | '------------'--------'---------'-----------'---------------'--------' $ dbdeployer delete all --concurrent --skip-confirm
  • 121. docker usage (2d) # in the container $ dbdeployer deploy replication --topology=group --single-primary 8.0
  • 122. demo # 5 (dbdeployer in docker)
  • 124. Importing sandboxes • You can import an existing MySQL database into a sandbox • The only requirement is that the database is accessible from your machine • Syntax: dbdeployer import single IP port user password • After importing, you can access the external database like any other sandboxes
  • 125. import example (1) # Importing MySQL from a docker container # with port 3306 redirected to host port 5000 $ dbdeployer import single 127.0.0.1 5000 public secret detected: 8.0.17 # Using client version 8.0.17 Database installed in $HOME/sandboxes/ imp_msb_8_0_17 run 'dbdeployer usage single' for basic instructions'
  • 126. import example (2) # You can replicate from the imported server # into a regular sandbox $ ~/sandboxes/msb_8_0_17/replicate_from imp_msb_8_0_17
  • 127. Many possibilities 192.168.0.15 - port 3306 192.168.0.21 - port 3306 sandbox sb1 imported sandbox sb2 imported sandbox sb3
  • 128. Many possibilities 192.168.0.15 - port 3306 192.168.0.21 - port 3306 sandbox sb1 imported sandbox sb2 imported sandbox sb3 Replicate from sb2 to sb1 (from 192.168.0.15 to 127.0.0.1)
  • 129. Many possibilities 192.168.0.15 - port 3306 192.168.0.21 - port 3306 sandbox sb1 imported sandbox sb2 imported sandbox sb3 Replicate from sb2 to sb1 (from 192.168.0.15 to 127.0.0.1) Replicate from sb3 to sb2 (from 192.168.0.21 to 192.168.0.15)
  • 130. wrapping up Will publish the slides soon Check twitter: @datacharmer