SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
MANAGING MYSQL 
WITH ANSIBLE 
Ben Mildren 
04/11/14
About me – Ben Mildren 
• rDBA Technical Lead, Percona 
– Percona Managed Services 
• Around 15 years RDBMS experience 
• Previous roles include: 
– Team Technical Lead, Pythian 
– Senior Database Administrator, Nokia 
Email: ben.mildren@percona.com 
LinkedIn: benmildren 
Twitter: @productiondba 
Slideshare: benmildren 
2
What will we be covering today? 
1 What? 
What is 
Ansible? 
2 How? 
Usage and 
concepts 
3 Demo! 
Practical 
Examples 
3
What problem are we looking to solve? 
4 
Provisioning? 
Configuration Management? 
Application Deployment? 
Orchestration? 
Automation? 
www.ansible.com/blog/2013/11/29/ansibles-architecture-beyond-configuration-management
Software solutions 
• Puppet: Apache license, www.puppetlabs.com 
– Ruby, Manifests (Puppet language) 
• Chef: Apache license, www.getchef.com 
– Ruby/Erlang, Cookbooks (Ruby) 
• Salt: Apache license, www.saltstack.com 
– Python, States (YAML/Jinja2 (default renderer)) 
• Ansible: GPL v3 license, www.ansible.com 
– Python, Playbooks (YAML/Jinja2) 
5 
http://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software
Why did we choose Ansible? 
• Simple, Readable 
• Declaritive, Idempotent 
• Uses SSH 
• Agentless 
6
Installation Requirements 
• Python 2.X 
– 2.6+ Control Machine 
● Required dependencies including; 
PyYAML, Jinja2, pycrypto, paramiko. 
– 2.4+ Managed Node 
● python-simplejson (if 2.5 or below) 
● libselinux-python (if selinux enabled) 
(and using copy/file/template functions) 
7 
http://docs.ansible.com/intro_installation.html
Installation 
• Package Manager 
– yum (via epel) 
– apt 
• pip 
• Source (https://github.com/ansible/ansible) 
https://github.com/ansible/ansible/blob/devel/CHANGELOG.md 
8 
http://docs.ansible.com/intro_installation.html
Configuration 
• Config file 
ANSIBLE_CONFIG > ./ansible.cfg > 
~/.ansible.cfg > /etc/ansible/ansible.cfg 
(settings are not merged) 
• Inventory file 
– /etc/ansible/hosts (default) 
– or can use dynamic inventory script 
https://github.com/ansible/ansible/tree/devel/plugins/inventory 
9
Inventory File 
• INI format 
– Hosts / Groups 
– Groups of Groups 
– Host and Group variables 
10
Inventory File 
• Example: 
[fra_cluster] 
mysql01 
mysql02 
[deu_cluster] 
mysql03 
mysql04 
[euro_clusters:children] 
fra_cluster 
deu_cluster 
11
Ad-Hoc Commands 
• ansible <host-pattern> [options] 
<host-pattern> → inventory file 
/etc/ansible/hosts (default) 
-i PATH, --inventory=PATH 
[options] 
typically module (-m) & arguments (-a) 
also connectivity, logging, etc 
12
Modules 
• ad-hoc default == command module 
• ansible-doc 
-l, --list 
-s, --snippet [module] 
[module] 
• can develop custom modules 
– Potentially any language, JSON output 
13 
http://docs.ansible.com/modules_by_category.html
Working with MySQL 
• MySQL Specific Modules 
– mysql_db 
– mysql_user 
– mysql_replication 
– mysql_variables 
14
Working with MySQL 
• Other useful modules 
– package manager (yum / apt) 
– service 
– file 
– template 
15
Templates 
• jinja2 formatted 
– variables, conditionals, loops, etc.. 
[mysqld] 
### General options 
user = mysql 
pid-file = {{ mysql_run_dir }}/mysqld.pid 
socket = {{ mysql_run_dir }}/mysqld.sock 
datadir = {{ mysql_data_dir }} 
tmpdir = {{ mysql_tmp_dir }} 
16 
http://jinja.pocoo.org/docs/dev/templates/
Enter the playbook! 
• Written in YAML 
• Consists of one or more “plays” 
– Target section 
– Variable section 
– Task section 
– Handlers section 
• Executed using ansible-playbook 
17
Enter the playbook! 
• conditionals 
• loops 
• async / poll 
• tags 
• error handling 
18
Facts 
• setup 
• will also run ohai and/or facter if installed 
• can be disabled for performance if not 
required 
• set_fact module 
19
Running playbooks 
• ansible-playbook playbook.yml 
– similar connectivity options to ad-hoc ansible 
command 
– Has additional options specific to running 
playbooks, e.g: 
--list-hosts, --list-tasks 
--syntax-check, --check (-C), --diff (-D) 
--step, --start-at-task 
--tags (-t), --skip-tags 
20
Role play 
• Include files 
• Directory Structure 
• Dependencies & Defaults 
• ansible-galaxy 
– init 
– install, list, info, remove 
21
Logging 
• cowsay or nocows=1 
• verbose & verboser 
• ansible log 
• callback plugins 
– Notification (email, campfire, hipchat, etc) 
– improved logging (ELK anybody?) 
22 
https://github.com/ansible/ansible/tree/devel/plugins/callbacks
Password Management 
• lookup passwords 
• ansible-vault 
– create/edit/encrypt/decrypt/rekey 
– aes256 encryption 
ansible-playbook --ask-vault-pass 
ansible-playbook --vault-password-file 
(file or script) 
23
Performance 
• Connectivity 
– fireball (deprecated) 
– accelerated mode 
– pipelining 
• forking 
• ansible-pull? 
24
How can ansible help with MySQL? 
• Installation / Upgrades 
• Managing configuration (mysql & host) 
• User Administration 
• Managing cronjobs 
• Deployments 
• Provisioning new nodes in a cluster 
25
Demo & Questions 
• Pray to the demo gods.... 
• Questions? 
26

Contenu connexe

Tendances

Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2Marcus Deglos
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The SnailMarcus Deglos
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupSaewoong Lee
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansibleKhizer Naeem
 
StackiFest16: Building a Cart
StackiFest16: Building a CartStackiFest16: Building a Cart
StackiFest16: Building a CartStackIQ
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setupMohammad_Tariq
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh thingsMarcus Deglos
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackIQ
 
MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527Saewoong Lee
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackIQ
 
Cobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningCobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningRUDDER
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed Alrashed
 
Ansible for beginners
Ansible for beginnersAnsible for beginners
Ansible for beginnersKuo-Le Mei
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karbanansiblebrno
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Žilvinas Kuusas
 
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg BrunoStackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg BrunoStackIQ
 
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg BrunoStackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg BrunoStackIQ
 

Tendances (20)

Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backup
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
StackiFest16: Building a Cart
StackiFest16: Building a CartStackiFest16: Building a Cart
StackiFest16: Building a Cart
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setup
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh things
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra
 
MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz
 
Cobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningCobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioning
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Ansible for beginners
Ansible for beginnersAnsible for beginners
Ansible for beginners
 
Chef
ChefChef
Chef
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karban
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
 
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg BrunoStackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
 
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg BrunoStackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg Bruno
 
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
 

En vedette

U C2007 My S Q L Performance Cookbook
U C2007  My S Q L  Performance  CookbookU C2007  My S Q L  Performance  Cookbook
U C2007 My S Q L Performance Cookbookguestae36d0
 
Mysql administration
Mysql administrationMysql administration
Mysql administrationbeben benzy
 
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux AdminThe Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux AdminDave Stokes
 
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's ToolchestMaking MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's ToolchestLenz Grimmer
 
SAP HANA Cookbook for MySQL Developers
SAP HANA Cookbook for MySQL DevelopersSAP HANA Cookbook for MySQL Developers
SAP HANA Cookbook for MySQL Developerssaphanacookbook
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMorgan Tocker
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Mydbops
 
Extended Essay
Extended EssayExtended Essay
Extended EssayPhil Evans
 
Rancangan tahunan matematik tingkatan 5 2013
Rancangan tahunan matematik tingkatan 5 2013Rancangan tahunan matematik tingkatan 5 2013
Rancangan tahunan matematik tingkatan 5 2013Saini Bakar
 
MySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema ImprovementsMySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema ImprovementsMark Leith
 
MySQL Administration and Monitoring
MySQL Administration and MonitoringMySQL Administration and Monitoring
MySQL Administration and MonitoringMark Leith
 
Basics Of English Grammar 2 Ppt
Basics Of English Grammar 2 PptBasics Of English Grammar 2 Ppt
Basics Of English Grammar 2 Pptlaurajim21
 
A comprehensive English grammar guide for EFL/ESL teachers
A comprehensive English grammar guide for EFL/ESL teachersA comprehensive English grammar guide for EFL/ESL teachers
A comprehensive English grammar guide for EFL/ESL teachersJane Keeler
 
A comprehensive grammar of the english language quirk greenbaum leech svartvik
A comprehensive grammar of the english language quirk greenbaum leech svartvikA comprehensive grammar of the english language quirk greenbaum leech svartvik
A comprehensive grammar of the english language quirk greenbaum leech svartvikIvana Jovanovic
 

En vedette (15)

U C2007 My S Q L Performance Cookbook
U C2007  My S Q L  Performance  CookbookU C2007  My S Q L  Performance  Cookbook
U C2007 My S Q L Performance Cookbook
 
Mysql administration
Mysql administrationMysql administration
Mysql administration
 
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux AdminThe Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
 
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's ToolchestMaking MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
 
SAP HANA Cookbook for MySQL Developers
SAP HANA Cookbook for MySQL DevelopersSAP HANA Cookbook for MySQL Developers
SAP HANA Cookbook for MySQL Developers
 
MySQL Monitoring 101
MySQL Monitoring 101MySQL Monitoring 101
MySQL Monitoring 101
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.
 
Extended Essay
Extended EssayExtended Essay
Extended Essay
 
Rancangan tahunan matematik tingkatan 5 2013
Rancangan tahunan matematik tingkatan 5 2013Rancangan tahunan matematik tingkatan 5 2013
Rancangan tahunan matematik tingkatan 5 2013
 
MySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema ImprovementsMySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema Improvements
 
MySQL Administration and Monitoring
MySQL Administration and MonitoringMySQL Administration and Monitoring
MySQL Administration and Monitoring
 
Basics Of English Grammar 2 Ppt
Basics Of English Grammar 2 PptBasics Of English Grammar 2 Ppt
Basics Of English Grammar 2 Ppt
 
A comprehensive English grammar guide for EFL/ESL teachers
A comprehensive English grammar guide for EFL/ESL teachersA comprehensive English grammar guide for EFL/ESL teachers
A comprehensive English grammar guide for EFL/ESL teachers
 
A comprehensive grammar of the english language quirk greenbaum leech svartvik
A comprehensive grammar of the english language quirk greenbaum leech svartvikA comprehensive grammar of the english language quirk greenbaum leech svartvik
A comprehensive grammar of the english language quirk greenbaum leech svartvik
 

Similaire à Managing MySQL with Ansible

Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deploymentRemote MySQL DBA
 
Ansible @ WebElement 2015
Ansible @ WebElement 2015Ansible @ WebElement 2015
Ansible @ WebElement 2015Michal Maxian
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupJeff Geerling
 
Introduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUpIntroduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUptylerturk
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAlberto Molina Coballes
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practicesBas Meijer
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsLuís Carneiro
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible referencelaonap166
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsNelson Calero
 
ansible : Infrastructure automation,idempotent and more
ansible : Infrastructure automation,idempotent and moreansible : Infrastructure automation,idempotent and more
ansible : Infrastructure automation,idempotent and moreSabarinath Gnanasekar
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)Puppet
 
