SlideShare uma empresa Scribd logo
1 de 56
Baixar para ler offline
MySQL Sandbox
A toolkit for laziness
Giuseppe Maxia
MySQL Community Team Lead at Oracle




                   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.
Thursday, 15 July 2010
about me - Giuseppe Maxia
 •       a.k.a. The Data Charmer
 •       MySQL Community Team Lead
 •       Long time hacking with MySQL features
 •       Formerly, database consultant, designer, coder.
 •       A passion for QA
 •       An even greater passion for open source
 •       ... and community
 •       Passionate blogger

 • http://datacharmer.blogspot.com
Thursday, 15 July 2010
Laziness
         Laziness is a disinclination to
         activity or exertion despite
         having the ability to do so.



         http://en.wikipedia.org/wiki/Laziness
Thursday, 15 July 2010
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.
Thursday, 15 July 2010
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.
Thursday, 15 July 2010
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.

Thursday, 15 July 2010
I can set up circular
                              replication

                     • Almost always with errors.
                     • And cursing.
                     • Do I feel inclined to do so?
                     • I DON'T THINK SO.


Thursday, 15 July 2010
I can install plugins

          • After reading the manual.
          • And translating from intentions to reality.
          • And copying-and-pasting.
          • Do I feel inclined to do so?
          • I DON'T THINK SO.

Thursday, 15 July 2010
I have the ability
                     • but I don't feel inclined to do repetitive
                         work
                     • I ADMIT IT: I AM LAZY



Thursday, 15 July 2010
YES: I AM A
                           LAZY
                         DEVELOPER


Thursday, 15 July 2010
A lazy developer ®

        Someone who writes 12,000
        lines of code to save himself  (*)
        the trouble of typing 15 lines
        on a terminal.
(*) And another 1,000,000 people
Thursday, 15 July 2010
That's me




Thursday, 15 July 2010
And after this
                          presentation,
                         you will feel lazy
                               too

Thursday, 15 July 2010
MySQL Sandbox
                        lightning
                      presentation

Thursday, 15 July 2010
I used to install a lot
                         of MySQL databases
                              for testing

                   MANUALLY
Thursday, 15 July 2010
Then, I decided to
                     use Perl ...


Thursday, 15 July 2010
DBA pop
                           quiz
Thursday, 15 July 2010
HOW MANY
                           KEYSTROKES
                         to install a MySQL
                               server?
                      10
              sb 5.0.83
              1234567890
Thursday, 15 July 2010
HOW MANY
                     KEYSTROKES
                   to install 3 MySQL
                 servers in replication?
                 11
        sb r5.0.83
        12345678901
Thursday, 15 July 2010
HOW LONG
                             does it take
                         to install a MySQL
                               server?
                           < 5 seconds
                         time sb 5.0.83
                            0m1.518s
Thursday, 15 July 2010
HOW LONG
                       does it take
                   to install 3 MySQL
                 servers in replication?
                         < 10 seconds
                         sb 5.0.83
                          0m4.515s
Thursday, 15 July 2010
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

Thursday, 15 July 2010
Overview




  data directory                    data directory

     port                           port

     socket                         socket



Thursday, 15 July 2010
Overview

                          same data
                          directory?



  /usr/local/mysql/data                /usr/local/mysql/data




                         data corruption


Thursday, 15 July 2010
Overview
                                same data
                                 port or
                                 socket?

           3306                             3306

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



                            does not start

Thursday, 15 July 2010
the hard way
           1.unpack the tarball
           2.ensure that it goes to a separate directory
           3.create the database tables
           4.create a .cnf file with separate
                 • port
                 • data directory
                                                error prone
                 • socket
           5.launch mysqld_safe manually
           6.launch mysql with options


Thursday, 15 July 2010
MySQL Sandbox                       VERSION




                    $SANDBOX_HOME/msb_VERSION/data

                   VERSION

                /tmp/mysql_VERSION.sock


