• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
MySQL Sandbox - A toolkit for productive laziness
 

MySQL Sandbox - A toolkit for productive laziness

on

  • 1,253 views

Presentation on MySQL Sandbox at Percona Live, London 2011

Presentation on MySQL Sandbox at Percona Live, London 2011
How to install several MySQL servers in the same host, either stand-alone or in groups, easily and painlessly

Statistics

Views

Total Views
1,253
Views on SlideShare
1,252
Embed Views
1

Actions

Likes
1
Downloads
22
Comments
0

1 Embed 1

http://duckduckgo.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    MySQL Sandbox - A toolkit for productive laziness MySQL Sandbox - A toolkit for productive laziness Presentation Transcript

    • MySQL SandboxA toolkit forproductive lazinessGiuseppe MaxiaQA 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.comTuesday, October 25, 11
    • Laziness Laziness is a disinclination to activity or exertion despite having the ability to do so. http://en.wikipedia.org/wiki/LazinessTuesday, October 25, 11
    • I am an experienced DBATuesday, 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 DONT THINK SO.Tuesday, October 25, 11
    • I am a command line wizardTuesday, October 25, 11
    • I am a command line wizard • After installing multiple serversTuesday, October 25, 11
    • I am a command line wizard • After installing multiple servers • I can use themTuesday, 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 DONT THINK SO.Tuesday, October 25, 11
    • I can set up replicationTuesday, 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 DONT THINK SO.Tuesday, October 25, 11
    • I have the abilityTuesday, October 25, 11
    • I have the ability • but I dont feel inclined to do repetitive workTuesday, October 25, 11
    • I have the ability • but I dont feel inclined to do repetitive work • I ADMIT IT: I AM LAZYTuesday, October 25, 11
    • I have the ability • but I dont feel inclined to do repetitive work • I ADMIT IT: I AM LAZYTuesday, 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 peopleTuesday, October 25, 11
    • Thats meTuesday, 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 SECONDSTuesday, October 25, 11
    • overview MySQL MySQL server server Data DB1 Data DB1 DB2 DB3 DATA DIRECTORY DB2 DB3 PORT SOCKETTuesday, 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 CORRUPTIONTuesday, October 25, 11
    • overview MySQL MySQL server server SAME PORT or SOCKET? 3306 3306 /tmp/mysql.sock /tmp/mysql.sock DOES NOT STARTTuesday, 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 alwaysTuesday, October 25, 11
    • The easier way $ make_sandbox 5.1.54 # Needs some preliminary workTuesday, October 25, 11
    • The easiest way $ sb 5.1.54 # Needs the same preliminary workTuesday, October 25, 11
    • MySQL Sandbox VERSION MySQL server Data DB1 DB2 DB3 $SANDBOX_HOME/msb_VERSION/data VERSION /tmp/mysql_VERSION.sockTuesday, 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.sockTuesday, 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.sockTuesday, October 25, 11
    • Single Sandbox MySQL customized scripts server start stop restart status clear send_kill useTuesday, 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_allTuesday, October 25, 11
    • Where do you get it •from CPAN sudo cpan MySQL::Sandbox •from launchpad http://launchpad.net/mysql-sandboxTuesday, 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.54Tuesday, October 25, 11
    • default architecture $HOME /sandboxes opt expanded tarballs $SANDBOX_HOME mysql $SANDBOX_BINARY installed sandboxesTuesday, 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 node2Tuesday, October 25, 11
    • Tuesday, October 25, 11
    • creating a single sandbox make_sandbox /path/to/mysql-X.X.XX-OS.tar.gzTuesday, 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 $ ./useTuesday, 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.cnfTuesday, 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.34Tuesday, 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.gzTuesday, October 25, 11
    • starting a single sandbox $ cd $SANDBOX_HOME/msb_X_X_XX $ ./startTuesday, 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=20000000Tuesday, October 25, 11
    • creating a sandbox with custom port and directory $ make_sandbox 5.1.34 -- --sandbox_port=7800 --sandbox_directory=mickeymouseTuesday, 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_aTuesday, October 25, 11
    • create a replication sandbox $ make_replication_sandbox path/to/mysql-5.1.34-osx10.5-x86.tar.gzTuesday, October 25, 11
    • create a circular replication sandbox $ make_replication_sandbox --circular=4 path/to/mysql-5.1.34-osx10.5-x86.tar.gzTuesday, October 25, 11
    • changing port to an existing sandbox $ sbtool -o port -s /path/to/source/sandbox --new_port=XXXXTuesday, October 25, 11
    • installing the innodb plugin $ sbtool -o plugin --plugin=innodb -s /path/to/source/sandboxTuesday, 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 happenTuesday, October 25, 11
    • more recipes $ perldoc MySQL::Sandbox::RecipesTuesday, October 25, 11
    • MySQL Sandbox evolutionTuesday, October 25, 11
    • Tungsten SandboxTuesday, October 25, 11
    • replicator 1 replicator TSB 2 replicator 3 database HOME 1 database sandboxes base_dir 2 database 3Tuesday, 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_dbsTuesday, 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_allTuesday, October 25, 11
    • Participate!Tuesday, October 25, 11
    • Participate!Tuesday, October 25, 11
    • THANKS Lets 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