How to automate the installation of MySQL 5.6 and above

Posted by Matt Bryson on 14-Apr-2016 13:24:59

With the release of MySQL 5.6, there was no longer a default user account with an empty password. For security reasons the root account is now allocated a random password when MySQL is installed, which is written to a log file.

You then look up the password from the log file, and use it to login and change it to something else...

$ sudo grep 'temporary password' /var/log/mysqld.log 
$ mysqladmin -u root --password=RANDOM_PASSWORD_FROM_LOG password myNewSuperSecretPassword1!

This is all well and good, unless you are automating deployment of MySQL. We use vagrant/ansible to spin up our local dev servers, and as soon as we upgraded MySQL, all our MySQL commands started failing as they could no longer authenticate.

There was no obvious way to install with a predefined password, or no password, so we came up with the following to automate setting up MySQL.

Read More

Topics: Ansible, Deployment, Database, yum, CentOS, Linux, MySQL, Vagrant, Provisioning, Technology

Multiplex/shared SSH connections not connecting: "Control socket connect Connection refused. Failed to connect to new control master"

Posted by Matt Bryson on 07-Apr-2016 16:17:56

I was trying to set up SSH Multiplexing on our CI server to speed things up a bit, but for some reason it always failed to use the shared connection.

Read More

Topics: Linux, SSH, Bash, Technology

How to recover an orphaned Docker volume for a data container

Posted by Matt Bryson on 18-Jan-2016 20:58:05

So, last week I was writing a post about cleaning up after docker, and I got a bit carried away and ended up deleting a data container. The container was no longer running, but it's docker volume was still in use by other running containers.

Check out these articles for more info on Images and Containers, Volumes and Data Containers and why you would use them.

Thankfully, I didn't use the -v flag (which removes the containers volumes as well - although volumes in use wont get removed), so I still had all the data, I just had lost the container that created it.

The problem is, docker references the volume via the container when mounting it as a shared volume. As I had deleted the container, I could no longer reference the volume.

Thankfully there is a very simple solution to get the volume mapped back to the data container.

Read More

Topics: Deployment, Docker, Technology

Docker using up all of your disk space? Don't forget to clean up after docker...

Posted by Matt Bryson on 13-Jan-2016 12:54:10

We have some ansible scripts that deploy docker containers on to various environments. All has been going fine until this week, when we fell foul of the untidy teenager that is docker!

Our deployment was failing as the box had run out of disk space. Turns out you need to tidy up after docker...

Read More

Topics: Deployment, Docker, Technology