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

Vagrant up on existing server can not connect to mongo db : { [MongoError: connect ECONNREFUSED] name: 'MongoError', message: 'connect ECONNREFUSED' }

Posted by Matt Bryson on 26-Aug-2015 16:37:33

We often get an issue with our MEAN vagrant dev environments where a previously working server will fail to connect to the mongo db the next time a developer does vagrant up

Read More

Topics: MongoDB, Linux, Vagrant, Bash

Support for Korean / Chinese / Japanese characters in PhantomJS

Posted by Matt Bryson on 22-Jun-2015 12:52:26

We use PhantomJS to auto generate images of user generated content. All was fine, until we entered the Asian markets.
It was not the usual black squares issue that you can get with Phantom, it just had spaces where the Korean characters should have been.

The font itself was loading fine, as Latin characters were in the correct type face.

After following lots of posts about installing font support packs on linux, and non of them working, I finally got it running on Centos with groupinstall for yum

sudo yum groupinstall "Korean Support" "Chinese Support" "Japanese Support"
Read More

Topics: PhantomJS, AWS, yum, CentOS, EB (Elastic Beanstalk), Linux

Compiling phantomJS 2.0 for AWS EC2 linux image

Posted by Matt Bryson on 17-Apr-2015 11:30:08

Back in Feb I wrote about how to compile phantomJS 2.0.0 for linux, using centOS as the build machine. However, the resulting bin files are not portable across all linux distros, hence why the official binaries aren't out yet.

If you need to run phantomJS on one of the AWS machine images, here is how we compiled it on AWS.

Read More

Topics: PhantomJS, EC2, AWS, CentOS, Linux, Bash

Compiling phantomJs 2.0 binaries on Linux

Posted by Matt Bryson on 08-Feb-2015 16:56:26

We were upgrading our automated screen shot process of our core product, moving it over to phantomJS 2.0 as it uses a much newer QT WebKit engine, that produces far more accurate results.

However, there is currently no download for the linux build, so we decided to build it ourselves. After quite a few failed attempts, (using various bash scripts and trying the deploy vm that is in the repo), this is how we finally got it working If you want to cut to the chase, you can grab the 64bit bin file here...

Read More

Topics: PhantomJS, Linux

Shellshock Bash Bug : How to patch Bash on AWS EC2 deployed with Elastic Beanstalk

Posted by Matt Bryson on 26-Sep-2014 10:18:02

In response to the ShellShock bug, we tried to patch all our AWS EC2 servers following this security bulletin... but it didn't work.

Turns out that the instructions in the AWS bulletin don't apply to Elastic Beanstalk deployed servers. After some searching, we found the answer.

Read More

Topics: EC2, AWS, yum, CentOS, EB (Elastic Beanstalk), Linux, Bash, Apache

yum repomd.xml does not match metalink for epel - or other repository

Posted by Matt Bryson on 12-Sep-2014 10:50:46

We had this error the other day when running our vagrant script (centOS box):

[Errno -1] repomd.xml does not match metalink for epel
Trying other mirror.

This tried and failed on every single mirror, and basically hung our deployment.

Read More

Topics: Ansible, Deployment, yum, CentOS, Linux, Vagrant, Provisioning