Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

MySQL Configuration Management

DZone's Guide to

MySQL Configuration Management

Dimitri Vanoverbeke offers an overview of using various DevOps tools for MySQL configuration with either Puppet, Chef, or Ansible.

· DevOps Zone
Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

MySQL Configuration Management

MySQL configuration management remains a hot topic, as I’ve noticed on numerous occasions during my conversations with customers.

I thought it might be a good idea to start a blog series that goes deeper in detail into some of the different options and what modules potentially might be used for managing your MySQL database infrastructure.

Configuration management has been around since way before the beginning of my professional career. I, myself, originally began working on integrating an infrastructure with my colleagues using Puppet.

Why Is Configuration Management Important?

Reproducibility

It’s giving us the ability to provision any environment in an automated way and feel sure that the new environment will contain the same configuration.

Fast Restoration

Thanks to reproducibility, you can quickly provision machines in case of disasters. This makes sure you can focus on restoring your actual data instead of worrying about the deployment and configuration of your machines.

Integral Part of Continuous Deployment

Continuous Deployment is a terminology everyone loves: being able to deploy changes rapidly and automatically after automated regression testing requires a configuration management solution.

Compliance and Security

Solutions like Puppet and Chef maintain and enforce configuration parameters on your infrastructure. This can sound bothersome at first, but it’s essential for maintaining a well-configured environment.

Documented Environment

Although reading someone’s puppet code can potentially harm you beyond insanity, it provides you with the real truth about your infrastructure.

Efficiency and Manageability

Configuration management can automate repetitive tasks (for example, user grants, database creation, configuration variables), as well as security updates, service restarts, etc. These can potentially bring you less work and faster rollouts.

Which Players Are Active in This Field?

The most popular open source solutions are Puppet, Chef, Ansible, and CFengine (among others). In this series, we will go deeper in the first three of them.

Let’s first start by giving you a quick, high-level introduction.

Puppet

Puppet is a language used to describe the desired state of an environment. The Puppet client reads the catalog of the expected state from the server and enforces these changes on the client. The system works based on a client/server principle.

Puppet has as default four essential components:

  1. Puppet Server: A Java virtual machine offering Puppet’s core services.
  2. Puppet Agent: A client library that requests configuration catalog info from the puppet-server.
  3. Hiera: A key-value lookup database, which can store and modify values for specific hosts.
  4. Facter: An application that keeps an inventory of the local node variables.

How can you integrate puppet in your MySQL infrastructure?

  • A ready-made puppet module: This will allow you and your team to create users, databases, install and configure MySQL
  • Use the community Luke: Probably my old “code from hell” module is still somewhere out there.
  • Chef

    Chef also consists of a declarative language (like Puppet) based on Ruby which will allow you to write cookbooks for potential integrable technologies. Chef is also based on a server/client solution. The client being chef nodes, the server managing the cookbooks, catalogs, and recipes.

    In short, Chef consists of:

    • Chef server: Manages the multiple cookbooks and the catalog
    • Chef clients (nodes): The actual system requesting the catalog information from the chef server.
    • Workstations: This is a system that is configured to run Chef command-line tools that synchronize with a Chef-repository or the Chef server. You could also describe this as a Chef development and tooling environment.

    Click here to find out how can you integrate Chef in your MySQL infrastructure.

    Ansible

    Ansible originated with something different in mind. System engineers typically chose to use their own management scripts. This can be troublesome and hard to maintain. Why wouldn’t you use something easy and automated and standardized? Ansible fills in these gaps, and simplifies management of Ansible targets.

    Ansible works by connecting to your nodes (by SSH default) and pushes out Ansible modules to them. These modules represent the desired state of the node, and will be used to execute commands to attain the desired state.

    This procedure is different to Puppet and Chef, which are essentially preferably client/server solutions.

    Some pre-made modules for MySQL are here, here, and here

    Conclusion and Next Steps

    Choose your poison (or magical medicine, you pick the wording), every solution has its perks.

    Keep in mind that in some situations running a complicated Puppet or Chef infrastructure could be overkill. At this moment, a solution like Ansible might be a quick and easily integrable answer for you.

    The next blog post will go over the Puppet Forge MySQL module, so stay tuned!

    Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

    Topics:
    devops ,mysql ,configuration management

    Published at DZone with permission of Dimitri Vanoverbeke, DZone MVB. See the original article here.

    Opinions expressed by DZone contributors are their own.

    THE DZONE NEWSLETTER

    Dev Resources & Solutions Straight to Your Inbox

    Thanks for subscribing!

    Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

    X

    {{ parent.title || parent.header.title}}

    {{ parent.tldr }}

    {{ parent.urlSource.name }}