SlideShare ist ein Scribd-Unternehmen logo
1 von 74
Downloaden Sie, um offline zu lesen
MySQL Sandbox
A toolkit for
productive laziness
Giuseppe Maxia
QA Director, Continuent, Inc




                   This work is licensed under the Creative Commons
                   Attribution-Share Alike 3.0 Unported License. To view a
                   copy of this license, visit http://creativecommons.org/
                   licenses/by-sa/3.0/ or send a letter to Creative Commons,
                   171 Second Street, Suite 300, San Francisco, California,
                   94105, USA.
Tuesday, October 25, 11
about me - Giuseppe Maxia
 •       a.k.a. The Data Charmer
 •       QA Director at Continuent, Inc
 •       Long time hacking with MySQL features
 •       Formerly, community manager,db consultant, designer,
         coder.
 •       A passion for QA and open source
 •       Blogger
 • http://datacharmer.blogspot.com


Tuesday, October 25, 11
Laziness
         Laziness is a disinclination to
         activity or exertion despite
         having the ability to do so.



         http://en.wikipedia.org/wiki/Laziness
Tuesday, October 25, 11
I am an experienced DBA




Tuesday, October 25, 11
I am an experienced DBA
                     • I have the ability of installing
                          multiple MySQL servers.




Tuesday, October 25, 11
I am an experienced DBA
                     • I have the ability of installing
                          multiple MySQL servers.
                     • In the same host.




Tuesday, October 25, 11
I am an experienced DBA
                     • I have the ability of installing
                          multiple MySQL servers.
                     • In the same host.
                     • Without conflicting.




Tuesday, October 25, 11
I am an experienced DBA
                     • I have the ability of installing
                          multiple MySQL servers.
                     • In the same host.
                     • Without conflicting.
                     • Manually.



Tuesday, October 25, 11
I am an experienced DBA
                     • I have the ability of installing
                          multiple MySQL servers.
                     • In the same host.
                     • Without conflicting.
                     • Manually.
                     • Do I feel inclined to do so?


Tuesday, October 25, 11
I am an experienced DBA
                     • I have the ability of installing
                          multiple MySQL servers.
                     • In the same host.
                     • Without conflicting.
                     • Manually.
                     • Do I feel inclined to do so?
                     • Several times a day?

Tuesday, October 25, 11
I am an experienced DBA
                     • I have the ability of installing
                          multiple MySQL servers.
                     • In the same host.
                     • Without conflicting.
                     • Manually.
                     • Do I feel inclined to do so?
                     • Several times a day?
                     • I DON'T THINK SO.
Tuesday, October 25, 11
I am a command line wizard




Tuesday, October 25, 11
I am a command line wizard

                     • After installing multiple servers




Tuesday, October 25, 11
I am a command line wizard

                     • After installing multiple servers
                     • I can use them




Tuesday, October 25, 11
I am a command line wizard

                     • After installing multiple servers
                     • I can use them
                     • with various long options.




Tuesday, October 25, 11
I am a command line wizard

                     • After installing multiple servers
                     • I can use them
                     • with various long options.
                     • Manually.



Tuesday, October 25, 11
I am a command line wizard

                     • After installing multiple servers
                     • I can use them
                     • with various long options.
                     • Manually.
                     • Do I feel inclined to do so?


Tuesday, October 25, 11
I am a command line wizard

                     • After installing multiple servers
                     • I can use them
                     • with various long options.
                     • Manually.
                     • Do I feel inclined to do so?
                     • Many dozen times a day?

Tuesday, October 25, 11
I am a command line wizard

                     • After installing multiple servers
                     • I can use them
                     • with various long options.
                     • Manually.
                     • Do I feel inclined to do so?
                     • Many dozen times a day?
                     • I DEFINITELY DON'T THINK SO.
Tuesday, October 25, 11
I can set up replication




Tuesday, October 25, 11
I can set up replication


                     • Almost without errors.




Tuesday, October 25, 11
I can set up replication


                     • Almost without errors.
                     • And then I can connect to masters
                          and slaves with long options on the
                          command line.