Thursday, 15 July 2010
MySQL Sandbox                             5.1.37




                         $SANDBOX_HOME/msb_5_1_37/data

                         5137

                         /tmp/mysql_5137.sock


Thursday, 15 July 2010
MySQL Sandbox                             5.4.1




                         $SANDBOX_HOME/msb_5_4_1/data

                         5401

                         /tmp/mysql_5401.sock


Thursday, 15 July 2010
MySQL Sandbox
                                   single sandbox
                                      commands
                 start
                 stop        use
                status
                restart
                 clear
               send_kill

Thursday, 15 July 2010
MySQL Sandbox     multiple sandbox
                            commands

                         One sandbox to
                          rule them all
        start_all
        stop_all               m    n1
       status_all              s1   n2
        clear_all              s2   n3
      send_kill_all
         use_all
Thursday, 15 July 2010
The easy way - installation

 # as root
 $ cpan
 cpan> install MySQL::Sandbox




Thursday, 15 July 2010
The easy way - single sandbox

 $ make_sandbox 
     /path/mysql-OS-5.1.37.tar.gz

 # that's it!




Thursday, 15 July 2010
The easy way - replication
      $ make_replication_sandbox 
          /path/mysql-OS-5.1.37.tar.gz

      # that's it!




Thursday, 15 July 2010
default architecture
                                            $HOME




                               /sandboxes            opt
                                                                 expanded
                                                                  tarballs
                          $SANDBOX_HOME
                                                    mysql


                                               $SANDBOX_BINARY
          installed
         sandboxes

Thursday, 15 July 2010
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
Thursday, 15 July 2010
Thursday, 15 July 2010
creating a single sanbox
                 make_sandbox 
                    /path/to/mysql-X.X.XX-OS.tar.gz




Thursday, 15 July 2010
using a single sanbox
                 # after
                 # make_sandbox 
                 #   /path/to/mysql-X.X.XX-OS.tar.gz

                 $ cd $SANDBOX_HOME/msb_X_X_XX
                 $ ./use




Thursday, 15 July 2010
creating a single sanbox
            with a specific options file
                 make_sandbox 
                    /path/to/mysql-X.X.XX-OS.tar.gz 
                    --my_file=/path/to/my.cnf




Thursday, 15 July 2010
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




Thursday, 15 July 2010
easily create a sandbox after
              the first one
                         The short way
 $ make_sandbox 
   path/to/mysql-5.1.34-osx10.5-x86.tar.gz 
   --export_binaries




Thursday, 15 July 2010
starting a single sanbox
                 $ cd $SANDBOX_HOME/msb_X_X_XX
                 $ ./start




Thursday, 15 July 2010
starting a single sanbox
                 with temporary options
                 $ cd $SANDBOX_HOME/msb_X_X_XX
                 $ ./start --option=value


                 $ ./restart --option=value


                 $ ./start --key-buffer=20000000




Thursday, 15 July 2010
creating a sandbox with
         custom port and directory
                 $ make_sandbox 5.1.34 
                    --sandbox_port=7800 
                    --sandbox_directory=mickeymouse




Thursday, 15 July 2010
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




Thursday, 15 July 2010
create a replication sandbox

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




Thursday, 15 July 2010
create a circular replication
                  sandbox
 $ make_replication_sandbox 
   --circular=4 
   path/to/mysql-5.1.34-osx10.5-x86.tar.gz




Thursday, 15 July 2010
changing port to an existing
               sandbox
 $ sbtool -o port 
     -s /path/to/source/sandbox 
     --new_port=XXXX




Thursday, 15 July 2010
installing the innodb plugin

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




Thursday, 15 July 2010
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

Thursday, 15 July 2010
more recipes

 $ perldoc MySQL::Sandbox::Recipes




Thursday, 15 July 2010
Participate!




Thursday, 15 July 2010
roadmap
                                     NORTH




                         WEST   66            95   EAST




                                      SOUTH




