5

In most tutorials, presentations and demos, only stateless services are presented that are load balanced either via DNS (SkyDNS, skydock, etc.) or via reverse proxy, such as HAproxy or Vulcand, which are configured with etcd or ZooKeeper.

Is there a best practice for deploying a cluster of MariaDB and Redis using:

  1. CoreOS + fleet + Docker; or

  2. Mesos + Marathon + Docker

  3. Any other cluster management solution

How can one configure a Redis cluster and a MariaDB cluster (Galera), when the host running Master may change?

https://github.com/sheldonh/coreos-vagrant/tree/master/redis

http://www.severalnines.com/blog/how-deploy-galera-cluster-mysql-using-docker-containers

Anton Evangelatov
  • 1,397
  • 2
  • 14
  • 31

2 Answers2

5

After posting the question, I was lucky and came across a few repositories that have achieved what I am looking for:

Redis

https://github.com/mdevilliers/docker-rediscluster - A Redis cluster with two Redis instances and three Redis Sentinel monitors. If the Master fails, the Sentinels promote the Slave as a Master. Mark has also created a project that configures HAProxy to use the promoted Master - https://github.com/mdevilliers/redishappy

Percona/Galera cluster

An out-of-the-box working docker image - https://github.com/paulczar/docker-percona_galera

Anton Evangelatov
  • 1,397
  • 2
  • 14
  • 31
0

You could use CoreOS (or any other plattform where Docker can run) and Kubernetes with SkyDNS integration this would you allow to fetch the IP-address of the master. Also Kubernetes comes with a proxy (for service discovery) which sets environmental variables in your pods. You could access them at runtime. I think the best way (and a way you need to go) is to use a service discovery tool like SkyDNS or something similar. Here is a simple Kubernetes example.

Also you could do this with fleet and side-kicks but I think Kuberentes does somethings a little bit easier for you and is better to use. It is just a little bit tricky to set it up :)

I didn't used Mesos and Marathon so far but I think they should do this too. They (https://github.com/mesosphere/marathon#features) have all the tools you need to set your cluster up.

joh.scheuer
  • 566
  • 3
  • 11
  • Thanks, Joh. Actually I found a solution for a MySQL-compatible cluster right after posting the question - https://github.com/paulczar/docker-percona_galera . I am still on the lookout for a Redis cluster configuration. – Anton Evangelatov Dec 16 '14 at 10:31
  • In the [example](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/guestbook) above a Redis cluster is deployed on top of Kubernetes and CoreOS. The Redis slaves get start with a [script](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/examples/guestbook/redis-slave/run.sh) the env. variable is provided by Kubernetes proxy as I mentioned above. Hope this helps. – joh.scheuer Dec 16 '14 at 12:59