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?
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: \"@\"
This is a guide how to configure authentication for cloudflare’s terraform provider.
One of my colleagues mentioned that it’s not exactly clear how to do that.
This manual is describing experience with cloudflare’s enterprise account, for other types of cloudflare’s accounts your mileage may vary.
This is a guide how to install:
side by side on MacOS 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.
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
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 }'
Sometimes when you commit something nasty, you need to rewrite it. Or you may need to split commit into parts. Or whatever.
Use case: You want to remove some files that you added with your commit.
I presume that you are familiar with:
- Chef
- test-kitchen
- serverspec
When you write serverspec integration tests, it would be great to have access to chef attributes of cookbook that you’re testing.
There’s a fast and simple way to do this.
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.