Docker + GlusterFS = Dockit (An easy way of GlusterFS deployment with Docker)

As you know, docker and GlusterFS are widely adopted by IT world.
The integration of glusterfs and docker technologies should be done without delay, so as to benefit from the fast paced advances in technology.

For those who already know these terms Docker & GlusterFS , please skip below introduction , and start from “DOCKIT” section:

If you didnt reach DOCKIT section:

GlusterFS :

“GlusterFS is an open source, distributed file system capable of scaling to several petabytes (actually, 72 brontobytes!) and handling thousands of clients. GlusterFS clusters together storage building blocks over Infiniband RDMA or TCP/IP interconnect, aggregating disk and memory resources and managing data in a single global namespace. GlusterFS is based on a stackable user space design and can deliver exceptional performance for diverse workloads…. continue reading at gluster.org/documentation/About_Gluster/

Docker :

“Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows, Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. As a result, IT can ship faster and run the same app, unchanged, on laptops, data center VMs, and any cloud…. continue reading at www.docker.com/whatisdocker/. “

DOCKIT:

Dockit is an application which is developed for:

Easy deployment of Containers from any docker image.
Easy deployment of GlusterFS containers with any version of GlusterFS binary
& auto configuration of GlusterFS Volumes.

More details can be fetched from github.com/humblec/dockit/blob/master/README.md

However let me put some more examples and use cases here:

Assume you dont have much idea about Docker and GlusterFS, however would like to deploy GlusterFS in containers with specific version of gluster binary. Then it is as easy as running below command in your system:

Let me explain above options, but you can see, ‘dockit –help’ already has information about these options 🙂

Any way, here is the conclusion of above command :

Pull (-p) an image ( -i) called “f20-glusterfs-source” with tag ( -t latest) from docker repo (-r) ‘humble’ and start ( -s ) 2 containers (-n 2 ): Also work in gluster mode ( -g) and install “3.5” version of gluster binary ( –gi 3.5 ) inside these containers and auto configure gluster Volume (–gv) by fetching details from configuration file called configfile ( -c configfile) .

Thats it 🙂

What is inside my configfile ? It has similar entries as shown here:

I think the only entry which need some explanation here is VOL_TYPE – It is “distribute-replica-stripe” format.

Lets see what happens if we run previously mentioned command?

All good, how-ever lets start with proofs even though dockit claimed everything was perfect:

First of all, are the newly created containers running ?

Well, lets login to one of the containers using password ‘redhat‘:
From dockit output we know container IPs are :[u’172.17.0.2′, u’172.17.0.3′, u’172.17.0.4′, u’172.17.0.5′]

Considering the HOST system as gluster client , lets try to mount the Volume created by Dockit!

Now, let me ask following questions :

Did you install docker packages in your system ?
Did you start docker daemon ?
Did you download the image from docker repository?
Did you create brick directories in your filesystem?
Did you run containers with exported bricks from host?
Did you install GlusterFS on these containers from gluster source ?
Did you configure a gluster Volume across these container nodes ?
…etc

Everything was taken care by “Dockit” !!

Apart from above,

Dockit can be used build containers from Dockerfile and spawn containers using the built image

.You can operate in gluster mode on these containers as well.

Isnt it worth to give a try ? Criticize ? Point Bugs ? Fill TODOs ..etc ? Please do so. 🙂

NOTE: If you have used “-p” in your command options and if it failed at first attempt, give it a try once again. I have seen manual pulling with docker commands fail at last second , even-though everything was successful.

If you are NOT using the images listed under below repo, please make sure “SSH deamon is running on the containers and root password is “redhat”. UPDATE: now the password is asked by dockit at time of deployment.

hub.docker.com/u/humble/

Both Images in above repository has ssh deamon running and root password configured as “redhat”:

fed20-gluster : This image has 3.5 gluster packages in it
f20-glusterfs-source : This image has all prerequisites packages installed for GlusterFS source compilation

PS #

The “dockit” project is available from github and gluster forge:
github.com/humblec/dockit
forge.gluster.org/dockit

Even though its undergoing active development, the current version is pretty stable. Please let me know if you would like to see any features included in the same.

Leave a Reply

Your email address will not be published. Required fields are marked *