Thursday, 15 July 2010
roadmap: what's up
                     • new architecture:
                      • one deployer class (can install a server)
                      • subclasses will deploy on different O.S.
                      • setup wizard for test and production
                      • Cluster friendly
                      • Cloud friendly
                     • written in Python
Thursday, 15 July 2010
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.
Thursday, 15 July 2010

Mais conteúdo relacionado

Mais procurados

Empa Edtec Talk April 2010
Empa Edtec Talk April 2010Empa Edtec Talk April 2010
Empa Edtec Talk April 2010andersand
 
Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuerybenvinegar
 
Hardcore Extending Rails 3 - From RailsConf '10
Hardcore Extending Rails 3 - From RailsConf '10Hardcore Extending Rails 3 - From RailsConf '10
Hardcore Extending Rails 3 - From RailsConf '10Rick Martínez
 
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Zi Bin Cheah
 

Mais procurados (6)

Continuous Integration
Continuous IntegrationContinuous Integration
Continuous Integration
 
Empa Edtec Talk April 2010
Empa Edtec Talk April 2010Empa Edtec Talk April 2010
Empa Edtec Talk April 2010
 
Building a Website The Easy Way With Wordpress
Building a Website The Easy Way With WordpressBuilding a Website The Easy Way With Wordpress
Building a Website The Easy Way With Wordpress
 
Building Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQueryBuilding Distributed JavaScript Widgets with jQuery
Building Distributed JavaScript Widgets with jQuery
 
Hardcore Extending Rails 3 - From RailsConf '10
Hardcore Extending Rails 3 - From RailsConf '10Hardcore Extending Rails 3 - From RailsConf '10
Hardcore Extending Rails 3 - From RailsConf '10
 
Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010Html5/CSS3 in shanghai 2010
Html5/CSS3 in shanghai 2010
 

Destaque

Understanding query-execution806
Understanding query-execution806Understanding query-execution806
Understanding query-execution806yubao fu
 
56 Query Optimization
56 Query Optimization56 Query Optimization
56 Query OptimizationMYXPLAIN
 
Redis介绍
Redis介绍 Redis介绍
Redis介绍 yubao fu
 
搜索技巧
搜索技巧搜索技巧
搜索技巧lnptao
 
Ethernet Technology
Ethernet Technology Ethernet Technology
Ethernet Technology Ali Usman
 

Destaque (7)

Understanding query-execution806
Understanding query-execution806Understanding query-execution806
Understanding query-execution806
 
56 Query Optimization
56 Query Optimization56 Query Optimization
56 Query Optimization
 
Explain
ExplainExplain
Explain
 
Redis介绍
Redis介绍 Redis介绍
Redis介绍
 
搜索技巧
搜索技巧搜索技巧
搜索技巧
 
Vim再入門
Vim再入門Vim再入門
Vim再入門
 
Ethernet Technology
Ethernet Technology Ethernet Technology
Ethernet Technology
 

Semelhante a MySQL Sandbox - A toolkit for laziness

Ignite@DevOpsDays - Why devs need ops
Ignite@DevOpsDays - Why devs need opsIgnite@DevOpsDays - Why devs need ops
Ignite@DevOpsDays - Why devs need opsMichael Brunton-Spall
 
Pantheon @ Drupal Down Under
Pantheon @ Drupal Down UnderPantheon @ Drupal Down Under
Pantheon @ Drupal Down UnderChapter Three
 
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)Michael Bleigh
 
Poisoning Rubinius: The _why and How
Poisoning Rubinius: The _why and HowPoisoning Rubinius: The _why and How
Poisoning Rubinius: The _why and HowBrian Ford
 
Containers in 5... 9 minutes
Containers in 5... 9 minutesContainers in 5... 9 minutes
Containers in 5... 9 minutesEdwin Cruz
 
Real Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakReal Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakEast Bay WordPress Meetup
 
Dist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsDist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsRicardo Signes
 
Please Don't Touch the Slow Parts V2
Please Don't Touch the Slow Parts V2Please Don't Touch the Slow Parts V2
Please Don't Touch the Slow Parts V2Federico Galassi
 