PLNOG Automation@Brainly
PLNOG Automation@BrainlyPLNOG Automation@Brainly
PLNOG Automation@Brainlyvespian_256
 
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPROIDEA
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!Jeff Geerling
 
Configuration primer
Configuration primerConfiguration primer
Configuration primerfeanil
 
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsThe Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsBill Malchisky Jr.
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of AnsibleDevOps Ltd.
 
Package management and creation in Gentoo Linux
Package management and creation in Gentoo LinuxPackage management and creation in Gentoo Linux
Package management and creation in Gentoo LinuxDonnie Berkholz
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureAdrian Otto
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Richard Donkin
 

Similaire à Managing MySQL with Ansible (20)

Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
 
Ansible @ WebElement 2015
Ansible @ WebElement 2015Ansible @ WebElement 2015
Ansible @ WebElement 2015
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
 
Introduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUpIntroduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUp
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First Steps
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAs
 
ansible : Infrastructure automation,idempotent and more
ansible : Infrastructure automation,idempotent and moreansible : Infrastructure automation,idempotent and more
ansible : Infrastructure automation,idempotent and more
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)
 
PLNOG Automation@Brainly
PLNOG Automation@BrainlyPLNOG Automation@Brainly
PLNOG Automation@Brainly
 
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł Rozlach
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
 
