MySQL Sandbox · Creating a replication sandbox •as normal user # make_replication_sandbox \...

Preview:

Citation preview

MySQL Sandbox•one (unix) host

•many database servers

•single or multiple sandboxes

•installs IN SECONDS

•Free software (GPL)

http://mysqlsandbox.net

Monday, 20 July 2009

1 host - many servers

HOST

Monday, 20 July 2009

1 host - many servers

HOST

5.0.83

single

Monday, 20 July 2009

1 host - many servers

HOST

5.0.83

single

5.1.35

single

Monday, 20 July 2009

1 host - many servers

HOST

5.0.83

single

5.1.35

single

5.4.1single

Monday, 20 July 2009

1 host - many servers

HOST

5.0.83

single

5.1.35

single

5.4.1single

master

slave slave

5.0.82

standardreplication

5.0.825.0.82

Monday, 20 July 2009

1 host - many servers

HOST

5.0.83

single

5.1.35

single

5.4.1single

5.1.35

5.4.15.0.83

group

master

slave slave

5.0.82

standardreplication

5.0.825.0.82

Monday, 20 July 2009

1 host - many servers

HOST

5.0.83

single

5.1.35

single

5.4.1single

5.1.34

5.1.34

5.1.345.1.34

circularreplication

5.1.35

5.4.15.0.83

group

master

slave slave

5.0.82

standardreplication

5.0.825.0.82

Monday, 20 July 2009

1 host - many servers

HOST

5.0.83

single

5.1.35

single

5.4.1single

5.1.34

5.1.34

5.1.345.1.34

circularreplication

5.1.35

5.4.15.0.83

group

master

slave slave

5.0.82

standardreplication

5.0.825.0.82

ALL INDEPENDENT

Monday, 20 July 2009

Installation

•as root

#cpanMySQL::Sandbox

Monday, 20 July 2009

Creating a single sandbox

•as normal user

#make_sandbox\

/path/to/mysql‐5.1.35‐YOUROS.gz

Monday, 20 July 2009

Creating a single sandbox

•as normal user

#make_sandbox\

/path/to/mysql‐5.1.35‐YOUROS.gz

•if you have expanded tarballs already

Monday, 20 July 2009

Creating a single sandbox

•as normal user

#make_sandbox\

/path/to/mysql‐5.1.35‐YOUROS.gz

•if you have expanded tarballs already

#make_sandbox5.1.35

Monday, 20 July 2009

Creating a single sandbox

•as normal user

#make_sandbox\

/path/to/mysql‐5.1.35‐YOUROS.gz

•if you have expanded tarballs already

#make_sandbox5.1.35

< 10 seconds!Monday, 20 July 2009

Creating a replication sandbox

•as normal user

#make_replication_sandbox\

/path/to/mysql‐5.1.35‐YOUROS.gz

Monday, 20 July 2009

Creating a replication sandbox

•as normal user

#make_replication_sandbox\

/path/to/mysql‐5.1.35‐YOUROS.gz

•if you have expanded tarballs already

Monday, 20 July 2009

Creating a replication sandbox

•as normal user

#make_replication_sandbox\

/path/to/mysql‐5.1.35‐YOUROS.gz

•if you have expanded tarballs already

#make_replication_sandbox5.1.35

Monday, 20 July 2009

Creating a replication sandbox

•as normal user

#make_replication_sandbox\

/path/to/mysql‐5.1.35‐YOUROS.gz

•if you have expanded tarballs already

#make_replication_sandbox5.1.35

< 20 seconds!Monday, 20 July 2009

SHORTCUT - Creating and Using a sandbox

Monday, 20 July 2009

SHORTCUT - Creating and Using a sandbox

•as normal user (requires version 3.0.04)

Monday, 20 July 2009

SHORTCUT - Creating and Using a sandbox

•as normal user (requires version 3.0.04)

#sb5.0.83

Monday, 20 July 2009

SHORTCUT - Creating and Using a sandbox

•as normal user (requires version 3.0.04)

#sb5.0.83

< 5 seconds!Monday, 20 July 2009

example$make_sandbox5.0.82[...].sandboxserverstartedYoursandboxserverwasinstalledin$SANDBOX_HOME/msb_5_0_82

$$SANDBOX_HOME/msb_5_0_82/use\‐e"selectversion()"+‐‐‐‐‐‐‐‐‐‐‐+|version()|+‐‐‐‐‐‐‐‐‐‐‐+|5.0.82|+‐‐‐‐‐‐‐‐‐‐‐+

Monday, 20 July 2009

example (shortcut)

$timesb5.0.82‐e"selectversion()"[...].sandboxserverstartedYoursandboxserverwasinstalledin$SANDBOX_HOME/msb_5_0_82+‐‐‐‐‐‐‐‐‐‐‐+|version()|+‐‐‐‐‐‐‐‐‐‐‐+|5.0.82|+‐‐‐‐‐‐‐‐‐‐‐+

real 0m2.041suser 0m0.290ssys0m0.210s

Monday, 20 July 2009

example replication $make_replication_sandbox5.0.82[...]replicationdirectoryinstalledon$SANDBOX_HOME/rsandbox_5_0_82

$$SANDBOX_HOME/rsandbox_5_8_82/m\‐e"selectversion()"

+‐‐‐‐‐‐‐‐‐‐‐+|version()|+‐‐‐‐‐‐‐‐‐‐‐+|5.0.82|+‐‐‐‐‐‐‐‐‐‐‐+

Monday, 20 July 2009

example replication(shortcut)

$timesbr5.0.82‐e"selectversion()"[...]replicationdirectoryinstalledin$HOME/rsandbox_5_0_82+‐‐‐‐‐‐‐‐‐‐‐‐+|version()|+‐‐‐‐‐‐‐‐‐‐‐‐+|5.0.82‐log|+‐‐‐‐‐‐‐‐‐‐‐‐+

real 0m4.682suser 0m0.795ssys0m0.585s

Monday, 20 July 2009

more control with replication

$cd$SANDBOX_HOME/rsandbox_5_8_82$./use_all"SELECT@@server_id"#master@@server_id1#server:1:@@server_id101#server:2:@@server_id102

Monday, 20 July 2009

Self contained•All sandboxes are created inside

$SANDBOX_HOME

•Use all at once

•Great control

http://mysqlsandbox.netMonday, 20 July 2009

Recommended