The Reluctant SysAdmin : 360|iDev Austin 2010
The Reluctant SysAdmin : 360|iDev Austin 2010The Reluctant SysAdmin : 360|iDev Austin 2010
The Reluctant SysAdmin : 360|iDev Austin 2010Voxilate
 
Ops for Developers
Ops for DevelopersOps for Developers
Ops for DevelopersMojo Lingo
 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disquszeeg
 
DevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsDevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsRob Reynolds
 
A Match Made In The Cloud
A Match Made In The CloudA Match Made In The Cloud
A Match Made In The CloudChapter Three
 
Introductiontomysql 100420092731-phpapp01
Introductiontomysql 100420092731-phpapp01Introductiontomysql 100420092731-phpapp01
Introductiontomysql 100420092731-phpapp01sagaroceanic11
 
Scaling with Postgres (Highload++ 2010)
Scaling with Postgres (Highload++ 2010)Scaling with Postgres (Highload++ 2010)
Scaling with Postgres (Highload++ 2010)Robert Treat
 
Mysql features for the enterprise
Mysql features for the enterpriseMysql features for the enterprise
Mysql features for the enterpriseGiuseppe Maxia
 

Semelhante a MySQL Sandbox - A toolkit for laziness (20)

Drupal In The Cloud
Drupal In The CloudDrupal In The Cloud
Drupal In The Cloud
 
Ignite@DevOpsDays - Why devs need ops
Ignite@DevOpsDays - Why devs need opsIgnite@DevOpsDays - Why devs need ops
Ignite@DevOpsDays - Why devs need ops
 
Pantheon @ Drupal Down Under
Pantheon @ Drupal Down UnderPantheon @ Drupal Down Under
Pantheon @ Drupal Down Under
 
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)Persistence  Smoothie: Blending SQL and NoSQL (RubyNation Edition)
Persistence Smoothie: Blending SQL and NoSQL (RubyNation Edition)
 
Poisoning Rubinius: The _why and How
Poisoning Rubinius: The _why and HowPoisoning Rubinius: The _why and How
Poisoning Rubinius: The _why and How
 
Containers in 5... 9 minutes
Containers in 5... 9 minutesContainers in 5... 9 minutes
Containers in 5... 9 minutes
 
Real Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan DidakReal Developer Tools for WordPress by Stefan Didak
Real Developer Tools for WordPress by Stefan Didak
 
Plone on RelStorage
Plone on RelStoragePlone on RelStorage
Plone on RelStorage
 
Dist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN DistributionsDist::Zilla - Maximum Overkill for CPAN Distributions
Dist::Zilla - Maximum Overkill for CPAN Distributions
 
Please Don't Touch the Slow Parts V2
Please Don't Touch the Slow Parts V2Please Don't Touch the Slow Parts V2
Please Don't Touch the Slow Parts V2
 
The Reluctant SysAdmin : 360|iDev Austin 2010
The Reluctant SysAdmin : 360|iDev Austin 2010The Reluctant SysAdmin : 360|iDev Austin 2010
The Reluctant SysAdmin : 360|iDev Austin 2010
 
Ops for Developers
Ops for DevelopersOps for Developers
Ops for Developers
 
PyCon 2011 Scaling Disqus
PyCon 2011 Scaling DisqusPyCon 2011 Scaling Disqus
PyCon 2011 Scaling Disqus
 
100 paper cuts
100 paper cuts100 paper cuts
100 paper cuts
 
Node.js and Ruby
Node.js and RubyNode.js and Ruby
Node.js and Ruby
 
DevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on WindowsDevOps: Getting Started with Puppet on Windows
DevOps: Getting Started with Puppet on Windows
 
A Match Made In The Cloud
A Match Made In The CloudA Match Made In The Cloud
A Match Made In The Cloud
 
Introductiontomysql 100420092731-phpapp01
Introductiontomysql 100420092731-phpapp01Introductiontomysql 100420092731-phpapp01
Introductiontomysql 100420092731-phpapp01
 
