use installed instance instead of .tar file

Asked by valdezr on 2009-02-25

Is there a way to create a new sandbox without using a tar file? and instead using the installed mysql in the system?

Question information

English Edit question
MySQL Sandbox Edit question
No assignee Edit question
Last query:
Last reply:

You can do it by calling the low_level_make_sandbox script.

For example, if you want to create a new sandbox, using a 5.1 MySQL server installed in /usr/local/mysql, you can do this:

./low_level_make_sandbox \
        --basedir=/usr/local/mysql \
        --sandbox_directory=msb_xxxx \
        --install_version=5.1 \
        --sandbox_port=15000 \

erin oneill (eonarts) said : #2

Details: On an ubuntu (lenny/sid).
    The MySQL Sandbox, version 3.0.04
    (C) 2006,2007,2008,2009 Giuseppe Maxia

I need to test a simple Master-slave set up using the installed MySQL (5.0.51a).
  (I've already created a main sandbox dir & run the EXPORT)

./low_level_make_sandbox --basedir=/usr/bin --sandbox_directory=/home/dba/sandboxes/msb_5.0.51a --install_version=5.0.51a
and I get this:
Undefined subroutine &main::get_help called at ./low_level_make_sandbox line 291.

So I run this:
 /usr/local/bin/low_level_make_sandbox --basedir=/usr/bin --sandbox_directory=/home/dba/sandboxes/msb_5.0.51a --install_version=5.0.51a --sandbox_port=15000 --no_ver_after_name
Undefined subroutine &main::get_help called at /usr/local/bin/low_level_make_sandbox line 291.

291 line in file:
 get_help( "specified version ($msb->{options}{'install_version'}) not allowed. Currently accepted are [@supported_versions] ");

It looks like my version -- the default for ubuntu is not supported? and mysqld_multi has the bug of starting 2 instances per server.

Thoughts? I need to use this 5.0.51a & I need to test a replication problem on a single server.


erin oneill (eonarts) said : #3

Just an fyi -- I was able to set up a single sandbox with the above help for ubuntu:
low_level_make_sandbox --basedir=/usr --sandbox_directory=msb_5051a --install_version=5.0 --sandbox_port=15000 --no_ver_after_name

That worked just fine & now I have a need for that. However, the Master/Slave settings will come in handy in the future ....

Sorry for the delay. Travels kept me busy.
The problem is that the feature you are asking for is not there yet.
MySQL Sandbox needs a tarball. There is a way of starting a server using an already installed binary (make_sandbox_from_installed), but this option does not cover replication.
Replication is hard coded in make_replication_sandbox, and changing the logic using a different script should not be much difficult. I will eventually need to do it, because of my project of installing remote servers using Gearman or other means.

For now, you have two choices:
* you use a tarball (a small inconvenience, I admit it, but faster than waiting for further development)
* you modify make_replication_sandbox to accept already installed instances (if you do it, please implement some tests in the test suite)



erin oneill (eonarts) said : #5

I figured out that I can only make a simple sandbox using the installed MySQL. So for master-slave I just got another VM for my test.

Then I had my engineers want to put together a sandbox for unit testing but they wanted the INSTALLED MySQL. I just set up 4 sandboxes one at a time that used the installed version of MySQL.

I used this command
low_level_make_sandbox --basedir=/usr --sandbox_directory=msb_5051d --install_version=5.0 --sandbox_port=15006 --no_ver_after_name
The sandbox_directory & sandbox_port are unique to each sandbox.

This worked nicely & I'm very happy to have it! thanks!

Can you help with this problem?

Provide an answer of your own, or ask valdezr for more information if necessary.

To post a message you must log in.