Tuesday, October 25, 11
I can set up replication


                     • Almost without errors.
                     • And then I can connect to masters
                          and slaves with long options on the
                          command line.
                     • Do I feel inclined to do so?


Tuesday, October 25, 11
I can set up replication


                     • Almost without errors.
                     • And then I can connect to masters
                          and slaves with long options on the
                          command line.
                     • Do I feel inclined to do so?
                     • I DON'T THINK SO.

Tuesday, October 25, 11
I have the ability




Tuesday, October 25, 11
I have the ability

                     • but I don't feel inclined to do repetitive
                          work




Tuesday, October 25, 11
I have the ability

                     • but I don't feel inclined to do repetitive
                          work
                     • I ADMIT IT: I AM LAZY



Tuesday, October 25, 11
I have the ability

                     • but I don't feel inclined to do repetitive
                          work
                     • I ADMIT IT: I AM LAZY



Tuesday, October 25, 11
A lazy developer ®


        Someone who writes 12,000
        lines of code to spare himself
        the trouble of typing 15 lines
        on a terminal.


Tuesday, October 25, 11
A lazy developer ®


        Someone who writes 12,000
        lines of code to spare himself (*)
        the trouble of typing 15 lines
        on a terminal.
(*) And another 1,000,000 people
Tuesday, October 25, 11
That's me




Tuesday, October 25, 11
MySQL Sandbox
                          http://mysqlsandbox.net
             • Free software (Perl under GPL)
             • One (unix) host
             • Many database servers
             • Single or multiple sandboxes
             • Customized scripts to use the servers
             • Standard or circular replication
             • Installs IN SECONDS
Tuesday, October 25, 11
overview

        MySQL                                           MySQL
        server                                          server
            Data          DB1                    Data       DB1




            DB2           DB3
                                DATA DIRECTORY   DB2        DB3




                                     PORT


                                     SOCKET

Tuesday, October 25, 11
overview

        MySQL                                                 MySQL
        server                                                server
            Data          DB1
                                       SAME            Data       DB1




            DB2           DB3
                                       DATA            DB2        DB3

                                    DIRECTORY?
  /var/lib/mysql                                 /var/lib/mysql




                                DATA CORRUPTION
Tuesday, October 25, 11
overview

        MySQL                                         MySQL
        server                                        server

                                      SAME
                                     PORT or
                                     SOCKET?
                          3306                      3306


 /tmp/mysql.sock                               /tmp/mysql.sock

                                 DOES NOT START
Tuesday, October 25, 11
The hard way (1)




Tuesday, October 25, 11
the hard way (2)




Tuesday, October 25, 11
The easy way
     $ make_sandbox 
                     /path/to/mysql-5.1.54_linux.tar.gz


     $ make_sandbox 
                     Percona-Server-5.1.54_linux.tar.gz


     # it should work always




Tuesday, October 25, 11
The easier way
     $ make_sandbox 5.1.54




     # Needs some preliminary work




Tuesday, October 25, 11
The easiest way
     $ sb 5.1.54




     # Needs the same preliminary work




Tuesday, October 25, 11
MySQL Sandbox
                                                        VERSION
                                               MySQL
                                               server
           Data           DB1




            DB2           DB3
                                $SANDBOX_HOME/msb_VERSION/data


                                                         VERSION


                                      /tmp/mysql_VERSION.sock

Tuesday, October 25, 11
MySQL Sandbox
                                                       5.1.54
                                              MySQL
                                              server
           Data           DB1




            DB2           DB3
                                $SANDBOX_HOME/msb_5_1_54/data


                                                          5154


                                        /tmp/mysql_5154.sock

Tuesday, October 25, 11
MySQL Sandbox
                                                       5.5.9
                                              MySQL
                                              server
           Data           DB1




            DB2           DB3
                                $SANDBOX_HOME/msb_5_5_09/data


                                                         5509


                                        /tmp/mysql_5509.sock

Tuesday, October 25, 11
Single Sandbox
             MySQL            customized scripts
             server


     start
     stop
    restart
    status
     clear
   send_kill
      use

Tuesday, October 25, 11
Multiple Sandbox
            MySQL              customized scripts
            server


      start_all
      stop_all
     restart_all m n1
     status_all s1 n2
      clear_all  s2 n3
     send_kill_a
         ll
       use_all