Scaling with Postgres (Highload++ 2010)
Scaling with Postgres (Highload++ 2010)Scaling with Postgres (Highload++ 2010)
Scaling with Postgres (Highload++ 2010)
 
Mysql features for the enterprise
Mysql features for the enterpriseMysql features for the enterprise
Mysql features for the enterprise
 

Mais de 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
 
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
 

Mais de 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
 
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
 

Último

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

MySQL Sandbox - A toolkit for laziness

  • 1. MySQL Sandbox A toolkit for laziness Giuseppe Maxia MySQL Community Team Lead at Oracle 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. Thursday, 15 July 2010
  • 2. about me - Giuseppe Maxia • a.k.a. The Data Charmer • MySQL Community Team Lead • Long time hacking with MySQL features • Formerly, database consultant, designer, coder. • A passion for QA • An even greater passion for open source • ... and community • Passionate blogger • http://datacharmer.blogspot.com Thursday, 15 July 2010
  • 3. Laziness Laziness is a disinclination to activity or exertion despite having the ability to do so. http://en.wikipedia.org/wiki/Laziness Thursday, 15 July 2010
  • 4. 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. Thursday, 15 July 2010
  • 5. 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. Thursday, 15 July 2010
  • 6. 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. Thursday, 15 July 2010
  • 7. I can set up circular replication • Almost always with errors. • And cursing. • Do I feel inclined to do so? • I DON'T THINK SO. Thursday, 15 July 2010
  • 8. I can install plugins • After reading the manual. • And translating from intentions to reality. • And copying-and-pasting. • Do I feel inclined to do so? • I DON'T THINK SO. Thursday, 15 July 2010
  • 9. I have the ability • but I don't feel inclined to do repetitive work • I ADMIT IT: I AM LAZY Thursday, 15 July 2010
  • 10. YES: I AM A LAZY DEVELOPER Thursday, 15 July 2010
  • 11. A lazy developer ® Someone who writes 12,000 lines of code to save himself (*) the trouble of typing 15 lines on a terminal. (*) And another 1,000,000 people Thursday, 15 July 2010
  • 13. And after this presentation, you will feel lazy too Thursday, 15 July 2010
  • 14. MySQL Sandbox lightning presentation Thursday, 15 July 2010
  • 15. I used to install a lot of MySQL databases for testing MANUALLY Thursday, 15 July 2010
  • 16. Then, I decided to use Perl ... Thursday, 15 July 2010
  • 17. DBA pop quiz Thursday, 15 July 2010
  • 18. HOW MANY KEYSTROKES to install a MySQL server? 10 sb 5.0.83 1234567890 Thursday, 15 July 2010
  • 19. HOW MANY KEYSTROKES to install 3 MySQL servers in replication? 11 sb r5.0.83 12345678901 Thursday, 15 July 2010
  • 20. HOW LONG does it take to install a MySQL server? < 5 seconds time sb 5.0.83 0m1.518s Thursday, 15 July 2010
  • 21. HOW LONG does it take to install 3 MySQL servers in replication? < 10 seconds sb 5.0.83 0m4.515s Thursday, 15 July 2010
  • 22. 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 Thursday, 15 July 2010
  • 23. Overview data directory data directory port port socket socket Thursday, 15 July 2010
  • 24. Overview same data directory? /usr/local/mysql/data /usr/local/mysql/data data corruption Thursday, 15 July 2010
  • 25. Overview same data port or socket? 3306 3306 /tmp/mysql.sock /tmp/mysql.sock does not start Thursday, 15 July 2010
  • 26. the hard way 1.unpack the tarball 2.ensure that it goes to a separate directory 3.create the database tables 4.create a .cnf file with separate • port • data directory error prone • socket 5.launch mysqld_safe manually 6.launch mysql with options Thursday, 15 July 2010
  • 27. MySQL Sandbox VERSION $SANDBOX_HOME/msb_VERSION/data VERSION /tmp/mysql_VERSION.sock Thursday, 15 July 2010
  • 28. MySQL Sandbox 5.1.37 $SANDBOX_HOME/msb_5_1_37/data 5137 /tmp/mysql_5137.sock Thursday, 15 July 2010
  • 29. MySQL Sandbox 5.4.1 $SANDBOX_HOME/msb_5_4_1/data 5401 /tmp/mysql_5401.sock Thursday, 15 July 2010
  • 30. MySQL Sandbox single sandbox commands start stop use status restart clear send_kill Thursday, 15 July 2010
  • 31. MySQL Sandbox multiple sandbox commands One sandbox to rule them all start_all stop_all m n1 status_all s1 n2 clear_all s2 n3 send_kill_all use_all Thursday, 15 July 2010
  • 32. The easy way - installation # as root $ cpan cpan> install MySQL::Sandbox Thursday, 15 July 2010
  • 33. The easy way - single sandbox $ make_sandbox /path/mysql-OS-5.1.37.tar.gz # that's it! Thursday, 15 July 2010
  • 34. The easy way - replication $ make_replication_sandbox /path/mysql-OS-5.1.37.tar.gz # that's it! Thursday, 15 July 2010
  • 35. default architecture $HOME /sandboxes opt expanded tarballs $SANDBOX_HOME mysql $SANDBOX_BINARY installed sandboxes Thursday, 15 July 2010
  • 36. 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 Thursday, 15 July 2010
  • 38. creating a single sanbox make_sandbox /path/to/mysql-X.X.XX-OS.tar.gz Thursday, 15 July 2010
  • 39. using a single sanbox # after # make_sandbox # /path/to/mysql-X.X.XX-OS.tar.gz $ cd $SANDBOX_HOME/msb_X_X_XX $ ./use Thursday, 15 July 2010
  • 40. creating a single sanbox with a specific options file make_sandbox /path/to/mysql-X.X.XX-OS.tar.gz --my_file=/path/to/my.cnf Thursday, 15 July 2010
  • 41. 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 Thursday, 15 July 2010
  • 42. easily create a sandbox after the first one The short way $ make_sandbox path/to/mysql-5.1.34-osx10.5-x86.tar.gz --export_binaries Thursday, 15 July 2010
  • 43. starting a single sanbox $ cd $SANDBOX_HOME/msb_X_X_XX $ ./start Thursday, 15 July 2010
  • 44. starting a single sanbox with temporary options $ cd $SANDBOX_HOME/msb_X_X_XX $ ./start --option=value $ ./restart --option=value $ ./start --key-buffer=20000000 Thursday, 15 July 2010
  • 45. creating a sandbox with custom port and directory $ make_sandbox 5.1.34 --sandbox_port=7800 --sandbox_directory=mickeymouse Thursday, 15 July 2010
  • 46. 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 Thursday, 15 July 2010
  • 47. create a replication sandbox $ make_replication_sandbox path/to/mysql-5.1.34-osx10.5-x86.tar.gz Thursday, 15 July 2010
  • 48. create a circular replication sandbox $ make_replication_sandbox --circular=4 path/to/mysql-5.1.34-osx10.5-x86.tar.gz Thursday, 15 July 2010
  • 49. changing port to an existing sandbox $ sbtool -o port -s /path/to/source/sandbox --new_port=XXXX Thursday, 15 July 2010
  • 50. installing the innodb plugin $ sbtool -o plugin --plugin=innodb -s /path/to/source/sandbox Thursday, 15 July 2010
  • 51. 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 Thursday, 15 July 2010
  • 52. more recipes $ perldoc MySQL::Sandbox::Recipes Thursday, 15 July 2010
  • 54. roadmap NORTH WEST 66 95 EAST SOUTH Thursday, 15 July 2010
  • 55. roadmap: what's up • new architecture: • one deployer class (can install a server) • subclasses will deploy on different O.S. • setup wizard for test and production • Cluster friendly • Cloud friendly • written in Python Thursday, 15 July 2010
  • 56. 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. Thursday, 15 July 2010