Continued. Start
here .
Multiple sandboxes.You can create multiple sandboxes with the command
$ make_multiple_sandbox /path/to/tarball
3 sandboxes, one version, without replication will be created.
If necessary, it is also possible to create multiple (3 pieces) of the drawer using different versions of mysql
make_multiple_custom_sandbox /path/to/tarball1 path/to/tarball2 /path/to/tarball3 [options]
where options:
--sandbox_base_port = number - Port number for use by sandboxes. Default 7000 + version number
--check_base_port - Port checking for availability is disabled by default.
--how_many_nodes = number - Number of nodes (servers) to create. Default is 3
--circular - Circular replication.
--repl_user = name - Username for replication. Default (login: rsandbox)
--repl_password = name - Password for user (pass: rsandbox)
--remote_access = name Host for allowed replication user access. The default is 127.%
--interactive You can use this option for interactive confirmation by the user of options for each node. The default is off.
--master_master Creating Master-Master replication.
-v --verbose - To display the installation status of a sandbox.
Sandbox from source.If you need to create a sandbox from freshly copied sources, you can use the command
make_sandbox_from_source {SOURCE_DIRECTORY} {sandbox_type} [options]
Where
SOURCE_DIRECTORY - the folder where "./configure && make" was just successfully executed
sandbox_type - type of sandbox to be created (single | multiple | replication | circular)
options:
--export_binaries - Export generated binary files to / opt / mysql
--sandbox_base_port = number - Port number for use by sandboxes. The default is 7000 + version number
--check_base_port - Port checking for availability is disabled by default.
--how_many_nodes = number - Number of nodes (servers) to create. Default is 3
--circular - Circular replication.
--repl_user = name - Username for replication. Default (login: rsandbox)
--repl_password = name - Password for user (pass: rsandbox)
--remote_access = name Host for allowed replication user access. The default is 127.%
--interactive You can use this option for interactive confirmation by the user of options for each node. The default is off.
--master_master Creating Master-Master replication.
-v --verbose - To display the installation status of a sandbox.
')
The default settings.If you make quite frequent manipulations with tar.gz sandbox installations, you can only specify version numbers, provided they are unpacked into directories called versions of mysql and located in the $ HOME / opt / mysql or / opt / mysql directories. For example, you can deploy tar.gz to the $ HOME / opt / mysql / 5.0.62 or /opt/mysql/5.1.22 folder, and create, specifying only the required versions of mysql for creating sandboxes.
make_sandbox 5.0.62
make_replication_sandbox 5.1.22
make_multiple_custom_sandbox 5.0.62 5.1.22
If you constantly use the same options, or want to change some default options to your own, then all changes can be made in the $ HOME / .msandboxrc file
The environment variables that the sandbox uses are:
HOME - user's home directory (default: $ HOME).
SANDBOX_HOME installation directory (default: $ HOME / sandboxes).
USER is the current user of the system.
SBDEBUG If this variable is set, the program will produce extended output.
UsingAfter creating the sandbox, you get the directory to which all files are located (database / configs and command files from this sandbox). As a rule, the $ SANDBOX_HOME / msb_VERSION directory.
Command files to manage
./start
./stop
./restart
Completely standard files for starting, stopping and restarting the sandbox. The ./start and ./restart scripts accept the keys of the mysql server as keys. for example
./start --skip-innodb
./restart --event-scheduler=disabled
./use
- invokes the mysql console client
./clear
- stops the server and deletes all data.
When using the "multi-server" sandbox, the command files are the same, but with the prefix "_all". In this case, this command will be applied to all participants / replicas.
Available links
./m
- console client to connect to the master (when using master / slave replication)
./s1
(./s2....../sX) - console client to connect to the slave server with X number (using master / slave replication)
./n1
(./n2...../nX) console client for connecting to client #X (using circular replication)