In my last I was looking for a way to do performance monitoring and I stumbled upon Prometheus.
Prometheus is much more than monitoring a single node service. Anyway let’s get the idea of gathering metrics using MySQL as example.

Prometheus ships with an expression browser. Giving you the opportunity to access and graph the data.
It also provides his own query language :)
Without graphing the following two queries should be self-explaining:

Brian Brazil mentioned to use another (function)[https://prometheus.io/docs/querying/functions/] thx \o/

rate(mysql_global_status_created_tmp_disk_tables[2m])

I recommend to use Grafana as dashboard. You just need to provide the Prometheus server as source and reuse the Queries
you used in the expression browser. There is also PomDash, but afaik Grafana is the way to go.

Prometheus rocks. Having a central point to do the performance analysis of the whole datacenter is awesome.
There a lot of exporters you can use. Even writing your own exporter is quite easy.

Viel Spaß

Erkan

[Update]

There is a nice presentation I recommend to check it and see the nice graphs Grafana builds :)

[Update2]

Percona is always great in adopting new stuff. Today they announced there Percona Monitoring and Management. Of course it uses also some exporters, Prometheus and Grafana. I’m quite sure it would/could kill other solutions on the market \o/

This blogpost extends last one. In the last blogpost, we had
a look into Docker Network and how it makes the communication between the containers (over multiple hosts) easier. Of course we used Galera
for that :)

In this blogpost we are going to use Docker Swarm to bootstrap a Galera Cluster.

Why using Docker Swarm?

Docker Swarm is (simplified) a proxy. So we've got one accesspoint to manage multiple
hosts. (The swarm manage service will run on 172.17.152.11:2376).
We also use Docker Swarm to abstract from the nodes. As we want the cluster to be running
but we don't want to define explicitly where to run them. (Think about a 3-node-cluster on
Docker Swarm with 100 nodes.)

Galera und Docker Network

Using Docker to run Galera on multiple nodes is quite a mess as described
here.
It is possible but no fun at all. As Docker does NATing every bidirectional setup is
complicated.

Starting with Docker Network (version 1.9) you can simply span a Docker owned network (multiple of them) over
multiple nodes. These networks are separated as the known bridged network Docker uses by default.
It also provides a simple node/container discovery using the --name switch. Feels like a simple DNS.

Let's have a look how easy it is to deploy a Galera cluster. It is not for production. I use my own Docker image.
It is just to play around.

This is a quite simple and insecure example. Docker Network will change also the
way we build simple MySQL replication setups.
If you used to use --links. Get rid of it. As they are deprecated already in favor of Docker Network.
Next time we are going to use Docker Swarm (on top of Docker Network) to deploy a Galera Cluster.

Docker is kinda awesome, as it releases a lot of creativity and let
us rethink infrastructure. Think about upgrading an application(docker container).
We just stop the old one and start the new container. Rollback is easy as
stopping the new container and starting from the old image.

Let’s have a look at nginx. Within the Docker ecosystem, in a world where the
backends come and go. You profit from writing the nginx configuration
in a dynamic way. Most likely using confd or consul-template.

After that you stop the container and start it new from the image.

Kinda silly!

Why?

Sending nginx a SIGHUP would have told it to simply reread the configuration without stopping it by spawning a new process.

Nginx even has a nice trick to upgrade. Sending a SIGUSR2 nginx spawns a new process with the new binary.

Ok as a fact I was kinda involved. Even the work is done by Stefan all alone.

We meat for a day in a coworking space and discussed about Galera and Mesos.

In the end Stefan produced this incredible blogpost and pushed Mesos forward.

Whats the fun about this post?

We already now Galera is already the standard in a lot of architectures. For example OpenStack.

Doing consultant work for Docker also I encourage to use Galera for all this infrastructures Docker runs on.

Mesos is about to run easy on 1000 nodes. It has a nice abstraction of nodes and framework. Companies like Airbnb, Paypal, eBay, Groupon use Mesos. Having a Galera poc for Mesos is going to make it likely to have MySQL (etc.) being a native part in Mesos installations.

There had been another customer I was allowed to help to deploy Galera on CoreOS\o/.

At least I plan to help deploy Galera on other cluster or multi-node solutions for Docker also :)

Stay tuned as there is a plan to have a little series about Galera@Docker on the coderships website too.

Using master-master for MySQL? To be frankly we need to get rid of that
architecture. We are skipping the active-active setup and show why
master-master even for failover reasons is the wrong decision.

So why does a DBA thinks master-master is good for in a failover scenario?

The recovered node does get his data automatically.

You need not to use a backup for recovery.

Please remember: MySQL Replication is async

Again: MySQL Replication is async. Even the so called semi-sync Replication!