Tuesday, October 25, 11
Where do you get it


        •from CPAN
              sudo cpan MySQL::Sandbox

        •from launchpad
              http://launchpad.net/mysql-sandbox




Tuesday, October 25, 11
The easy replication way
     $ make_replication_sandbox 
                     /path/to/mysql-5.1.54_linux.tar.gz


     # or, after some preparation


     $ make_replication_sandbox 5.1.54




Tuesday, October 25, 11
default architecture
                                            $HOME




                               /sandboxes            opt
                                                                 expanded
                                                                  tarballs
                          $SANDBOX_HOME
                                                    mysql


                                               $SANDBOX_BINARY
          installed
         sandboxes

Tuesday, October 25, 11
default architecture
                                                    $HOME



                                       /sandboxes            opt



                          msb_5_0_91
                                                            mysql
                          msb_5_1_48
                                                                    5.0.91
                          rsandbox_5_1_48
                                                                    5.1.45
                                 master
                                                                    5.1.48
                                 node1
                                                                    5.5.4
                                 node2
Tuesday, October 25, 11
Tuesday, October 25, 11
creating a single sandbox
                 make_sandbox 
                    /path/to/mysql-X.X.XX-OS.tar.gz




Tuesday, October 25, 11
using a single sandbox
                 # after
                 # make_sandbox 
                 #   /path/to/mysql-X.X.XX-OS.tar.gz

                 $ cd $SANDBOX_HOME/msb_X_X_XX
                 $ ./use




Tuesday, October 25, 11
creating a single sandbox
                          with a specific options file

                 make_sandbox 
                    /path/to/mysql-X.X.XX-OS.tar.gz 
                    -- --my_file=/path/to/my.cnf




Tuesday, October 25, 11
easily create a sandbox after the first
                       one
                          The long way
 $ cd $HOME/opt/mysql   # $SANDBOX_BINARY
 $   gunzip -c 
   /path/to/mysql-5.1.34-osx10.5-x86.tar.gz 
    | tar -xf -
 $ mv mysql-5.1.34-osx10.5-x86 5.1.34
 $ make sandbox 5.1.34




Tuesday, October 25, 11
easily create a sandbox after the first
                       one
                          The short way
 $ make_sandbox --export_binaries 
   path/to/mysql-5.1.34-osx10.5-x86.tar.gz




Tuesday, October 25, 11
starting a single sandbox
                 $ cd $SANDBOX_HOME/msb_X_X_XX
                 $ ./start




Tuesday, October 25, 11
starting a single sandbox
                          with temporary options
                 $ cd $SANDBOX_HOME/msb_X_X_XX
                 $ ./start --option=value


                 $ ./restart --option=value


                 $ ./start --key-buffer=20000000




Tuesday, October 25, 11
creating a sandbox with custom port
                 and directory
                 $ make_sandbox 5.1.34 -- 
                    --sandbox_port=7800 
                    --sandbox_directory=mickeymouse




Tuesday, October 25, 11
creating a sandbox with automatic
                      port checking
                 $ make_sandbox 5.1.34 -- --check_port


                 # if 5.1.34 is free
                 #    port=5134
                 #    directory=msb_5_1_34
                 # else
                 #    port=5135 (or the first free)
                 #    directory=msb_5_1_34_a




Tuesday, October 25, 11
create a replication sandbox


 $ make_replication_sandbox 
   path/to/mysql-5.1.34-osx10.5-x86.tar.gz




Tuesday, October 25, 11
create a circular replication sandbox


 $ make_replication_sandbox 
   --circular=4 
   path/to/mysql-5.1.34-osx10.5-x86.tar.gz




Tuesday, October 25, 11
changing port to an existing sandbox


 $ sbtool -o port 
     -s /path/to/source/sandbox 
     --new_port=XXXX




Tuesday, October 25, 11
installing the innodb plugin


 $ sbtool -o plugin 
     --plugin=innodb 
     -s /path/to/source/sandbox




