This is my presentation on MySQL user camp on 26-06-2015.
It gives basic introduction to Ansible and how it can be benefited for MySQL deployment and configuration.
Injustice - Developers Among Us (SciFiDevCon 2024)
Ansible for large scale deployment
1. Large Scale MySQL Deployment Using Ansible
Karthik .P.R
Lead MySQL DBA – Yahoo!
(26-06-2015)
2. About : Karthik.P.R
• 5+ years of experience as a DBA
• Currently : Lead DBA at Yahoo!
• Current Focus : MySQL Tools and Automation.
• Student : M.Sc ( FOSS )
• Blogger : remotemysqldba.blogspot.in
• Contact :
• Email : prkart@gmail.com
• Linkedin : https://in.linkedin.com/in/prkart
• Twitter : @prkart
• Slideshare : https://www.slideshare.net/prkart
3. Current Operation Model
• Deploy using SSH login.
• Custom shell scripts or .bat file.
• Manual Installation.
• Operation run books.
• Scheduled jobs
• Add node to monitoring.
5. Central Configuration Management
Need for Central Configuration Management ?
• Large scale deployment
• Configuration changes
• User management
• Avoid manual intervention
• Track changes
8. Available Tools
• Ansible :
GPL V3,Python , agent less , Playbook ( YAML )
• Chef :
Apache license ,Ruby/Erlang , Cookbooks ( Ruby )
• Puppet :
Apache license ,Ruby, Manifests ( Puppet Language )
• Salt :
Apache license ,Python, States ( YAML )
9. Why Ansible ?
• Agent less
• Simple and more readable
• Uses SSH protocol
• Push based ( Pull is also possible )
• idempotent
• Orchestration
10. Software Requirements
• Control Machine ( Unix based )
• Python 2.6 or 2.7
• Ansible
• pip
• Managed nodes
• Python 2.5
• Python-simplejson
• libselinux-python ( For SELinux )
• Native Power Shell ( Windows )
11. Terminology
• Playbook : Collection of plays. They define the configuration and
Orchestration.
• Inventory : List of hosts and host groups.
• Modules : Can be any language execute remotely.
• Play : Is the minimal mapping for set of hosts.
• Facts : Data collected from target hosts.
18. MySQL Use cases
• Version Specific MySQL Config
Eg) Enable GTID on MySQL 5.6
• Hardware Based Tuning
• Property based variables
• User configuration
• Backup set up
• Monitoring setup using Nagios
• Cronjob or schedulers
19. Best Practices
• Use Version Control for Playbooks.
• Headless user for deployment.
• Use push based method.
• YAML needs a good editor ( Atom, Notepad ++ , etc )