For those who do not know the Tutum platform, it is a platform that allows the deployment of Docker containers in the cloud. See, it’s worth it: Registration is free for now and will subsequently remain at the end of the beta.


HAProxy is a high performance load balancer tcp/http:


CouchDB is a NoSQL database that allows the storage of data via JSON documents:

Creation of a new Tutum node

First we prepare our Tutum node (our server which will host our containers Docker). Here several options are available to us: use cloud services available in Tutum such as DigitalOcean, AWS,… or then bring ourselves a node. Here we will use DigitalOcean.


Remember to tag your Tutum node to be able to deploy services on it. I have tagged my node couchdb.

Once the node is ready, you can go to the next steps.

Our CouchDB service creation

We create our CouchDB service via the Tutum interface.

Selecting Docker image


Here select tutum/couchdb.

Image setting


I modified a few options like autorestart. You can also (but I forgot in my screenshot) scale the number of containers to deploy: Update the option Number of containers to 3.

Fill the option Deploy tags with the tag you gave to our Tutum node.

Volume setting

I’ve dropped setting up the environment variables because I changed nothing. So passing to the volumes.


Add a persistent volume in Host path, and then click Create and deploy to deploy your service.

The CouchDB service is deployed


And now, our 3 containers are ready.

Our HAProxy service creation

Same thing as the CouchDB service except that we will add a few more options.

Selecting Docker image


Here select tutum/haproxy.

Image setting


I changed the name of the service and I’ve set the port mapping by publicly publishing the port 80 and 1936 (the 1936 is for HAProxy stats interface).

Fill the option Deploy tags with the tag you gave to our Tutum node.

Link CouchDB service to HAProxy service

We must link our CouchDB service to our service HAProxy. Nothing is simpler with Tutum.


Just unroll the Link services at the top menu and select your couchdb service. A link will be created in the table just below.

You can then immediately deploy the service, no need for volumes.

The HAProxy service is deployed

Our load balancer container is up!


We test our installation

Note that you can access your server either via public IP or Tutum FQDN. Example of Tutum FQDN: You will find it on the Nodes on the Tutum interface.

Go to http://FQDN/ and enjoy! Your CouchDB are load balanced.

╭─root@krustyhack ~.  
╰─➤ curl http://FQDN/
╭─root@krustyhack ~  
╰─➤  curl http://FQDN/
╭─root@krustyhack ~  
╰─➤  curl http://FQDN/

You can also access the HAProxy stats: http://FQDN:1936. The login/password: stats/stats.


Even more

And the fun with Tutum is that if you change your CouchDB container scale, by adding 2 containers for example, HAProxy will automatically make the link with the new containers and load balance them. Magic!

Partage !
Click Here to Leave a Comment Below 0 comments