sandbox 快速部署mysql

时间:2022-10-10 11:22:35

MySQL Sandbox is a tool that installs one or more MySQL servers within seconds, easily, securely, and with full control.

Once installed, the sandbox is easily used and maintained, without using complex options.

Replicated and multiple sandboxes can be used individually or all at once.

通过mysql sandbox可以快速部署多种mysql使用环境包括:单实例mysql,多实例mysql,单机mysql replication环境

1.下载mysql sandbox

​http://mysqlsandbox.net/index.html​

2.安装所需的包

MySQL-Sandbox-3.1.05.tar.gz
mysql-5.6.28-linux-glibc2.5-x86_64.tar.gz

3.安装

tar -zxvf MySQL-Sandbox-3.1.05.tar.gz
mv MySQL-Sandbox-3.1.05 /usr/local/sandbox
cd /usr/local/sandbox
yum install perl-ExtUtils-Embed -y
perl Makefile.PL
make
make test
make install

4.配置

echo 'export SANDBOX_AS_ROOT=1' >> /root/.bash_profile
source /root/.bash_profile

5.sandbox相关命令

make_sandbox
make_multiple_sandbox
make_replication_sandbox
make_sandbox_from_installed
make_sandbox_from_source
make_multiple_custom_sandbox

6.make_sandbox

make_sandbox  mysql-5.6.28-linux-glibc2.5-x86_64.tar.gz

sandbox 快速部署mysql

默认在家目录下的sandboxes下

sandbox 快速部署mysql

启动mysql(默认已经启动了)

pgrep -fl mysql 

sandbox 快速部署mysql

可以杀掉进程,自己启动看看,启动停止脚本在/root/sandboxes/msb_5_6_28

pkill -9 mysqld
./start

sandbox 快速部署mysql

登陆mysql

./use

sandbox 快速部署mysql

7.make_multiple_sandbox(安装多个实例,默认为3个)

make_multiple_sandbox mysql-5.6.28-linux-glibc2.5-x86_64.tar.gz  

sandbox 快速部署mysql

默认部署3个实例,想要部署更多实例可以加参数--how_many_nodes = number,上面部署完成以后我们看看 

sandbox 快速部署mysql

登陆相应的实例看看

./n1

sandbox 快速部署mysql

./n2

sandbox 快速部署mysql

./n3

sandbox 快速部署mysql

到此sandbox安装完成啦!!!