○構築方法
以下のVagrantfileを使用して、Percona ToolkitとPercona Serverをインストールした仮想マシン(Debian Stretch/9.3)を構築する事ができます。
Vagrantfile
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/debian-9.3"
config.vm.hostname = "db93perconaperconatoolkit"
config.vm.provider :virtualbox do |vbox|
vbox.name = "db93perconaperconatoolkit"
vbox.cpus = 2
vbox.memory = 2048
vbox.customize ["modifyvm", :id, "--nicpromisc2","allow-all"]
end
config.vm.network "private_network", ip: "192.168.55.103", :netmask => "255.255.255.0"
config.vm.network "public_network", ip:"192.168.1.103", :netmask => "255.255.255.0"
config.vm.provision "shell", inline: <<-SHELL
apt-get -y install task-japanese
sed -i -e 's/# ja_JP.UTF-8 UTF-8/ja_JP.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
update-locale LANG=ja_JP.UTF-8
localectl set-keymap jp106
apt-get update
#DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
# install percona server
export DEBIAN_FRONTEND=noninteractive
echo "percona-server-server-5.7 percona-server-server/root_password password root" | sudo debconf-set-selections
echo "percona-server-server-5.7 percona-server-server/root_password_again password root" | sudo debconf-set-selections
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
apt-get update
apt-get -y install percona-server-server-5.7
mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' identified by 'root';"
mysql -uroot -e "CREATE DATABASE test DEFAULT CHARACTER SET utf8mb4;"
mysql -uroot -e "CREATE USER test@localhost IDENTIFIED BY 'test';"
mysql -uroot -e "GRANT ALL PRIVILEGES ON test.* TO 'test'@'localhost';"
mysql -uroot -e "FLUSH PRIVILEGES;"
mysql -uroot -proot -e "select * from information_schema.tables;"
# install percona toolkit
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
apt-get update
apt-get -y install percona-toolkit
# display summary information
pt-mysql-summary --user root --password root
SHELL
end
○関連情報
・Percona Toolkitに関する他の記事はこちらを参照してください。
0 件のコメント:
コメントを投稿