Yet another one DevOps blog

Ops and DevOps stories

Sep 21, 2019 - 2 minute read - Comments - technical mysql percona systems pitfalls

MySQL/Percona 5.7+ and indefinitely growing temporary tables on the disk

Some time ago I saw an alert in our monitoring, the alert notified us that production MySQL/Percona server had less than 10% of disk space left.
I was worried and curious - where did a 300 GB of free space go? And started to investigate the issue.

I found huge MySQL temporary table on the disk.
Issue was fixed by restarting MySQL server (temporary table become small again).

Incident was serious enough to have a post-mortem.
And we found out that by default in MySQL/Percona 5.7 temporary tables are growing indefinitely on the disk.
So how to fix that?

Aug 8, 2019 - 1 minute read - Comments - technical terraform devops

Terraform >= 0.12.6 map resources import

Intro

In terraform 0.12.6 developers added a nice feature - Multiple Resource Instances Defined By a Map

So now we can create multiple resources and then safely delete one in the middle of map (that was a bit of a pain with lists).

But how to import new map resources?

I’ll show on example of import with hypotetical DNS module for AWS Route53 record:

terraform import module.my_domain_com_dns.aws_route53_record.soa[\"@\"] DOMAINZONEID_mydomain.com_SOA

The most non-obvious part is escaping, so if you map key is @ you will need to escape it: \"@\"

Jun 14, 2019 - 1 minute read - Comments - announcement

Upgrade bash on mac os x

Intro

MacOS X has old 3.x bash. I found it’s very uncomfortable, as it doesn’t fit >4.x bash on most linux host. So you need to remember where do you want to run your scripts:

  • on linux with bash >4.x?
  • on mac os x with bash 3.x?

So - why not upgrade. I found comprehenisve article here: Upgrading Bash on macOS

And now:

$ bash --version
GNU bash, version 5.0.2(1)-release (x86_64-apple-darwin18.2.0)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Much better.

Jun 10, 2019 - 1 minute read - Comments - announcement

Reopen DevOps blog

About reopening

  • After years of laziness, I want to reopen My DevOps blog.
  • Hugo static site generator + autobuilds with Travis CI on push to github repository.
  • Also new domain - verydevops.com

Nov 21, 2014 - 2 minute read - Comments - technical chef knife devops

Chef shortcuts

Add a recipe to the end of run list on certain environment

Test run, not actually add a recipe:

knife exec -E 'nodes.transform ("chef_environment:beta") {|n| puts n.run_list << "recipe[logentries_ng]" }'

Add a recipe for real:

knife exec -E 'nodes.transform ("chef_environment:beta") {|n| puts n.run_list << "recipe[logentries_ng]"; n.save }'

May 3, 2014 - 3 minute read - Comments - technical chef cookiecutter python template

Chef cookbook templating with cookiecutter

One of the challenges in chef cookbook development - create a comprehensive cookbook template.

Good cookbook template might:

  • standartize your cookbooks
  • fill them with convenient predefinitions
  • save your time.

If you are not python averse, you could find that cookiecutter pretty useful tool for creating your cookbooks templates. This article describes my experience in creating chef cookbook template with cookiecutter.