Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ansible for large scale deployment

3,175 views

Published on

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.

Published in: Technology
  • Be the first to comment

Ansible for large scale deployment

  1. 1. Large Scale MySQL Deployment Using Ansible Karthik .P.R Lead MySQL DBA – Yahoo! (26-06-2015)
  2. 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. 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.
  4. 4. Central Configuration Management Need for Central Configuration Management ?
  5. 5. Central Configuration Management Need for Central Configuration Management ? • Large scale deployment • Configuration changes • User management • Avoid manual intervention • Track changes
  6. 6. Central Configuration Management General Architecture
  7. 7. Available Tools • Ansible • Chef • Puppet • Salt • CFEngine • Vagrant
  8. 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. 9. Why Ansible ? • Agent less • Simple and more readable • Uses SSH protocol • Push based ( Pull is also possible ) • idempotent • Orchestration
  10. 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. 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.
  12. 12. Ansible Architecture
  13. 13. Configuration • Config File • ANSIBLE_CONFIG Env variable • ./ansible_config • ~/.ansible_config • /etc/ansible/ansible.cfg • Inventory • /etc/ansible/hosts • (OR) Dynamic Inventory
  14. 14. Configuration • Inventory • Hosts • Groups • Sub groups • Group configs Playbooks has their own inventory list in INI format
  15. 15. Configuration • Sample Inventory [master] sports.db1.com finance.db1.com [slave] sports.db2.com finance.db2.com [dbserver] master slave
  16. 16. Modules MySQL Modules: • mysql_replication • mysql_user • mysql_variables • mysql_db # Set read_only variable to 1 - mysql_variables: variable=read_only value=1 login_host=db2.finance.com
  17. 17. Sample YAML
  18. 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. 19. Best Practices • Use Version Control for Playbooks. • Headless user for deployment. • Use push based method. • YAML needs a good editor ( Atom, Notepad ++ , etc )
  20. 20. To get started • Ansible galaxy make things more simple
  21. 21. More Reading • Ansible Official • Slideshare • Books : Ansible Up & Running.
  22. 22. Thanks !!!

×