Tuesday, October 25, 11
creating a replication sandbox with
                     new base port

 $ make_replication_sandbox 
     --replication_directory=newwdir 
     --check_base_port 5.0.79

 #       Creates a replication directory under
 #       $SANDBOX_HOME/newdir
 #       The previous one is preserved.
 #       No conflicts happen

Tuesday, October 25, 11
more recipes


 $ perldoc MySQL::Sandbox::Recipes




Tuesday, October 25, 11
MySQL Sandbox evolution




Tuesday, October 25, 11
Tungsten Sandbox




Tuesday, October 25, 11
replicator
                                            1



                                        replicator
                          TSB               2



                                        replicator
                                            3

                                                     database
              HOME                                       1




                                                     database
                           sandboxes   base_dir          2




                                                     database
                                                         3




Tuesday, October 25, 11
tungsten sandbox help
 ./tools/tungsten-sandbox -h
 USAGE: ./tools/tungsten-sandbox [flags] args
 flags:
   -n,--nodes: how many nodes to install (default: 3)
   -m,--mysql_version: which MySQL version to use (default: '5.5.13')
   -t,--tungsten_base: where to install the sandbox (default: '$HOME/tsb2/')
   -d,--group_dir: sandbox group directory name (default: 'tr_dbs')
   -x,--tsb_prefix: Tungsten Sandbox prefix (default: 'db')
   -s,--service: how the service is named (default: 'tsandbox')
   -P,--base_port: port base for MySQL sandbox nodes (default: 7100)
   -l,--thl_port: port for the THL service (default: 12110)
   -r,--rmi_port: port for the RMI service (default: 10100)
   -v,--[no]version: show Tungsten sandbox version (default: false)
   -h,--[no]help: show Tungsten sandbox help (default: false)




Tuesday, October 25, 11
tungsten sandbox
 $ ./tools/tungsten-sandbox -m 5.5.10
 executing "clear" on node 1
 executing "clear" on node 2
 executing "clear" on node 3
 installing node 1
 installing node 2
 installing node 3
 group directory installed in $HOME/sandboxes/tr_dbs




Tuesday, October 25, 11
tungsten sandbox
 ls ~/tsb2
 clear_tsandbox
 db1 db2 db3
 db_clear_all db_send_kill_all db_start_all
 db_status_all db_stop_all db_use_all
 n1 n2 n3 replicator_all start_tsandbox trepctl_all




Tuesday, October 25, 11
Participate!




Tuesday, October 25, 11
Participate!




Tuesday, October 25, 11
THANKS
                                                                                 Let's talk!




 This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit http://
 creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California,
 94105, USA.
Tuesday, October 25, 11

Weitere ähnliche Inhalte

Was ist angesagt?

A tale of 3 databases
A tale of 3 databasesA tale of 3 databases
A tale of 3 databasesChris Skardon
 
COMM 118 - Writing for a VO (Broadcast Journalism)
COMM 118 - Writing for a VO (Broadcast Journalism)COMM 118 - Writing for a VO (Broadcast Journalism)
COMM 118 - Writing for a VO (Broadcast Journalism)profluther
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011Sigasi
 
Rapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The WebRapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The WebPINT Inc
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Vincent Partington
 
Introduction to scaling your WordPress site past a single node using AWS
Introduction to scaling your WordPress site past a single node using AWSIntroduction to scaling your WordPress site past a single node using AWS
Introduction to scaling your WordPress site past a single node using AWSWP Engine
 
In-house web automation?
In-house web automation?In-house web automation?
In-house web automation?Adam Christian
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksFITC
 
Keynote ujihisa.vim#2
Keynote ujihisa.vim#2Keynote ujihisa.vim#2
Keynote ujihisa.vim#2ujihisa
 

Was ist angesagt? (12)

A tale of 3 databases
A tale of 3 databasesA tale of 3 databases
A tale of 3 databases
 
COMM 118 - Writing for a VO (Broadcast Journalism)
COMM 118 - Writing for a VO (Broadcast Journalism)COMM 118 - Writing for a VO (Broadcast Journalism)
COMM 118 - Writing for a VO (Broadcast Journalism)
 
EclipseCon Europe 2011
EclipseCon Europe 2011EclipseCon Europe 2011
EclipseCon Europe 2011
 
Rapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The WebRapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The Web
 
Big Websites
Big WebsitesBig Websites
Big Websites
 
Ansible for Automation
Ansible for AutomationAnsible for Automation
Ansible for Automation
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
 
Inrastructure as Code
Inrastructure as CodeInrastructure as Code
Inrastructure as Code
 
Introduction to scaling your WordPress site past a single node using AWS
Introduction to scaling your WordPress site past a single node using AWSIntroduction to scaling your WordPress site past a single node using AWS
Introduction to scaling your WordPress site past a single node using AWS
 
In-house web automation?
In-house web automation?In-house web automation?
In-house web automation?
 
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
 
Keynote ujihisa.vim#2
Keynote ujihisa.vim#2Keynote ujihisa.vim#2
Keynote ujihisa.vim#2
 

Andere mochten auch

Juggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorJuggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorGiuseppe 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
 
The impact of innovation on travel and tourism industries (World Travel Marke...
The impact of innovation on travel and tourism industries (World Travel Marke...The impact of innovation on travel and tourism industries (World Travel Marke...
The impact of innovation on travel and tourism industries (World Travel Marke...Brian Solis
 
Open Source Creativity
Open Source CreativityOpen Source Creativity
Open Source CreativitySara Cannon
 
Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)maditabalnco
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsBarry Feldman
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome EconomyHelge Tennø
 

Andere mochten auch (9)

MySQL in your laptop
MySQL in your laptopMySQL in your laptop
MySQL in your laptop
 
Script it
Script itScript it
Script it
 
Juggle your data with Tungsten Replicator
Juggle your data with Tungsten ReplicatorJuggle your data with Tungsten Replicator
Juggle your data with Tungsten Replicator
 
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
 
The impact of innovation on travel and tourism industries (World Travel Marke...
The impact of innovation on travel and tourism industries (World Travel Marke...The impact of innovation on travel and tourism industries (World Travel Marke...
The impact of innovation on travel and tourism industries (World Travel Marke...
 
Open Source Creativity
Open Source CreativityOpen Source Creativity
Open Source Creativity
 
Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)Reuters: Pictures of the Year 2016 (Part 2)
Reuters: Pictures of the Year 2016 (Part 2)
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome Economy
 

Mehr von Giuseppe Maxia

MySQL NDB 8.0 clusters in your laptop with dbdeployer
MySQL NDB 8.0 clusters in your laptop with dbdeployerMySQL NDB 8.0 clusters in your laptop with dbdeployer
MySQL NDB 8.0 clusters in your laptop with dbdeployerGiuseppe Maxia
 
Dbdeployer, the universal installer
Dbdeployer, the universal installerDbdeployer, the universal installer
Dbdeployer, the universal installerGiuseppe Maxia
 
Test complex database systems in your laptop with dbdeployer
Test complex database systems in your laptop with dbdeployerTest complex database systems in your laptop with dbdeployer
Test complex database systems in your laptop with dbdeployerGiuseppe 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
 
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
 

Mehr von Giuseppe Maxia (20)

MySQL NDB 8.0 clusters in your laptop with dbdeployer
MySQL NDB 8.0 clusters in your laptop with dbdeployerMySQL NDB 8.0 clusters in your laptop with dbdeployer
MySQL NDB 8.0 clusters in your laptop with dbdeployer
 
Test like a_boss
Test like a_bossTest like a_boss
Test like a_boss
 
Dbdeployer, the universal installer
Dbdeployer, the universal installerDbdeployer, the universal installer
Dbdeployer, the universal installer
 
Test complex database systems in your laptop with dbdeployer
Test complex database systems in your laptop with dbdeployerTest complex database systems in your laptop with dbdeployer
Test complex database systems in your laptop with dbdeployer
 
Dbdeployer
DbdeployerDbdeployer
Dbdeployer
 
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
 
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
 

Kürzlich hochgeladen

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 

Kürzlich hochgeladen (20)

Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 

MySQL Sandbox - A toolkit for productive laziness

  • 1. MySQL Sandbox A toolkit for productive laziness Giuseppe Maxia QA Director, Continuent, Inc This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/ licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. Tuesday, October 25, 11
  • 2. about me - Giuseppe Maxia • a.k.a. The Data Charmer • QA Director at Continuent, Inc • Long time hacking with MySQL features • Formerly, community manager,db consultant, designer, coder. • A passion for QA and open source • Blogger • http://datacharmer.blogspot.com Tuesday, October 25, 11
  • 3. Laziness Laziness is a disinclination to activity or exertion despite having the ability to do so. http://en.wikipedia.org/wiki/Laziness Tuesday, October 25, 11
  • 4. I am an experienced DBA Tuesday, October 25, 11
  • 5. I am an experienced DBA • I have the ability of installing multiple MySQL servers. Tuesday, October 25, 11
  • 6. I am an experienced DBA • I have the ability of installing multiple MySQL servers. • In the same host. Tuesday, October 25, 11
  • 7. I am an experienced DBA • I have the ability of installing multiple MySQL servers. • In the same host. • Without conflicting. Tuesday, October 25, 11
  • 8. I am an experienced DBA • I have the ability of installing multiple MySQL servers. • In the same host. • Without conflicting. • Manually. Tuesday, October 25, 11
  • 9. I am an experienced DBA • I have the ability of installing multiple MySQL servers. • In the same host. • Without conflicting. • Manually. • Do I feel inclined to do so? Tuesday, October 25, 11
  • 10. I am an experienced DBA • I have the ability of installing multiple MySQL servers. • In the same host. • Without conflicting. • Manually. • Do I feel inclined to do so? • Several times a day? Tuesday, October 25, 11
  • 11. I am an experienced DBA • I have the ability of installing multiple MySQL servers. • In the same host. • Without conflicting. • Manually. • Do I feel inclined to do so? • Several times a day? • I DON'T THINK SO. Tuesday, October 25, 11
  • 12. I am a command line wizard Tuesday, October 25, 11
  • 13. I am a command line wizard • After installing multiple servers Tuesday, October 25, 11
  • 14. I am a command line wizard • After installing multiple servers • I can use them Tuesday, October 25, 11
  • 15. I am a command line wizard • After installing multiple servers • I can use them • with various long options. Tuesday, October 25, 11
  • 16. I am a command line wizard • After installing multiple servers • I can use them • with various long options. • Manually. Tuesday, October 25, 11
  • 17. I am a command line wizard • After installing multiple servers • I can use them • with various long options. • Manually. • Do I feel inclined to do so? Tuesday, October 25, 11
  • 18. I am a command line wizard • After installing multiple servers • I can use them • with various long options. • Manually. • Do I feel inclined to do so? • Many dozen times a day? Tuesday, October 25, 11
  • 19. I am a command line wizard • After installing multiple servers • I can use them • with various long options. • Manually. • Do I feel inclined to do so? • Many dozen times a day? • I DEFINITELY DON'T THINK SO. Tuesday, October 25, 11
  • 20. I can set up replication Tuesday, October 25, 11
  • 21. I can set up replication • Almost without errors. Tuesday, October 25, 11
  • 22. I can set up replication • Almost without errors. • And then I can connect to masters and slaves with long options on the command line. Tuesday, October 25, 11
  • 23. I can set up replication • Almost without errors. • And then I can connect to masters and slaves with long options on the command line. • Do I feel inclined to do so? Tuesday, October 25, 11
  • 24. I can set up replication • Almost without errors. • And then I can connect to masters and slaves with long options on the command line. • Do I feel inclined to do so? • I DON'T THINK SO. Tuesday, October 25, 11
  • 25. I have the ability Tuesday, October 25, 11
  • 26. I have the ability • but I don't feel inclined to do repetitive work Tuesday, October 25, 11
  • 27. I have the ability • but I don't feel inclined to do repetitive work • I ADMIT IT: I AM LAZY Tuesday, October 25, 11
  • 28. I have the ability • but I don't feel inclined to do repetitive work • I ADMIT IT: I AM LAZY Tuesday, October 25, 11
  • 29. A lazy developer ® Someone who writes 12,000 lines of code to spare himself the trouble of typing 15 lines on a terminal. Tuesday, October 25, 11
  • 30. A lazy developer ® Someone who writes 12,000 lines of code to spare himself (*) the trouble of typing 15 lines on a terminal. (*) And another 1,000,000 people Tuesday, October 25, 11
  • 32. MySQL Sandbox http://mysqlsandbox.net • Free software (Perl under GPL) • One (unix) host • Many database servers • Single or multiple sandboxes • Customized scripts to use the servers • Standard or circular replication • Installs IN SECONDS Tuesday, October 25, 11
  • 33. overview MySQL MySQL server server Data DB1 Data DB1 DB2 DB3 DATA DIRECTORY DB2 DB3 PORT SOCKET Tuesday, October 25, 11
  • 34. overview MySQL MySQL server server Data DB1 SAME Data DB1 DB2 DB3 DATA DB2 DB3 DIRECTORY? /var/lib/mysql /var/lib/mysql DATA CORRUPTION Tuesday, October 25, 11
  • 35. overview MySQL MySQL server server SAME PORT or SOCKET? 3306 3306 /tmp/mysql.sock /tmp/mysql.sock DOES NOT START Tuesday, October 25, 11
  • 36. The hard way (1) Tuesday, October 25, 11
  • 37. the hard way (2) Tuesday, October 25, 11
  • 38. The easy way $ make_sandbox /path/to/mysql-5.1.54_linux.tar.gz $ make_sandbox Percona-Server-5.1.54_linux.tar.gz # it should work always Tuesday, October 25, 11
  • 39. The easier way $ make_sandbox 5.1.54 # Needs some preliminary work Tuesday, October 25, 11
  • 40. The easiest way $ sb 5.1.54 # Needs the same preliminary work Tuesday, October 25, 11
  • 41. MySQL Sandbox VERSION MySQL server Data DB1 DB2 DB3 $SANDBOX_HOME/msb_VERSION/data VERSION /tmp/mysql_VERSION.sock Tuesday, October 25, 11
  • 42. MySQL Sandbox 5.1.54 MySQL server Data DB1 DB2 DB3 $SANDBOX_HOME/msb_5_1_54/data 5154 /tmp/mysql_5154.sock Tuesday, October 25, 11
  • 43. MySQL Sandbox 5.5.9 MySQL server Data DB1 DB2 DB3 $SANDBOX_HOME/msb_5_5_09/data 5509 /tmp/mysql_5509.sock Tuesday, October 25, 11
  • 44. Single Sandbox MySQL customized scripts server start stop restart status clear send_kill use Tuesday, October 25, 11
  • 45. Multiple Sandbox MySQL customized scripts server start_all stop_all restart_all m n1 status_all s1 n2 clear_all s2 n3 send_kill_a ll use_all Tuesday, October 25, 11
  • 46. Where do you get it •from CPAN sudo cpan MySQL::Sandbox •from launchpad http://launchpad.net/mysql-sandbox Tuesday, October 25, 11
  • 47. The easy replication way $ make_replication_sandbox /path/to/mysql-5.1.54_linux.tar.gz # or, after some preparation $ make_replication_sandbox 5.1.54 Tuesday, October 25, 11
  • 48. default architecture $HOME /sandboxes opt expanded tarballs $SANDBOX_HOME mysql $SANDBOX_BINARY installed sandboxes Tuesday, October 25, 11
  • 49. default architecture $HOME /sandboxes opt msb_5_0_91 mysql msb_5_1_48 5.0.91 rsandbox_5_1_48 5.1.45 master 5.1.48 node1 5.5.4 node2 Tuesday, October 25, 11
  • 51. creating a single sandbox make_sandbox /path/to/mysql-X.X.XX-OS.tar.gz Tuesday, October 25, 11
  • 52. using a single sandbox # after # make_sandbox # /path/to/mysql-X.X.XX-OS.tar.gz $ cd $SANDBOX_HOME/msb_X_X_XX $ ./use Tuesday, October 25, 11
  • 53. creating a single sandbox with a specific options file make_sandbox /path/to/mysql-X.X.XX-OS.tar.gz -- --my_file=/path/to/my.cnf Tuesday, October 25, 11
  • 54. easily create a sandbox after the first one The long way $ cd $HOME/opt/mysql # $SANDBOX_BINARY $ gunzip -c /path/to/mysql-5.1.34-osx10.5-x86.tar.gz | tar -xf - $ mv mysql-5.1.34-osx10.5-x86 5.1.34 $ make sandbox 5.1.34 Tuesday, October 25, 11
  • 55. easily create a sandbox after the first one The short way $ make_sandbox --export_binaries path/to/mysql-5.1.34-osx10.5-x86.tar.gz Tuesday, October 25, 11
  • 56. starting a single sandbox $ cd $SANDBOX_HOME/msb_X_X_XX $ ./start Tuesday, October 25, 11
  • 57. starting a single sandbox with temporary options $ cd $SANDBOX_HOME/msb_X_X_XX $ ./start --option=value $ ./restart --option=value $ ./start --key-buffer=20000000 Tuesday, October 25, 11
  • 58. creating a sandbox with custom port and directory $ make_sandbox 5.1.34 -- --sandbox_port=7800 --sandbox_directory=mickeymouse Tuesday, October 25, 11
  • 59. creating a sandbox with automatic port checking $ make_sandbox 5.1.34 -- --check_port # if 5.1.34 is free # port=5134 # directory=msb_5_1_34 # else # port=5135 (or the first free) # directory=msb_5_1_34_a Tuesday, October 25, 11
  • 60. create a replication sandbox $ make_replication_sandbox path/to/mysql-5.1.34-osx10.5-x86.tar.gz Tuesday, October 25, 11
  • 61. create a circular replication sandbox $ make_replication_sandbox --circular=4 path/to/mysql-5.1.34-osx10.5-x86.tar.gz Tuesday, October 25, 11
  • 62. changing port to an existing sandbox $ sbtool -o port -s /path/to/source/sandbox --new_port=XXXX Tuesday, October 25, 11
  • 63. installing the innodb plugin $ sbtool -o plugin --plugin=innodb -s /path/to/source/sandbox Tuesday, October 25, 11
  • 64. creating a replication sandbox with new base port $ make_replication_sandbox --replication_directory=newwdir --check_base_port 5.0.79 # Creates a replication directory under # $SANDBOX_HOME/newdir # The previous one is preserved. # No conflicts happen Tuesday, October 25, 11
  • 65. more recipes $ perldoc MySQL::Sandbox::Recipes Tuesday, October 25, 11
  • 68. replicator 1 replicator TSB 2 replicator 3 database HOME 1 database sandboxes base_dir 2 database 3 Tuesday, October 25, 11
  • 69. tungsten sandbox help ./tools/tungsten-sandbox -h USAGE: ./tools/tungsten-sandbox [flags] args flags: -n,--nodes: how many nodes to install (default: 3) -m,--mysql_version: which MySQL version to use (default: '5.5.13') -t,--tungsten_base: where to install the sandbox (default: '$HOME/tsb2/') -d,--group_dir: sandbox group directory name (default: 'tr_dbs') -x,--tsb_prefix: Tungsten Sandbox prefix (default: 'db') -s,--service: how the service is named (default: 'tsandbox') -P,--base_port: port base for MySQL sandbox nodes (default: 7100) -l,--thl_port: port for the THL service (default: 12110) -r,--rmi_port: port for the RMI service (default: 10100) -v,--[no]version: show Tungsten sandbox version (default: false) -h,--[no]help: show Tungsten sandbox help (default: false) Tuesday, October 25, 11
  • 70. tungsten sandbox $ ./tools/tungsten-sandbox -m 5.5.10 executing "clear" on node 1 executing "clear" on node 2 executing "clear" on node 3 installing node 1 installing node 2 installing node 3 group directory installed in $HOME/sandboxes/tr_dbs Tuesday, October 25, 11
  • 71. tungsten sandbox ls ~/tsb2 clear_tsandbox db1 db2 db3 db_clear_all db_send_kill_all db_start_all db_status_all db_stop_all db_use_all n1 n2 n3 replicator_all start_tsandbox trepctl_all Tuesday, October 25, 11
  • 74. THANKS Let's talk! This work is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License. To view a copy of this license, visit http:// creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. Tuesday, October 25, 11