SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
●
●
●
●
●
●
○
○
●
○
○
○
●
○
○
●
●
○
●
○
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX = ENV["BOX"] || "ubuntu/bionic64"
Vagrant.require_version ">= 2.2.14"
Vagrant.configure("2") do |config|
# set Vagrant options
config.vm.box = BOX
...
config.vm.provider "virtualbox" do |vb|
# set provider-level options
...
end
config.vm.provider "vmware_fusion"
config.vm.provision :shell, path: "bootstrap.sh"
end
virtualbox
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "name", "lamp"]
vb.customize ["modifyvm", :id, "--memory", 1024 * 4]
vb.customize ["modifyvm", :id, "--cpuhotplug", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--vram", "4"]
end
virtualbox
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "name", "lamp"]
vb.customize ["modifyvm", :id, "--memory", 1024 * 4]
vb.customize ["modifyvm", :id, "--cpuhotplug", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--vram", "4"]
end
virtualbox
virtualbox
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "name", "lamp"]
vb.customize ["modifyvm", :id, "--memory", 1024 * 4]
vb.customize ["modifyvm", :id, "--cpuhotplug", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--vram", "4"]
end
virtualbox
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "name", "lamp"]
vb.customize ["modifyvm", :id, "--memory", 1024 * 4]
vb.customize ["modifyvm", :id, "--cpuhotplug", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--vram", "4"]
end
VBoxManage modifyvm "VM name" --plugcpu 1
VBoxManage modifyvm "VM name" --unplugcpu 1
virtualbox
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "name", "lamp"]
vb.customize ["modifyvm", :id, "--memory", 1024 * 4]
vb.customize ["modifyvm", :id, "--cpuhotplug", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--vram", "4"]
end
virtualbox
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "name", "lamp"]
vb.customize ["modifyvm", :id, "--memory", 1024 * 4]
vb.customize ["modifyvm", :id, "--cpuhotplug", "on"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--vram", "4"]
end
Vagrant.configure("2") do |config|
...
config.vm.provision :shell, path: "bootstrap.sh"
# OR
config.vm.provision "ansible" do |ansible|
ansible.playbook = "mariadb.yml"
end
end
- name: Upload my.cnf
copy:
src: ./files/my.cnf
dest: /etc/mysql/conf.d/
Creating Vagrant development machines with MariaDB
Creating Vagrant development machines with MariaDB

Contenu connexe

Plus de Federico Razzoli

Recent MariaDB features to learn for a happy life
Recent MariaDB features to learn for a happy lifeRecent MariaDB features to learn for a happy life
Recent MariaDB features to learn for a happy lifeFederico Razzoli
 
Advanced MariaDB features that developers love.pdf
Advanced MariaDB features that developers love.pdfAdvanced MariaDB features that developers love.pdf
Advanced MariaDB features that developers love.pdfFederico Razzoli
 
Automate MariaDB Galera clusters deployments with Ansible
Automate MariaDB Galera clusters deployments with AnsibleAutomate MariaDB Galera clusters deployments with Ansible
Automate MariaDB Galera clusters deployments with AnsibleFederico Razzoli
 
MariaDB, MySQL and Ansible: automating database infrastructures
MariaDB, MySQL and Ansible: automating database infrastructuresMariaDB, MySQL and Ansible: automating database infrastructures
MariaDB, MySQL and Ansible: automating database infrastructuresFederico Razzoli
 
Playing with the CONNECT storage engine
Playing with the CONNECT storage enginePlaying with the CONNECT storage engine
Playing with the CONNECT storage engineFederico Razzoli
 
Database Design most common pitfalls
Database Design most common pitfallsDatabase Design most common pitfalls
Database Design most common pitfallsFederico Razzoli
 
JSON in MySQL and MariaDB Databases
JSON in MySQL and MariaDB DatabasesJSON in MySQL and MariaDB Databases
JSON in MySQL and MariaDB DatabasesFederico Razzoli
 
How MySQL can boost (or kill) your application v2
How MySQL can boost (or kill) your application v2How MySQL can boost (or kill) your application v2
How MySQL can boost (or kill) your application v2Federico Razzoli
 
MySQL Transaction Isolation Levels (lightning talk)
MySQL Transaction Isolation Levels (lightning talk)MySQL Transaction Isolation Levels (lightning talk)
MySQL Transaction Isolation Levels (lightning talk)Federico Razzoli
 
Cassandra sharding and consistency (lightning talk)
Cassandra sharding and consistency (lightning talk)Cassandra sharding and consistency (lightning talk)
Cassandra sharding and consistency (lightning talk)Federico Razzoli
 
MySQL Query Optimisation 101
MySQL Query Optimisation 101MySQL Query Optimisation 101
MySQL Query Optimisation 101Federico Razzoli
 
How MySQL can boost (or kill) your application
How MySQL can boost (or kill) your applicationHow MySQL can boost (or kill) your application
How MySQL can boost (or kill) your applicationFederico Razzoli
 

Plus de Federico Razzoli (15)

Recent MariaDB features to learn for a happy life
Recent MariaDB features to learn for a happy lifeRecent MariaDB features to learn for a happy life
Recent MariaDB features to learn for a happy life
 
Advanced MariaDB features that developers love.pdf
Advanced MariaDB features that developers love.pdfAdvanced MariaDB features that developers love.pdf
Advanced MariaDB features that developers love.pdf
 
Automate MariaDB Galera clusters deployments with Ansible
Automate MariaDB Galera clusters deployments with AnsibleAutomate MariaDB Galera clusters deployments with Ansible
Automate MariaDB Galera clusters deployments with Ansible
 
MariaDB, MySQL and Ansible: automating database infrastructures
MariaDB, MySQL and Ansible: automating database infrastructuresMariaDB, MySQL and Ansible: automating database infrastructures
MariaDB, MySQL and Ansible: automating database infrastructures
 
Playing with the CONNECT storage engine
Playing with the CONNECT storage enginePlaying with the CONNECT storage engine
Playing with the CONNECT storage engine
 
MariaDB Temporal Tables
MariaDB Temporal TablesMariaDB Temporal Tables
MariaDB Temporal Tables
 
Database Design most common pitfalls
Database Design most common pitfallsDatabase Design most common pitfalls
Database Design most common pitfalls
 
MySQL and MariaDB Backups
MySQL and MariaDB BackupsMySQL and MariaDB Backups
MySQL and MariaDB Backups
 
JSON in MySQL and MariaDB Databases
JSON in MySQL and MariaDB DatabasesJSON in MySQL and MariaDB Databases
JSON in MySQL and MariaDB Databases
 
How MySQL can boost (or kill) your application v2
How MySQL can boost (or kill) your application v2How MySQL can boost (or kill) your application v2
How MySQL can boost (or kill) your application v2
 
MySQL Transaction Isolation Levels (lightning talk)
MySQL Transaction Isolation Levels (lightning talk)MySQL Transaction Isolation Levels (lightning talk)
MySQL Transaction Isolation Levels (lightning talk)
 
Cassandra sharding and consistency (lightning talk)
Cassandra sharding and consistency (lightning talk)Cassandra sharding and consistency (lightning talk)
Cassandra sharding and consistency (lightning talk)
 
MariaDB Temporal Tables
MariaDB Temporal TablesMariaDB Temporal Tables
MariaDB Temporal Tables
 
MySQL Query Optimisation 101
MySQL Query Optimisation 101MySQL Query Optimisation 101
MySQL Query Optimisation 101
 
How MySQL can boost (or kill) your application
How MySQL can boost (or kill) your applicationHow MySQL can boost (or kill) your application
How MySQL can boost (or kill) your application
 

Creating Vagrant development machines with MariaDB

  • 1.
  • 3.
  • 5.
  • 11.
  • 12. # -*- mode: ruby -*- # vi: set ft=ruby :
  • 13. BOX = ENV["BOX"] || "ubuntu/bionic64" Vagrant.require_version ">= 2.2.14" Vagrant.configure("2") do |config| # set Vagrant options config.vm.box = BOX ... config.vm.provider "virtualbox" do |vb| # set provider-level options ... end config.vm.provider "vmware_fusion" config.vm.provision :shell, path: "bootstrap.sh" end
  • 14. virtualbox config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "name", "lamp"] vb.customize ["modifyvm", :id, "--memory", 1024 * 4] vb.customize ["modifyvm", :id, "--cpuhotplug", "on"] vb.customize ["modifyvm", :id, "--cpus", "2"] vb.customize ["modifyvm", :id, "--vram", "4"] end
  • 15. virtualbox config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "name", "lamp"] vb.customize ["modifyvm", :id, "--memory", 1024 * 4] vb.customize ["modifyvm", :id, "--cpuhotplug", "on"] vb.customize ["modifyvm", :id, "--cpus", "2"] vb.customize ["modifyvm", :id, "--vram", "4"] end
  • 17. virtualbox config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "name", "lamp"] vb.customize ["modifyvm", :id, "--memory", 1024 * 4] vb.customize ["modifyvm", :id, "--cpuhotplug", "on"] vb.customize ["modifyvm", :id, "--cpus", "2"] vb.customize ["modifyvm", :id, "--vram", "4"] end
  • 18. virtualbox config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "name", "lamp"] vb.customize ["modifyvm", :id, "--memory", 1024 * 4] vb.customize ["modifyvm", :id, "--cpuhotplug", "on"] vb.customize ["modifyvm", :id, "--cpus", "2"] vb.customize ["modifyvm", :id, "--vram", "4"] end VBoxManage modifyvm "VM name" --plugcpu 1 VBoxManage modifyvm "VM name" --unplugcpu 1
  • 19. virtualbox config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "name", "lamp"] vb.customize ["modifyvm", :id, "--memory", 1024 * 4] vb.customize ["modifyvm", :id, "--cpuhotplug", "on"] vb.customize ["modifyvm", :id, "--cpus", "2"] vb.customize ["modifyvm", :id, "--vram", "4"] end
  • 20. virtualbox config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "name", "lamp"] vb.customize ["modifyvm", :id, "--memory", 1024 * 4] vb.customize ["modifyvm", :id, "--cpuhotplug", "on"] vb.customize ["modifyvm", :id, "--cpus", "2"] vb.customize ["modifyvm", :id, "--vram", "4"] end
  • 21. Vagrant.configure("2") do |config| ... config.vm.provision :shell, path: "bootstrap.sh" # OR config.vm.provision "ansible" do |ansible| ansible.playbook = "mariadb.yml" end end
  • 22. - name: Upload my.cnf copy: src: ./files/my.cnf dest: /etc/mysql/conf.d/