Configuration primer
Configuration primerConfiguration primer
Configuration primer
 
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsThe Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 
Package management and creation in Gentoo Linux
Package management and creation in Gentoo LinuxPackage management and creation in Gentoo Linux
Package management and creation in Gentoo Linux
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable Infrastructure
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
 

Dernier

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

Managing MySQL with Ansible

  • 1. MANAGING MYSQL WITH ANSIBLE Ben Mildren 04/11/14
  • 2. About me – Ben Mildren • rDBA Technical Lead, Percona – Percona Managed Services • Around 15 years RDBMS experience • Previous roles include: – Team Technical Lead, Pythian – Senior Database Administrator, Nokia Email: ben.mildren@percona.com LinkedIn: benmildren Twitter: @productiondba Slideshare: benmildren 2
  • 3. What will we be covering today? 1 What? What is Ansible? 2 How? Usage and concepts 3 Demo! Practical Examples 3
  • 4. What problem are we looking to solve? 4 Provisioning? Configuration Management? Application Deployment? Orchestration? Automation? www.ansible.com/blog/2013/11/29/ansibles-architecture-beyond-configuration-management
  • 5. Software solutions • Puppet: Apache license, www.puppetlabs.com – Ruby, Manifests (Puppet language) • Chef: Apache license, www.getchef.com – Ruby/Erlang, Cookbooks (Ruby) • Salt: Apache license, www.saltstack.com – Python, States (YAML/Jinja2 (default renderer)) • Ansible: GPL v3 license, www.ansible.com – Python, Playbooks (YAML/Jinja2) 5 http://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software
  • 6. Why did we choose Ansible? • Simple, Readable • Declaritive, Idempotent • Uses SSH • Agentless 6
  • 7. Installation Requirements • Python 2.X – 2.6+ Control Machine ● Required dependencies including; PyYAML, Jinja2, pycrypto, paramiko. – 2.4+ Managed Node ● python-simplejson (if 2.5 or below) ● libselinux-python (if selinux enabled) (and using copy/file/template functions) 7 http://docs.ansible.com/intro_installation.html
  • 8. Installation • Package Manager – yum (via epel) – apt • pip • Source (https://github.com/ansible/ansible) https://github.com/ansible/ansible/blob/devel/CHANGELOG.md 8 http://docs.ansible.com/intro_installation.html
  • 9. Configuration • Config file ANSIBLE_CONFIG > ./ansible.cfg > ~/.ansible.cfg > /etc/ansible/ansible.cfg (settings are not merged) • Inventory file – /etc/ansible/hosts (default) – or can use dynamic inventory script https://github.com/ansible/ansible/tree/devel/plugins/inventory 9
  • 10. Inventory File • INI format – Hosts / Groups – Groups of Groups – Host and Group variables 10
  • 11. Inventory File • Example: [fra_cluster] mysql01 mysql02 [deu_cluster] mysql03 mysql04 [euro_clusters:children] fra_cluster deu_cluster 11
  • 12. Ad-Hoc Commands • ansible <host-pattern> [options] <host-pattern> → inventory file /etc/ansible/hosts (default) -i PATH, --inventory=PATH [options] typically module (-m) & arguments (-a) also connectivity, logging, etc 12
  • 13. Modules • ad-hoc default == command module • ansible-doc -l, --list -s, --snippet [module] [module] • can develop custom modules – Potentially any language, JSON output 13 http://docs.ansible.com/modules_by_category.html
  • 14. Working with MySQL • MySQL Specific Modules – mysql_db – mysql_user – mysql_replication – mysql_variables 14
  • 15. Working with MySQL • Other useful modules – package manager (yum / apt) – service – file – template 15
  • 16. Templates • jinja2 formatted – variables, conditionals, loops, etc.. [mysqld] ### General options user = mysql pid-file = {{ mysql_run_dir }}/mysqld.pid socket = {{ mysql_run_dir }}/mysqld.sock datadir = {{ mysql_data_dir }} tmpdir = {{ mysql_tmp_dir }} 16 http://jinja.pocoo.org/docs/dev/templates/
  • 17. Enter the playbook! • Written in YAML • Consists of one or more “plays” – Target section – Variable section – Task section – Handlers section • Executed using ansible-playbook 17
  • 18. Enter the playbook! • conditionals • loops • async / poll • tags • error handling 18
  • 19. Facts • setup • will also run ohai and/or facter if installed • can be disabled for performance if not required • set_fact module 19
  • 20. Running playbooks • ansible-playbook playbook.yml – similar connectivity options to ad-hoc ansible command – Has additional options specific to running playbooks, e.g: --list-hosts, --list-tasks --syntax-check, --check (-C), --diff (-D) --step, --start-at-task --tags (-t), --skip-tags 20
  • 21. Role play • Include files • Directory Structure • Dependencies & Defaults • ansible-galaxy – init – install, list, info, remove 21
  • 22. Logging • cowsay or nocows=1 • verbose & verboser • ansible log • callback plugins – Notification (email, campfire, hipchat, etc) – improved logging (ELK anybody?) 22 https://github.com/ansible/ansible/tree/devel/plugins/callbacks
  • 23. Password Management • lookup passwords • ansible-vault – create/edit/encrypt/decrypt/rekey – aes256 encryption ansible-playbook --ask-vault-pass ansible-playbook --vault-password-file (file or script) 23
  • 24. Performance • Connectivity – fireball (deprecated) – accelerated mode – pipelining • forking • ansible-pull? 24
  • 25. How can ansible help with MySQL? • Installation / Upgrades • Managing configuration (mysql & host) • User Administration • Managing cronjobs • Deployments • Provisioning new nodes in a cluster 25
  • 26. Demo & Questions • Pray to the demo gods.... • Questions? 26